Bobcares

FreePBX on linode

by | Jan 22, 2023

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.

  1. Begin by installing Apache:apt-get install apache2
  2. 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.
  3. 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.
  4. 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.
  5. 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
  6. Install PHP and related packages:apt-get install php5 php-pear php5-mysql php5-suhosin php5-cgi php-pear php-db libapache2-mod-php5
  7. 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
  8. Change ownership of the Apache lock file:chown asterisk:asterisk /var/lock/apache2/
  9. Finally, restart Apache to make sure everything is loaded correctly:service apache2 restart

Download and Extract FreePBX

  1. Obtain FreePBX and unpack it by issuing the following commands:cd
    /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/
    NoteThis is the latest version of FreePBX at the time of this guide’s publication.
  2. 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
*:80> ServerAdmin webmaster@example.com ServerName example.com
ServerAlias www.example.com DocumentRoot /var/www/html
</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.

  1. Under the Admin menu select Module Admin.
  2. Select the Unsupported repository, then press the Check Online button.
  3. 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.
  4. 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.
  5. You will now see a red Apply Config button. Use it to enable the modules and updates you just downloaded.
  6. 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 the Camp 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.

  1. Under the Applications menu select Extensions.
  2. Unless you have a custom device to configure, keep the drop down menu at Generic SIP Device and hit submit.
  3. 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.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.