[UPDATE 11-09-2013 – FREEPBX 2.11 FULL RELEASE]
MORE UPDATE : Why not try our VMWare Image of Asterisk 11 and FBX2.11B2, no installation required! Fully functional and business ready.
Hi guys, been a while since I got my hands on the blogging software. Anyway, I would like to share a simple guide to get an Asterisk 11 and FreePBX 2.11 (full release) running on a Debian 6.0x OS. If you use other OSes, the only thing you will probably change is the software repo manager (debians use apt, centos will like use yum) and the packages name. It won’t run too far from the installation shown here. Here’s a quick guide to install to Ubuntu (close to debian installation) and CentOS.
You should use FreePBX 2.11 as it officially supports Asterisk 11. Other versions may work but things may also break
This is a step by step copy paste guide, no explanations are provided. If anything breaks, something is wrong, nothing should break actually
# means it’s a command line you need to copy paste. Of course, don’t copy the # itself, its just an indicator that it’s shell command …
Some of the Asterisk installations steps are taken off http://blogs.digium.com (don’t have to reinvent the wheel..)
This is not a comprehensive installation with best practices etc, but it does take care of some basic security stuff, do read online as much as possible
Get your Debian installed and ready to get worked on, be sure to work on a putty.exe session so be sure to install ssh # apt-get install ssh
- # apt-get update && apt-get upgrade (reboot the box if updates are installed, if clean install no need to reboot)
- # apt-get install –force-yes build-essential ssh sudo libxml2 libxml2-dev libtiff4 libtiff4-dev php5 libapache2-mod-php5 php5-cli php5-curl php5-mysql php5-gd libmysqlclient-dev php-pear php-db linux-headers-`uname -r` curl sox apache2 libssl-dev libncurses5-dev bison libaudiofile-dev subversion libnewt-dev libcurl4-openssl-dev libnet-ssleay-perl openssl libauthen-pam-perl libio-pty-perl vim tcpdump htop php5-cgi mpg123 libdbd-mysql-perl libdbi-perl libhtml-template-perl libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.1 mysql-common libapt-pkg-perl libsqlite3-dev uuid-dev -y (These include dependencies for FreePBX as well and some extras)
- # reboot (yes, reboot, then login to continue from below)
- # 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-11-current.tar.gz
- # tar -zxvf dahdi-linux-complete-current.tar.gz
- # tar -zxvf libpri-1.4-current.tar.gz
- # tar -zxvf asterisk-11-current.tar.gz
- # cd dahdi-*
- # make && make install && make config
- # cd ..
- # cd libpri-*
- # make && make install (if you face errors with esp Ubuntu, you need to get a patch here, you should not see any errors tho)
- Before we install Asterisk, we would like to prep it for FreePBX use, e.g. creating groups and users and associating Apache to run as that low privileged user, dependencies etc, etc..
- # groupadd asterisk
- # useradd -g asterisk -c “Asterisk PBX” -d /var/lib/asterisk asterisk
- # mkdir /var/run/asterisk
- # chown -R asterisk:asterisk /var/run/asterisk
- # cd /etc/apache2 (now, we will attempt to modify apache configs to run as the new user/group asterisk we just created, steps may be different from other OSes, take note)
- # mv envvars envvars.old
- # echo “export APACHE_RUN_USER=asterisk” >> envvars
- # echo “export APACHE_RUN_GROUP=asterisk” >> envvars
- # echo “export APACHE_PID_FILE=/var/run/apache2.pid” >> envvars
- # echo “export APACHE_RUN_DIR=/etc/apache2” >> envvars
- # echo “export APACHE_LOG_DIR=/var/log/apache2” >> envvars
- # chown -R asterisk:asterisk /var/lib/php5
- # /etc/init.d/apache2 restart
- # cd ..
- # cd /usr/src/asterisk-11*
- # contrib/scripts/get_mp3_source.sh
- # ./configure && make menuconfig (when the menu pops up, be sure to select under Add-ons, format_mp3, res_config_mysql, app_mysql, app_saycountpl and cdr_mysql. Now, go to Extra Sound Packages and if you can’t see that left menu option just keep scrolling down using your down arrow key, when you found it, move over to the right menu then select Extra-Sounds-En-WAV, in core sound packages, also select the WAV version for best compatibility. Save and exit)
- # make && make install && make samples (NOTE: Don’t need to make config since we are using FreePBX and we start amportal rather than just asterisk itself)
- At this point you have a running Asterisk server! Congrats, now comes FreePBX. But there’s not much configs, so be prepared for Asterisk complaining about stuff and all if you try to start it.
- # apt-get install -y mysql-server (when prompted, create the MySQL password, for this guide, we will use [email protected] as the password
- # cd /usr/src
- # wget http://mirror.freepbx.org/freepbx-2.11.0.tar.gz (replace appropriate version that’s newer when available, see here )
- # tar -zxvf freepbx*
- # cd freepbx*
- # mysqladmin create asteriskcdrdb -h localhost -u root -p (Enter your MySQL password as above when prompted)
- # mysql -u root -p asteriskcdrdb < /usr/src/freepbx-2.11.0/SQL/cdr_mysql_table.sql (Enter your MySQL password when prompted, also note the directory of FreePBX to match the ver you downloaded)
- # mysqladmin create asterisk -h localhost -u root -p (Enter your MySQL password as above when prompted)
- # mysql -u root -p asterisk < /usr/src/freepbx-2.11.0/SQL/newinstall.sql (Password again)
- # mysql -h localhost -u root -p mysql –execute=”GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO [email protected] IDENTIFIED BY ‘[email protected]’;” (Note: Here we create a new user for FreePBX to use MySQL and that is user asteriskuser with password [email protected], change accordingly)
- # mysql -h localhost -u root -p mysql –execute=”GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY ‘[email protected]’;”
- # cd /usr/src/freepbx-2.11.0/
- # mysql -h localhost -u root -p mysql –execute=”FLUSH PRIVILEGES”
- # asterisk && ./install_amp (AT THIS POINT, ONLY ENTER THE DATABASE PASSWORD YOU CREATED IN STEP 34, in the case above that would be [email protected])
- # /var/lib/asterisk/bin/module_admin upgradeall
- # /var/lib/asterisk/bin/module_admin reload
- Now to sign on to FreePBX. Go to your server http://<ipaddress>/html, default username and password is admin/admin be sure to change that too!!!
- Immediately update all modules in module admin
- NOTE: If you see FreePBX complain about some symlinks, do this below rm /etc/asterisk/iax.conf
- Then refresh your FreePBX browser page, and hit Apply Conf. If there are other .conf files interfering, just rm it and retrieve_conf again….
- VERY IMPORTANT TO DO THIS NOW!!!
- Change the admin password | Go to Admin | Administrators, select admin and change the password there
- Change your AMI password – Go to Settings | Advanced Setting | under Asterisk Manager, change it there to something of your choice
- Change ARI password – Go to Settings | Advanced Settings | under System Settings, change User Portal Admin Password to something of your choice
- Get all the latest packages – Go to Admin | Module Admin | select Basic and Extended, click on download all, upgrade all, click process, wait to download, click Apply
- Sometimes, the SIP Nat settings can be wrong, click on Advanced | Asterisk SIP Settings | Be sure to set to Public to get things started..
- If you get errors with conference just ignore or clear it, it wont come back and conferencing will work just fine
- You should not screen any significant errors or warnings in the Dashboard
- OPTIONALLY, if you want Asterisk to start automatically when reboot
- Create a FreePBX startup script
- # echo “#!/bin/bash” > /usr/bin/amportal-start
# echo “/usr/local/sbin/amportal start” >> /usr/bin/amportal-start
# echo “exit 0” >> /usr/bin/amportal-start
# chmod +x /usr/bin/amportal-start
- # nano /etc/rc.local
- Before where it says exit 0, paste this line
- Reboot at least once
- And there you go, functional FreePBX 2.11 with Asterisk 11 ready to go…
- Test, test and test more
Known issues (this list keeps getting updated!)
- You might get errors with the FreePBX UI not loading and what not and says server error, tail the apache error log, its likely some module like digium modules breaking it, if you get that, run this # amportal a ma disable digiumaddoninstaller
# amportal a ma delete digium_phones
# amportal a ma delete digiumaddoninstaller You can add them later using Module Admin
Thanks and have a great week ahead!