Here’s an updated guide for installing FreePBX on Ubuntu 12.04. I found a different guide to installing FreePBX against the 12.04 LTS with some minor tweaks.
I have opted for installing 2.9.x of FreePBX because the changes in 2.10 (surely version 3?) at the time of write to be not suitable for production purposes but I will go through install 2.10 as well. Whilst the UI need a to be brought up to date and the project has done with it’s new fancy UI, it needs more time to mature and post install was a mess.
I managed to get FreePBX working with the repository version of Asterisk which was 1.8.x at the time. This will make maintaining Asterisk a lot easier but also have to be careful of future updates which may be incompatible with FreePBX. To install:
sudo apt-get install asterisk asterisk-mysql asterisk-mp3
The above will also install all the dependencies such as MySQL if it’s not installed. MySQL will prompt for a admin password for MySQL. DO NOT FORGET THIS. Other prompts may include the country code i.e 44 for UK.
The install for 2.9 and 2.10 is fairly similar. The Post install is where it differs.
sudo apt-get install apache2 libapache2-mod-php5 php5-gd php5-mysql php-pear php-db sox curl mysql-server mysql-workbench
Go to the source directory:
Download FreePBX 2.9
Go to src directory:
Extract the downloaded zip containing FreePBX:
sudo tar xvzf /tmp/freepbx-2.9.0.tar.gz
or this line for 2.10
sudo tar xvzf /tmp/freepbx-2.10.0.tar.gz
Go into the extracted FreePBX directory:
Create the necessary databases with the commands below:
mysqladmin create asterisk -u root -p
mysqladmin create asteriskcdrdb -u root -p
mysql -u root -p asterisk < SQL/newinstall.sql
mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql
Run each line separately which will prompt for the root password.
Log into MySQL:
mysql -u root -p
Create and grant the new database user access to the database created above:
GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY 'password';
For the above run each line separately and also replace password for the actual password of the new user.
Copy the module configuration file because running the install scripts creates a broken version of the file:
sudo cp /etc/asterisk/modules.conf ~/asterisk-modules.conf
Start the install script:
The script will prompt for some inputs to setup FreePBX. below is the output and my input (if any). Press enter to submit after each question:
Enter your USERNAME to connect to the ‘asterisk’ database:
Enter your PASSWORD to connect to the ‘asterisk’ database:
Enter the hostname of the ‘asterisk’ database:
Enter a USERNAME to connect to the Asterisk Manager interface:
Enter a PASSWORD to connect to the Asterisk Manager interface:
Enter the path to use for your AMP web root:
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
Enter a PASSWORD to perform call transfers with the Flash Operator Panel:
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?
Enter directory in which to store AMP executable scripts:
Enter directory in which to store super-user scripts:
Ensure you you use the password from the database setup when it prompts for Enter your PASSWORD to connect to the ‘asterisk’ database. Other password prompts should be new ones.
Move the configuration file previously backed up back to the newly installed FreePBX:
sudo cp ~/asterisk-modules.conf /etc/asterisk/modules.conf
Add the web user (www-data) to the asterisk group so that asterisk can serve and make changes using the web server:
sudo adduser www-data asterisk
Add the following to the end of a /etc/amportal.conf
sudo amportal start
Restart Apache web server to take hold of the new permissions:
sudo service apache2 restart
If FreePBX started successfully then it has been installed correctly. Continue below to start FreePBX on computer startup.
Remove Asterisk from startup because FreePBX will start it:
sudo update-rc.d -f asterisk remove
Run the background checker:
sudo sed -e s/BACKGROUND=0/BACKGROUND=1/ -i /usr/sbin/safe_asterisk
Add the line below in /etc/rc.local above the line exit 0:
This is the post install for 2.9. Go to the web page to start configuring FreePBX. If the install path was the same as in the above /var/www/ then open up a web browser and point it to the IP address of the machine. Go to the module admin page and ensure all the basic modules are up to date.
FreePBX 2.10 post install is slightly longer because it does not include the modules during the install. Instead the modules have to be downloaded after but this is not very obvious and the webpage does not load properly until this is done.
As per 2.9, go to the website which is usually the IP address of the computer. Running the following will list the network interfaces and their details:
Go to the page and click on FreePBX Administration This should prompt for a username and password. The default for this is admin and admin.
First, install the relevant modules. Click on the Admin link at the top. Ensure the Basic repository is checked and not the others. Click on the Check Online button.
When the page refreshes, there will be a list of modules in with radio buttons for each one along with various badly formatted text. By default a list of modules will have download but keep disabled checked. Change the selection for the following:
Once selected, click on the Process button and then Confirm button. Take note that the process should have a loading icon as if the page is loading. A small window with a scroll bar should appear towards the top right hand side. Scroll down to the bottom and press Return. If this does not appear, wait for the page to complete “loading”. The page will not change the loading icon in the browser will stop / disappear which means it has finished updating. Click on the Admin link at the top and the page to make the Apply Config button to appear at the top. Once that is done, log out and log back in. This time the interface should change and look much cleaner and doesn’t look broken.
Change the admin password in Admin > Administrators from the top menu bar and select admin from the right side of the page to edit the admin user account. Hit the red Apply Config button at the top whenever it appears.
Go back to the modules and check for updates. Whilst they were enabled, the updates were not applied but now it’s easier to navigate the menus. Continue with the rest of the setup as normal such as adding extensions, trunks, etc.
The install is fairly painless to the previous install of FreePBX on Ubuntu 10.04 because it used the repository version of Asterisk which means there is no compiling required.
Whilst installing was easy, I have not managed to get the setup above working with my systems because Asterisk won’t register properly. I hope you have more luck than I have.