Wondering how to setup freePBX on linode? Our linode Support team is here to lend a hand with your queries and issues.
How to setup freePBX on linode?
FreePBX is a PHP application that allows you to control your Asterisk installation through a web interface.
Today, let us see the steps followed by our support techs to setup FreePBX on linode.
Set Up LAMP Stack
Before you can use FreePBX, you will need to set up a LAMP stack.
- Begin by installing Apache:
apt-get install apache2
- Install MySQL:
apt-get install mysql-server
MySQL will ask you to set a root user password. Remember what you choose, as you will need to use it again later on. - Secure the default installation by issuing the following command:
mysql_secure_installation
Assuming you set a strong root user password in the previous step, you can skip the first option to change the root password. For all other suggestions, choose Y. - Create the databases to be used by the Asterisk system. Start by launching the MySQL CLI:
mysql -p
You will be asked for the password you created when you installed MySQL, then you will be taken to the MySQL command line interface. - Run the following commands, in this order. Be sure to change the password (CHANGEME) to something secure that you will remember. These commands will create two databases named asterisk and astieriskcdr, and give the
asterisk
system user permission to access and modify their contents.create
database asterisk; create database asteriskcdr; GRANT ALL PRIVILEGES ON
asteriskcdr.* TO asterisk@localhost IDENTIFIED BY 'CHANGEME'; GRANT ALL
PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY
'CHANGEME'; flush privileges; exit - Install PHP and related packages:
apt-get install php5 php-pear php5-mysql php5-suhosin php5-cgi php-pear php-db libapache2-mod-php5
- For this installation, we want Apache to run as the Asterisk user. This will allow Apache to access all of the files it needs in order to run FreePBX. Make sure your
/etc/apache2/envvars
file resembles the following:File: /etc/apache2/envvars1 2
export APACHE_RUN_USER=asterisk export APACHE_RUN_GROUP=asterisk
- Change ownership of the Apache lock file:
chown asterisk:asterisk /var/lock/apache2/
- Finally, restart Apache to make sure everything is loaded correctly:
service apache2 restart
Download and Extract FreePBX
- Obtain FreePBX and unpack it by issuing the following commands:
cd
NoteThis is the latest version of FreePBX at the time of this guide’s publication.
/opt wget http://mirror.freepbx.org/freepbx-2.11.0.25.tgz tar -xvf
freepbx-2.11.0.25.tgz chown -R asterisk:asterisk freepbx* su - asterisk
cd /opt/freepbx/ - The FreePBX directory contains SQL files that you can insert into the database we created previously. Issue the following commands to insert this data:
mysql -p asterisk < SQL/newinstall.sql mysql -p asteriskcdr < SQL/cdr_mysql_table.sql exit
Configuration
The FreePBX configuration process will ask you a series of questions that you should pay attention to.
Some of the default values are fine for a production system, but you will want to change the passwords to prevent unauthorized access.
You need to pass the credentials of the MySQL user and database you created above to the configuration script. Issue the following command:
cd /opt/freepbx/
./install_amp
Create VirtualHost
Before you continue your FreePBX installation, you will want to configure a VirtualHost
for the web interface.
You should also secure your installation using SSL and an .htaccess
file. By default, FreePBX installs files to /var/www/html/
; you may leave this as it is. Your VirtualHost
may resemble the following:File: VirtualHost Entry
<VirtualHost |
To update your Apache configuration, you will need to restart the server. Issue the following command:
service apache2 reload
You should now be able to visit your Linode’s IP address or the domain you’ve pointed at your Linode in your web browser.
The first page should prompt you to create a user and password to administer the system from
Configure FreePBX
Now we will use the FreePBX web interface to configure your phone server.
Update the Modules
From your web browser, go to your FreePBX web interface.
- Under the Admin menu select Module Admin.
- Select the Unsupported repository, then press the Check Online button.
- Select the Upgrade All link. Under the Connectivity section, select Google Voice/Chan Motif. If there are other modules on this list you want to install, select them now.
- When finished, press the Process button, and then Confirm.NoteIf downloading modules fails, from the terminal run this command from the terminal:
su asterisk -c 'mkdir /var/www/html/admin/modules/_cache'
. This should resolve the issue. - You will now see a red Apply Config button. Use it to enable the modules and updates you just downloaded.
- To prevent a bug later on, go back to your terminal and issue the following commands:
cd /etc/asterisk rm ccss.conf confbridge.conf features.conf sip.conf iax.conf logger.conf extensions.conf sip_notify.conf
Then repeat Steps 1-4* but select instead to install or reinstall theCamp on
module.
Create an Extension
Your PBX system will need at least one defined extension to send incoming calls to. Note that you can repeat this section for additional extensions.
- Under the Applications menu select Extensions.
- Unless you have a custom device to configure, keep the drop down menu at
Generic SIP Device
and hit submit. - Create your SIP extension. The only fields required are the Extension itself, a Display Name, and a secret (password).
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
In conclusion, our Support Engineers demonstrated how to setup freePBX on linode. Furthermore, we went through different causes and solutions for this specific error
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments