Error astrundir in '' is set to but the directory does not exists. installing freepbx

Guys,

I’m going crazy on this one.
when installing freepbx (2.11 and 12.0) i get the following error:

dvs12:/usr/src/freepbx# amportal a ma installall

Please wait…

**** WARNING: ERROR IN CONFIGURATION ****
astrundir in ‘’ is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p ’

mkdir: missing operand
Try `mkdir --help’ for more information.
**** ERROR: COULD NOT CREATE ****
Attempt to execute 'mkdir -p ’ failed with an exit code of 1
You must create this directory and the try again.

What, how, where?

Running debian wheezy
Asterisk 11.0.2
Freepbx 2.11
Followed this guide: http : //wiki. freepbx.org/display/HTGS/Installing+ FreePBX+on+Debian+Wheezy

Is mysql running?

Jup, and working too. Astrisk is running OK, so are a few websites…

because the error said astrundir in ‘’… i thougt it couldn’t read the amportal.conf, but if i move it, it will create a new one… so why can’t it read nothing to find nothing?

did you

make samples

when building asterisk ?

I would make sure you have an /etc/asterisk.conf , copy it from the freepbx install directory if it’s not there.

dicko,

thanks for your reply, yes i did make samples.
i just uninstalled as much as i could and installed asterisk and freepbx clean again. still the same problem…

dont make samples. dont do it at all.

why not?
also i don’t think that will be the problem…

Yes that is the problem. In your asterisk.conf file you dont have “astrundir” defined correctly (probably not at all!). In all of the documentation I wrote and all of the guides I wrote I never say make samples. This is exactly why. FreePBX can and will create all of these files for you

so rm -f /etc/asterisk/*

To get rid of all of the bad configurations in there.

Here is an example of a proper asterisk.conf file

[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk

[options]
transmit_silence_during_record = yes
languageprefix=yes
execincludes=yes

thanks! will try that tomorrow.
still weird because i used multiple guides and all got the same outcome…
i’ll get back to you!

If I end up being wrong (which may happen) just compare your asterisk.conf file in /etc/asterisk to the one provided and you should be able to move forward.

secretly i compared them already… they look the same. still gonna try reinstalling asterisk anyway!

1 Like

OK i did another complete install without making samples.
Everything is OK till ./install_amp .

This is my asterisk.config:

 [directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk

[options]
transmit_silence_during_record = yes
languageprefix=yes
execincludes=yes

This is the output of the installer:

dvs12:/usr/src/freepbx# ./install_amp --username=root --password=beer --webroot /var/www
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Using username: root
Using password: ********
Using Webroot at /var/www
Checking user..OK
Checking if Asterisk is running..running with PID: 1288..OK
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf:
amp_conf [AMPDBHOST] => [localhost]
amp_conf [AMPDBENGINE] => [mysql]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMGRUSER] => [admin]
amp_conf [AMPMGRPASS] => [amp111]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/local/sbin]
amp_conf [AMPWEBROOT] => [/var/www/html]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [FOPWEBROOT] => [/var/www/html/panel]
amp_conf [FOPPASSWORD] => [passw0rd]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AMPDBUSER] => [root]
amp_conf [AMPDBPASS] => [beer]
amp_conf [AMPWEBADDRESS] => [192.168.1.1]
amp_conf [AMPDBNAME] => [asterisk]
amp_conf [ASTETCDIR] => [/etc/asterisk]
amp_conf [ASTMODDIR] => [/usr/lib/asterisk/modules]
amp_conf [ASTVARLIBDIR] => [/var/lib/asterisk]
amp_conf [ASTAGIDIR] => [/var/lib/asterisk/agi-bin]
amp_conf [ASTSPOOLDIR] => [/var/spool/asterisk]
amp_conf [ASTRUNDIR] => [/var/run/asterisk]
amp_conf [ASTLOGDIR] => [/var/log/asterisk]
OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Using asterisk as PBX Engine
Checking for Asterisk version..11.12.0
Checking for selinux..OK
Connecting to database..OK
Checking current version of AMP..2.11.0
Installing new FreePBX files../etc/asterisk/manager.conf has been changed from the original version.
Overwrite (y=yes/a=all/n=no/d=diff/s=shell/x=exit)? y
OK (227 files copied, 0 skipped)
amportal..no fpbx..freepbx_engine..freepbx_setting..gen_amp_conf.php..done
mkdir: missing operand
Try `mkdir --help' for more information.
apply username/password changes to conf files:
running apply_conf.sh from freepbx_settings
sed: can't read /manager.conf: No such file or directory
sed: can't read /manager.conf: No such file or directory
Bootstrapping Configuration Settings
Updating configuration...
/manager.conf user: [] secret: []
Done
done with apply_conf.sh
creating missing #include files..OK
OK
Setting permissions on files..mkdir: missing operand
Try `mkdir --help' for more information.
OK
Checking for upgrades..No further upgrades necessary
Creating or updating freepbx_conf settings....OK
Setting freepbx settings form /etc/amportal.conf
freepbx setting [AMPDBHOST] DOES NOT EXIST, can't set to [localhost]
freepbx setting [AMPDBENGINE] DOES NOT EXIST, can't set to [mysql]
freepbx setting [AMPENGINE] set to [asterisk]
PHP Notice:  Undefined variable: ret3 in /usr/src/freepbx/amp_conf/htdocs/admin/libraries/utility.functions.php on line 1389
freepbx setting [AMPMGRUSER] set to [admin]
PHP Notice:  Undefined variable: ret3 in /usr/src/freepbx/amp_conf/htdocs/admin/libraries/utility.functions.php on line 1389
freepbx setting [AMPMGRPASS] set to [amp111]
freepbx setting [AMPBIN] set to [/var/lib/asterisk/bin]
freepbx setting [AMPSBIN] set to [/usr/local/sbin]
freepbx setting [AMPWEBROOT] set to [/var/www/html]
freepbx setting [AMPCGIBIN] set to [/var/www/cgi-bin ]
freepbx setting [FOPWEBROOT] set to [/var/www/html/panel]
freepbx setting [FOPPASSWORD] DOES NOT EXIST, can't set to [passw0rd]
freepbx setting [AUTHTYPE] set to [database]
freepbx setting [AMPEXTENSIONS] set to [extensions]
freepbx setting [AMPDBUSER] DOES NOT EXIST, can't set to [root]
freepbx setting [AMPDBPASS] DOES NOT EXIST, can't set to [beer]
freepbx setting [AMPWEBADDRESS] set to [192.168.1.1]
freepbx setting [AMPDBNAME] DOES NOT EXIST, can't set to [asterisk]
freepbx setting [ASTETCDIR] set to [/etc/asterisk]
freepbx setting [ASTMODDIR] set to [/usr/lib/asterisk/modules]
freepbx setting [ASTVARLIBDIR] set to [/var/lib/asterisk]
freepbx setting [ASTAGIDIR] set to [/var/lib/asterisk/agi-bin]
freepbx setting [ASTSPOOLDIR] set to [/var/spool/asterisk]
freepbx setting [ASTRUNDIR] set to [/var/run/asterisk]
freepbx setting [ASTLOGDIR] set to [/var/log/asterisk]
freepbx setting [FPBXDBUGFILE] set to [/var/log/asterisk/freepbx_debug]
Generating AMP configs..
Generating Configurations.conf, (if Asterisk is not running, you will get an error
In case of error, start Asterisk and hit the red bar in the GUI to generate the Configurations.conf files
PHP Warning:  passthru() has been disabled for security reasons in /usr/src/freepbx/install_amp on line 227
Generating AMP configs..OK
Please update your modules and reload Asterisk by visiting http://192.168.1.1/admin

*************************************************************************
* Note: It's possible that if you click the red 'Update Now' bar BEFORE *
* updating your modules, your machine will start dropping calls. Ensure *
* that all modules are up to date BEFORE YOU CLICK THE RED BAR. As long *
* as this is observed, your machine will be fully functional whilst the *
* upgrade is in progress.                                               *
*************************************************************************

And there i made the biggest mistake of all times.
When uninstalling freepbx the following showed up:

Removing /var/lib/asterisk/bin/retrieve_parse_amportal_conf.pl.....Done!
Remove /var/www?:
 [y] y
Removing /var/www......Done!
Uninstall Freepbx's Asterisk Database?:
 [y] y
Erasing Database...Done
Successfully Uninstalled FreePBX

I saw the “Remove /var/www” too late, it deleted all the websites running on it and i was so stupid not to have backed up the websites sinds 11-13. i’m F*ked.

Your first problem is right there. You have certain functions disabled in PHP which will essentially break many parts of FreePBX. This whole thread makes more sense now. This is a shared server which probably has safe_mode or some equivalent enabled. Bad mojo for FreePBX

I am unsure of a better way to do this? You specified “/var/www”. You answered “y” to the question proposed to you to delete it. Should I back it up? That seems really strange. When you uninstall any other program does it back itself up somewhere?

Your first problem is right there. You have certain functions disabled
in PHP which will essentially break many parts of FreePBX. This whole
thread makes more sense now. This is a shared server which probably has
safe_mode or some equivalent enabled. Bad mojo for FreePBX

Weird, my php.ini says it’s not disabled… it is virtualized but everything is my own, even the debian install and IP.
Will look into it some more.

I am unsure of a better way to do this? You specified “/var/www”. You
answered “y” to the question proposed to you to delete it. Should I back
it up? That seems really strange. When you uninstall any other program
does it back itself up somewhere?

Never mind. my own fault. I restored allmost everything last night, made a full snapshot and now i’m ready to break everything again haha.

allright guys!
I found the reason PassThru was disabled.
I updated to php5 some time ago and this was the reason it told itself to check the following:

/etc/php5/apache2/conf.d/security.ini

In there it overruled the php.ini !
I’m still bussy recovering the websites. when done i’ll try reinstalling freepbx again!

Well… after trying some things i now get another error:

./install_amp --webroot /var/www
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Using Webroot at /var/www
Checking user..OK
Checking if Asterisk is running..running with PID: 20951..OK
Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default
Creating new /etc/amportal.conf
Enter your USERNAME to connect to the 'asterisk' database:
 [asteriskuser] root
Enter your PASSWORD to connect to the 'asterisk' database:
 [amp109] beer
Enter the hostname of the 'asterisk' database:
 [localhost]
Enter a USERNAME to connect to the Asterisk Manager interface:
 [admin]
Enter a PASSWORD to connect to the Asterisk Manager interface:
 [amp111]
Enter the path to use for your AMP web root:
 [/var/www]
/var/www/html
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
 [192.168.1.1] localhost
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?
 [extensions]
Enter directory in which to store AMP executable scripts:
 [/var/lib/asterisk/bin]

Enter directory in which to store super-user scripts:
 [/usr/local/sbin]

/etc/amportal.conf writtenAssuming new install, --install-moh added to command line
OK
Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf:
amp_conf [AMPDBHOST] => [localhost]
amp_conf [AMPDBENGINE] => [mysql]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMGRUSER] => [admin]
amp_conf [AMPMGRPASS] => [amp111]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/local/sbin]
amp_conf [AMPWEBROOT] => [/var/www/html]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [FOPWEBROOT] => [/var/www/html/panel]
amp_conf [FOPPASSWORD] => [passw0rd]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AMPDBUSER] => [root]
amp_conf [AMPDBPASS] => [beer]
amp_conf [AMPWEBADDRESS] => [localhost]
amp_conf [AMPDBNAME] => [asterisk]
OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Using asterisk as PBX Engine
Checking for Asterisk version..11.12.0
Checking for selinux..OK
Connecting to database..OK
Checking current version of FreePBX..12.0.1rc13
Installing new FreePBX files../etc/asterisk/manager.conf has been changed from the original version.
Overwrite (y=yes/a=all/n=no/d=diff/s=shell/x=exit)? a
OK (1 files copied, 386 skipped)
amportal..no fpbx..freepbx_engine..freepbx_setting..gen_amp_conf.php..done
mkdir: missing operand
Try `mkdir --help' for more information.
apply username/password changes to conf files:
running apply_conf.sh from freepbx_settings
sed: can't read /manager.conf: No such file or directory
sed: can't read /manager.conf: No such file or directory
Bootstrapping Configuration Settings
Updating configuration...
 /manager.conf user: [] secret: []
 Done
done with apply_conf.sh
creating missing #include files..grep: /etc/asterisk/logger.conf: No such file or directory
OK
Setting permissions on files..mkdir: missing operand
Try `mkdir --help' for more information.
OK
Loading Bootstrap..OK
Checking for upgrades..No further upgrades necessary
PHP Notice:  Undefined variable: db in /var/www/html/admin/libraries/cronmanager.class.php on line 92
..OK
Setting freepbx settings form /etc/amportal.conf
freepbx setting [AMPDBHOST] DOES NOT EXIST, can't set to [localhost]
freepbx setting [AMPDBENGINE] DOES NOT EXIST, can't set to [mysql]
freepbx setting [AMPENGINE] set to [asterisk]
freepbx setting [AMPMGRUSER] set to [admin]
PHP Notice:  Undefined index: LOG_NOTIFICATIONS in /var/www/html/admin/libraries/BMO/Notifications.class.php on line 457
freepbx setting [AMPMGRPASS] set to [amp111]
freepbx setting [AMPBIN] set to [/var/lib/asterisk/bin]
freepbx setting [AMPSBIN] set to [/usr/local/sbin]
freepbx setting [AMPWEBROOT] set to [/var/www/html]
freepbx setting [AMPCGIBIN] set to [/var/www/cgi-bin ]
freepbx setting [FOPWEBROOT] set to [/var/www/html/panel]
freepbx setting [FOPPASSWORD] DOES NOT EXIST, can't set to [passw0rd]
freepbx setting [AUTHTYPE] set to [database]
freepbx setting [AMPEXTENSIONS] set to [extensions]
freepbx setting [AMPDBUSER] DOES NOT EXIST, can't set to [root]
freepbx setting [AMPDBPASS] DOES NOT EXIST, can't set to [beer]
freepbx setting [AMPWEBADDRESS] set to [localhost]
freepbx setting [AMPDBNAME] DOES NOT EXIST, can't set to [asterisk]
freepbx setting [ASTETCDIR] set to [/etc/asterisk]
freepbx setting [ASTMODDIR] set to [/usr/lib/asterisk/modules]
freepbx setting [ASTVARLIBDIR] set to [/var/lib/asterisk]
freepbx setting [ASTAGIDIR] set to [/var/lib/asterisk/agi-bin]
freepbx setting [ASTSPOOLDIR] set to [/var/spool/asterisk]
freepbx setting [ASTRUNDIR] set to [/var/run/asterisk]
freepbx setting [ASTLOGDIR] set to [/var/log/asterisk]
freepbx setting [FPBXDBUGFILE] set to [/var/log/asterisk/freepbx_debug]
Generating AMP configs..
Generating Configurations.conf, (if Asterisk is not running, you will get an error)
In case of error, start Asterisk and hit the red bar in the GUI to generate the Configurations.conf files
Generating AMP configs..OK
Please update your modules and reload Asterisk by visiting http://localhost/admin

*************************************************************************
* Note: It's possible that if you click the red 'Update Now' bar BEFORE *
* updating your modules, your machine will start dropping calls. Ensure *
* that all modules are up to date BEFORE YOU CLICK THE RED BAR. As long *
* as this is observed, your machine will be fully functional whilst the *
* upgrade is in progress.                                               *
*************************************************************************
****************************************
* At This Time Please Restart Asterisk *
****************************************
dvs12:/usr/src/freepbx12# service asterisk stop
[ ok ] Stopping Asterisk PBX: asterisk.
dvs12:/usr/src/freepbx12# service asterisk start
[....] Starting Asterisk PBX: asteriskPrivilege escalation protection disabled!
See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details.
. ok
dvs12:/usr/src/freepbx12# amportal a ma installall

Please wait...

**** WARNING: ERROR IN CONFIGURATION ****
astrundir in '/etc/asterisk' is set to  but the directory
does not exists. Attempting to create it with: 'mkdir -p '

mkdir: missing operand
Try `mkdir --help' for more information.
**** ERROR: COULD NOT CREATE  ****
Attempt to execute 'mkdir -p ' failed with an exit code of 1
You must create this directory and the try again.