My trials of installing FreePBX
-
I'm skipping the Google voice stuff - I have an old account, but I don't recall the credentials.
add Asterisk user
adduser asterisk -M -c "Asterisk User"
Download Asterisk
cd /usr/src wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz git clone https://github.com/akheron/jansson.git wget http://www.pjsip.org/release/2.2.1/pjproject-2.2.1.tar.bz2
No problems there
Compile and install DAHDI and LibPRI
cd /usr/src tar xvfz dahdi-linux-complete-current.tar.gz tar xvfz libpri-1.4-current.tar.gz rm -f dahdi-linux-complete-current.tar.gz libpri-1.4-current.tar.gz cd dahdi-linux-complete-* make all make install make config cd /usr/src/libpri-1.4.* make make install
-
Compile and install pjproject
cd /usr/src tar -xjvf pjproject-2.2.1.tar.bz2 cd pjproject-2.2.1 CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound\ --disable-resample --disable-video --disable-opencore-amr --libdir=/usr/lib64 make dep make make install
Compile and install jansson
cd /usr/src/jansson autoreconf -i ./configure --libdir=/usr/lib64 make make install
-
Compile and install Asterisk
cd /usr/src tar xvfz asterisk-13-current.tar.gz rm -f asterisk-13-current.tar.gz cd asterisk-* contrib/scripts/install_prereq install ./configure --libdir=/usr/lib64 contrib/scripts/get_mp3_source.sh make menuselect
Now presented with what options I want to install - per the instruction the only thing I add is Format MP3
Click Save and Exit and continue with Asterisk installmake make install make config ldconfig
-
Took a while but Asterisk is installed.
Installing Asterisk extra sounds
mkdir -p /var/lib/asterisk/sounds cd /var/lib/asterisk/sounds wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz tar xfz asterisk-extra-sounds-en-wav-current.tar.gz rm -f asterisk-extra-sounds-en-wav-current.tar.gz # Wideband Audio download wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-g722-current.tar.gz tar xfz asterisk-extra-sounds-en-g722-current.tar.gz rm -f asterisk-extra-sounds-en-g722-current.tar.gz
-
Here the second omission in the instructions. They don't tell you to change the directory before downloading FreePBX. I will include it here.
cd /usr/src wget http://mirror.freepbx.org/freepbx-12.0.3.tgz tar vxfz freepbx-12.0.3.tgz
Change some permissions
chown asterisk. /var/run/asterisk chown -R asterisk. /etc/asterisk chown -R asterisk. /var/{lib,log,spool}/asterisk chown -R asterisk. /usr/lib/asterisk chown -R asterisk. /usr/lib64/asterisk mkdir /var/www/html chown -R asterisk. /var/www/
Output
# chown asterisk. /var/run/asterisk # chown -R asterisk. /etc/asterisk # chown -R asterisk. /var/{lib,log,spool}/asterisk chown -R asterisk. /usr/lib/asterisk chown -R asterisk. /usr/lib64/asterisk mkdir /var/www/html # chown -R asterisk. /usr/lib/asterisk chown: cannot access `/usr/lib/asterisk': No such file or directory # chown -R asterisk. /usr/lib64/asterisk # mkdir /var/www/html mkdir: cannot create directory `/var/www/html': File exists # chown -R asterisk. /var/www/
Odd that there is no /usr/lib/asterisk - so I'll just make a mental note
the /var/www/html directory already exists - so no big deal -
A few mods to Apache
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_orig sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf service httpd restart
Output
Stopping httpd: [ OK ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for c1115759-27921.cloudatcost.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]I'm going to have to fix apache so it knows it's FQDN
-
Configure Asterisk database in MYSQL
cd /usr/src/freepbx export ASTERISK_DB_PW=amp109 mysqladmin -u root create asterisk mysqladmin -u root create asteriskcdrdb
And set permissions on dbs
mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';" mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';" mysql -u root -e "flush privileges;"
Start Asterisk and install FreePBX
cd /usr/src/freepbx ./start_asterisk start ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
Output
Checking for PEAR DB..OK Checking for PEAR Console::Getopt..OK Using username: asteriskuser Using password: ****** Checking user..OK Checking if Asterisk is running..running with PID: 11666..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] Enter your PASSWORD to connect to the 'asterisk' database: [amp109] 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/html] PHP Warning: mkdir(): File exists in /usr/src/freepbx/libfreepbx.install.php on line 197 [FATAL] Cannot create /var/www/html!
Pressing on (the following commands failed because FreePBX didn't do something right (only error noted above - according the instructions on FreePBX.org you can simply re run the install -
./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW})amportal chown amportal a ma installall amportal a reload amportal a ma refreshsignatures amportal chown
And now the system doesn't know amportal command
OK I ran the ./install_amp command again and now amportal commands are working.
Another mod for FreePBX, then we can start it
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3 amportal restart
Add the Commercial Modules repos
cd /usr/src wget -P /etc/yum.repos.d/ -N http://yum.schmoozecom.net/schmooze-commercial/schmooze-commercial.repo yum clean all yum -y install php-5.3-zend-guard-loader sysadmin fail2ban incron ImageMagick service httpd restart amportal a ma download sysadmin amportal a ma install sysadmin
-
And now launching the web portal for the first time.
-
As you can see the system isn't setup to listen to FreePBX's .htaccess files so we have to enable the override to allow these to work.
vi /etc/httpd/conf/httpd.conf
find the line <Directory "/var/www/html"> then local AllowOverride about 14 lines down.
Change AllowOverride = None to AllowOverride = AllSave and quit. now reload httpd
service httpd restart
-
Awesome - that worked.
Nice clean console now..
-
Time for Server level SIP settings
Click on Settings at the top > Asterisk SIP settings
Type in your external IP address (or if the server is directly on the internet, click the Detect External IP)
Type in the range for your internal networks
Click Submit at the bottom to save the changes.
-
OK Hubtech is holding my feet to the fire on these instructions... I need some tweaks I guess.
-
Before doing all of this, did you try the official one line installation method?
https://gist.github.com/monobilisim/7812605
Just copy that script to your machine and run. Have not tested it personally, but it is from the vendor.
-
@scottalanmiller said:
Before doing all of this, did you try the official one line installation method?
https://gist.github.com/monobilisim/7812605
Just copy that script to your machine and run. Have not tested it personally, but it is from the vendor.
That distro is OLD
FreePBX Distro 5.211.65
-
Maybe the script still works, though. Haven't looked through it, is it version dependent?
-
@scottalanmiller said:
Maybe the script still works, though. Haven't looked through it, is it version dependent?
how would one test this out. i'll give it a shot
-
@Hubtech said:
@scottalanmiller said:
Maybe the script still works, though. Haven't looked through it, is it version dependent?
how would one test this out. i'll give it a shot
Run it and see what happens. It does specifically install Asterisk 11 though. 13 is the current.
-
@Hubtech said:
@scottalanmiller said:
Maybe the script still works, though. Haven't looked through it, is it version dependent?
how would one test this out. i'll give it a shot
from a new install, download that script and where ever you put it type ./freepbx-install.sh assuming you named the file that.
-
Found a newer version: https://gist.github.com/monobilisim/6f0502c0232d9bf245fb
-
@Danp said:
Found a newer version: https://gist.github.com/monobilisim/6f0502c0232d9bf245fb
OK just re-imaged one of my other C@C servers and am running this script now.