Page tree
Skip to end of metadata
Go to start of metadata

Install Centos 6.3

Initial System Setup

You MUST run all of these commands as the root user!

You MUST disable selinux.  selinux can cause strange behavior during the install

Disable selinux

In /etc/sysconfig/selinux , change the following lines:

--- begin lines --- 
--- end lines --- 

reboot, and verify the selinux status by running 'sestatus'. It should say:

SELinux status: disabled

Update Your System

yum -y update
yum groupinstall core
yum groupinstall base

Install Required Dependencies

yum install gcc gcc-c++ lynx bison mysql-devel mysql-server php php-mysql php-pear php-mbstring tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git subversion kernel-devel php-process crontabs cronie cronie-anacron


Keeping IPTables turned off indefinitely is strongly discouraged. You will incur the wrath of high fees and hackers

You must disable the default iptables.  You can re-enable it later, once you have made the appropriate changes.  Information on iptables can be found with a quick Google search.  If iptables is left running, it will (at very least) block you from accessing the web interface.

See the current status:   

chkconfig iptables --list

Disable iptables:

chkconfig --level 0123456 iptables off

Stop the service (this skips rebooting again):

service iptables stop

Auto Start MySQL

You must have mysql running for freepbx to operate normally.  You need to set it to start at boot time. with the following command:

chkconfig --level 345 mysqld on 

Then start mysqld if you don't plan on rebooting during the installation phase:

service mysqld start

Auto Start Apache

You will want Apache running, so you can access the FreePBX admin interface,  You need to set it to start at boot time. with the following command:

chkconfig --level 345 httpd on 

Then start apache if you don't plan on rebooting during the installation phase:

service httpd start

Install PearDB

pear install db-1.7.14

You may receive a warning:

WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"

At this time it is safe to ignore that message

Reboot server


Install Dependencies for Google Voice

Install iksemel

cd /usr/src
tar xf iksemel-*.tar.gz
cd iksemel-*
make install

Install and Configure Asteriskfreepbx-

Download Asterisk source files.

cd /usr/src

Compile and install DAHDI.

If you have no TDM cards you can skip this step

If you encounter this message: You do not appear to have the sources for the 2.6.32-358.23.2.el6.x86_64 kernel installed.
Run this command:

yum install -y kernel-headers-`uname -r` kernel-devel-`uname -r` glibc-headers

If that doesn't fix the problem, you may have removed the directory /usr/src/kernels . It's easy to fix. Just run these two commands: 

yum remove kernel-devel
yum install kernel-devel 

You can now repeat the installation steps below.

cd /usr/src
tar xvfz dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-*
make all
make install 
make config

Compile and install LIBPRI.

If you have no TDM cards you can skip this step

cd /usr/src
tar xvfz libpri-1.4-current.tar.gz
cd libpri-*
make install

Compile and install Asterisk

During the make menuselect, please choose all options you wish to compile into Asterisk.  
For example, if you want to enable srtp, be sure to enable it at:

Resource Modules -> res_srtp
cd /usr/src
tar xvfz asterisk-11-current.tar.gz
cd asterisk-*
make menuselect
make install
make config
make progdocs

Install Asterisk-Extra-Sounds

cd /var/lib/asterisk/sounds
tar xfz asterisk-extra-sounds-en-gsm-current.tar.gz
rm -f asterisk-extra-sounds-en-gsm-current.tar.gz

Install and Configure FreePBX

Download and extract FreePBX.

cd /usr/src
tar vxfz freepbx-

Now create the Asterisk user and set ownership permissions.

adduser asterisk -M -c "Asterisk User"
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib/asterisk
mkdir /var/www/html
chown -R asterisk. /var/www/

A few small modifications to Apache.

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
service httpd restart

Configure Asterisk database in MYSQL. 

cd /usr/src/freepbx
export ASTERISK_DB_PW=amp109 
mysqladmin -u root create asterisk 
mysqladmin -u root create asteriskcdrdb 
mysql -u root asterisk < SQL/newinstall.sql 
mysql -u root asteriskcdrdb < SQL/cdr_mysql_table.sql 

Set permissions on MYSQL database.

mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -e "flush privileges;"

Restart Asterisk and install FreePBX.

cd /usr/src/freepbx
./start_asterisk start
amportal a ma installall
amportal a reload

** If “. /install_amp” fails to run correctly, in terminal type:

./install_amp --username=asteriskuser --password=$ASTERISK_DB_PW

Finally, one last mod and start FreePBX.

ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
amportal start 

Start FreePBX


http://yourlocalipaddress/html or if you prefer http://localhost/admin

After you enable and update the modules in FreePBX You might see the following error.
Symlink from modules failed 

To correct this error do the following: 

Delete the list of failed files

cd /etc/asterisk
rm ccss.conf confbridge.conf features.conf sip.conf iax.conf logger.conf extensions.conf sip_notify.conf

Then on the FreePBX webUI go to the ‘Module Admin’ and uninstall and reinstall the ‘Camp On’ module. This should resolve the Symlink issue.


  1. Not sure about 6.3, but on CentOS 5.9 SELinux is enabled by default and must be disabled by editing /etc/selinux/config. Also, all sounds can be installed within make menuselect including core, extra, and music on hold.

  2. This should be installed:

    Install Required Dependencies

    yum install sqlite-devel

    1. Also "doxygen" which required for "make progdocs"


  3. On the sounds install part I think the directory to install english is /var/lib/asterisk/sounds/en , correct?

  4. We need to update post_max_size in php.ini as well.

  5. Good afternoon I have a personal problem, I'm finishing the configuration of Asterisk with FreePBX but at the end of the following error below.

    "Connecting to database .. FAILED
    Try running / install_amp -. Username = user - password = pass (using your own user and pass)
    [FATAL] Can not connect to database "

    I've efetuei the following tests as it says above so I tried to create "/ install_amp -. Username = admin - password = admin" most also tried unsuccessfully with a program called "HeidiSQL" al I connect with my usual login and password could help me please!

  6. i had done installation as per above procedure but stuck in below step and it keep continuous command .

    ./start_asterisk start

    cat: /var/run/asterisk/ No such file or directory

    Automatically restarting Asterisk.

    Asterisk ended with exit status 127

    Asterisk died with code 127.

    cat: /var/run/asterisk/ No such file or directory

    Automatically restarting Asterisk.

    Asterisk ended with exit status 127

    Asterisk died with code 127.

    cat: /var/run/asterisk/ No such file or directory

    Automatically restarting Asterisk.


     now i cannot able to stop and proceeed next step..please guide me ..



    1. Hi,


      you should make a symbolic link to the like that:

      ln -s /usr/lib/ /usr/lib64/

  7. If you have many missing dependencies, you may find yourself running configure a lot. If that is the case, you'll do yourself a favour by checking the System Requirements or installing all dependencies via the install_prereq script. It can be found in source folder under /contrib/scripts/install_prereq. Already marked as executable.

  8. As your Asterisk system runs, it will generate logfiles. It is recommended to install the logrotation script in order to compress and rotate those files, to save disk space and to make searching them or cataloguing them easier. To do this, use themake install-logrotate command.

    [root@server asterisk-11.X.Y]# make install-logrotate

  9. My install went good until I got to installing and configuring free pbx and editing the apache file in which i got the response like "sed not a file or directory"  I can't get past this can anyone give me any directions?

  10. Hi, Have a question, I have tried installing the ISO image from the scratch in HP Server, but I failed, when I check with HP Support, the server I have doesn't support kickstart file latest version. Inspite of that, I installed the Asterisk from the source directly. 

    Now my question is, if i install this FreePBX 2.11 manually, would that again to the kickstart file? will that cause any trouble, since my server is now in production. 

    Also the reason am going with the FreePBX is, am planning to buy end point manager, to configure Cisco IP 8841 IP phones, which came along with sip firmware, and at this moment am not able to configure that with plain Asterisk. 


    Any suggestions would be appreciated.