FreePBX with Asterisk
FreePBX is the configuration tool (web GUI) for Asterisk, it does all the configuration works so no need for editing the config files. I will be continuing on my latest asterisk installation. From the previous post, I have installed the required packages needed by FreePBX (apache, php and mysql).
1. Set FreePBX related pre-configs:
1a. Edit the /etc/php5/apache/php.ini
upload_max_filesize = 20M
magic_quotes_gpc = off
memory_limit = 100M
1b. Add an asterisk user
# adduser asterisk --disabled-password --gecos "Asterisk PBX" --home /var/lib/asterisk
1c. Set MySQL database
# mysql -u root -p
CREATE database asteriskcdrdb;
CREATE database asterisk;
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY 'p4ssw0rd';
GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY 'p4ssw0rd';
1d. Edit /etc/asterisk/asterisk.conf
astrundir => /var/run/asterisk
1e. Grant the www-data user access to the asterisk and freepbx directories and files:
# adduser www-data asterisk
Now make sure that asterisk is stopped, and remove it from the startup:
# /etc/init.d/asterisk stop && update-rc.d -f asterisk remove
2. Download and extract FreePBX:
# cd /usr/src/ && wget http://mirror.freepbx.org/freepbx-2.5.2.tar.gz && tar xzvf freepbx-2.5.2.tar.gz && cd freepbx-2.5.2
3. Import tables and DB structure
# mysql -u root -p asteriskcdrdb < /usr/src/freepbx-2.5.2/SQL/cdr_mysql_table.sql
# mysql -u root -p asterisk < /usr/src/freepbx-2.5.2/SQL/newinstall.sql
4. Install FreePBX
# ./start_asterisk
# ./install_amp
You will be asked some questions which are pretty easy so I am not going to walk you through them here. In most cases, the defaults will be fine. After the installation finish, have a look at /etc/amportal.conf for some config tweaks.
5. Configure amportal to start on boot, edit /etc/rc.local, and insert
/usr/local/sbin/amportal start
just above
exit 0
6. Start amportal
# amportal start