Crmgo Blog

CentOS + Asterisk + FreePBX

CentOS + Asterisk + FreePBX

Disable SELinux: SELINUX=disabled Reboot the system Install the required packages Install php-pear-DB Download Asterisk: wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.15.1.tar.gz Extract the archive Install Asterisk Create the asterisk user and change the ownership of Asterisk directories Change the Apache user Download FreePBX Extract the archive Start Apache and MySQL Create the FreePBX databases You can set a root password…

CentOS + Asterisk + FreePBX

Disable SELinux

vim /etc/selinux/config

SELINUX=disabled
Reboot the system

reboot

Install the required packages

yum install -y gcc-c++ ncurses-devel libxml2 libxml2-devel doxygen mysql-server httpd php php-pear php-mysql php-process

Install php-pear-DB

#cd /usr/src
#get http://download.fedora.redhat.com/pub/epel/6/i386/php-pear-DB-1.7.13-3.el6.noarch.rpm
#yum install -y php-pear-DB-1.7.13-3.el6.noarch.rpm
yum install php-pear-DB


Download Asterisk

#get http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.8.1.tar.gz

wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.15.1.tar.gz

Extract the archive

tar zxvf asterisk-1.8.8.1.tar.gz
cd asterisk-1.8.8.1

Install

./configure
make menuselect
make
make install
make samples
make progdocs

Create the asterisk user and change the ownership of Asterisk directories

useradd -d /var/lib/asterisk asterisk
chown -R asterisk /var/run/asterisk
chown -R asterisk /var/log/asterisk
chown -R asterisk /var/lib/asterisk/moh
chown -R asterisk /var/lib/php/session

Change the Apache user

sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf
sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf

Download FreePBX

cd /usr/src/
#get http://mirror.freepbx.org/freepbx-2.9.0.tar.gz
wget http://mirror.freepbx.org/freepbx-2.10.0.tar.gz

Extract the archive

tar zxvf freepbx-2.9.0.tar.gz
cd freepbx-2.9.0

Start Apache and MySQL

service httpd start
chkconfig httpd on
service mysqld start
chkconfig mysqld on

Create FreePBX databases

mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql
mysql
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
flush privileges;
quit

You can set a root password for MySQL

mysqladmin -u root password 'GFHJKBR'

Change the time zone in the PHP configuration to date.timezone = Europe/Moscow

nano +946 /etc/php.ini

Install FreePBX

./start_asterisk start
./install_amp
echo /usr/local/sbin/amportal start >> /etc/rc.local

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.

Categories: FAQ