Step by step instructions for installing
software PBX Asterisk 11.x and control panel FreePBX on CentOS 6.5
Conditions:
CentOS installed and has access to the Internet.
Contents
Before install:
1. # yum -y update
- Turn off
SELinux:
# vi /etc/selinux/config
3. # reboot
- Additional
repos:
5. # rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
6. # rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
7. # yum -y install mc make gcc kernel-devel gcc-c++ ncurses-devel httpd mysql-server mysql mysql-devel php iksemel iksemel-devel crypto-utils openssl-devel gmime gmime-devel spandsp spandsp-devel openldap openldap-devel popt-devel libresample libresample-devel speex speex-devel libcurl-devel speex-tools svn sqlite-devel mod_ssl php-mysql php-pear-MDB2-Driver-mysqli php-mbstring php-gd php-mcrypt libxml2-devel lame bison audiofile-devel sox php-pear-DB php-posix
-
9. # cd /root
10.# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
11.# tar -zxf asterisk-11-current.tar.gz
12.# wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
13.# tar -zxf libpri-1.4-current.tar.gzwget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
14.# tar -zxf dahdi-linux-complete-current.tar.gz
Installing DAHDI, libPRI and Asterisk
1. # cd dahdi-linux-complete-2.9.0+2.9.0.1
2. #make all
3. #make install
4. #make config
5. # cd libpri-1.4.14
6. # make
7. # make install
-
9. # cd asterisk-11.7.0
10.# ./configure --prefix=/usr --exec-prefix=/usr --with-crypto --with-dahdi --with-iconv -with-libcurl --with-gmime --with-iksemel --with-mysqlclient --disable-xmldoc --with-pri --with-spandsp --with-ldap --with-libcurl --with-popt --with-resample --with-speex
11.# make menuselect
12.# contrib/scripts/get_mp3_source.sh
13.# make
14.# make install
15.# make samples
-
17.# ln -s /usr/lib/libasteriskssl.so.1 /usr/lib64/libasteriskssl.so.1
18.# ln -s /usr/lib/libpri.so.1.4 /usr/lib64/libpri.so.1.4
19.# cat contrib/init.d/rc.redhat.asterisk | sed 's/__ASTERISK_SBIN_DIR__/\/usr\/sbin/' > /etc/init.d/asterisk
20.# chkconfig --add asterisk
21.# cp -rf configs/* /etc/asterisk/
-
23.# service dahdi start
24.# service asterisk start
-
Installing FreePBX
1. # wget “http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.5.5/phpMyAdmin-3.5.5-all-languages.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fphpmyadmin%2Ffiles%2FphpMyAdmin%2F3.5.5%2FphpMyAdmin-3.5.5-all-languages.tar.gz%2Fdownload&ts=1358931580&use_mirror=ignum”
2. # tar -zxf phpMyAdmin-3.5.5-all-languages.tar.gz -C /var/www/
- in
/etc/hosts:
4. [IP PBX] pbx-mysql.example.com
[IP PBX] pbx.example.com
- to
/etc/httpd/httpd.conf:
NameVirtualHost *:443
- to
/etc/httpd/conf.d/ssl.conf:
7. DocumentRoot "/var/www/phpmyadmin"
8. ServerName pbx-mysql.example.com:443
9. ErrorLog logs/ssl_phpmyadmin_error_log
10.TransferLog logs/ssl_phpmyadmin_access_log
11.LogLevel warn
12.SSLEngine on
13.
14.SSLProtocol all -SSLv2
15.SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
16.SSLCertificateFile /etc/pki/tls/certs/localhost.crt
17.SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
18.
19.SSLOptions +StdEnvVars
20.
21.<Directory "/var/www/cgi-bin">
22.SSLOptions +StdEnvVars
23.
24.SetEnvIf User-Agent ".*MSIE.*" \
25.nokeepalive ssl-unclean-shutdown \
26.downgrade-1.0 force-response-1.0
27.
28.CustomLog logs/ssl_phpmyadmin_request_log \
29."%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
30.
31.<Directory "/var/www/phpmyadmin">
32.Order allow,deny
33.Allow from [Admin IP]
34.
35.DocumentRoot "/var/www/html"
36.ServerName pbx.example.com:443
37.ErrorLog logs/ssl_html_error_log
38.TransferLog logs/ssl_html_access_log
39.LogLevel warn
40.SSLEngine on
41.
42.SSLProtocol all -SSLv2
43.SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
44.SSLCertificateFile /etc/pki/tls/certs/localhost.crt
45.SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
46.
47.SSLOptions +StdEnvVars
48.
49.<Directory "/var/www/cgi-bin">
50.SSLOptions +StdEnvVars
51.
52.SetEnvIf User-Agent ".*MSIE.*" \
53.nokeepalive ssl-unclean-shutdown \
54.downgrade-1.0 force-response-1.0
55.
56.CustomLog logs/ssl_html_request_log \
57."%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
58.
59.<Directory "/var/www/html">
60.Order allow,deny
61.Allow from [Admin IP]
62.# cd /var/www/
63.# ln -s phpMyAdmin-3.5.5-all-languages phpmyadmin
64.# service httpd restart
65.# chkconfig --levels 345 mysqld on
66.# chkconfig --levels 345 httpd on
67.# service mysqld start
68.# /usr/bin/mysql_secure_installation
69. Change root password for MySQL
70.# cd /root
71.# wget http://mirror.freepbx.org/freepbx-2.11.0.tar.gz
72.# tar -zxf freepbx-2.11.0.tar.gz -C /usr/src
73.# cd /usr/src/freepbx-2.11.0
- Edit
php.ini:
75.# vi /etc/php.ini (or /etc/php4/apache2/php.ini)
76.upload_max_filesize=20M
77.# mysqladmin create asteriskcdrdb -p
78.# mysql -p asteriskcdrdb < SQL/cdr_mysql_table.sql
79.# mysqladmin create asterisk -p
80.# mysql -p asterisk < SQL/newinstall.sql
81.# mysql -p
82.mysql> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '[your password]';
mysql> GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '[your password]';
mysql> flush privileges;
83.# groupadd asterisk
84.# useradd -c "asterisk PBX" -d /var/lib/asterisk -s /sbin/nologin -g asterisk asterisk
- Edit:
86.# vi /etc/httpd/conf/httpd.conf (or /etc/apache2/apache2.conf):
87.User asterisk
88.Group asterisk
89.# chown asterisk /var/lib/php/session
90.# ./install_amp
- In the
database named asterisk for table named freepbx_settings change password
for asterisk manager:
92.# mysql -p
mysql> UPDATE `asterisk`.`freepbx_settings` SET `value` = '[your password 2]' WHERE `freepbx_settings`.`keyword` = 'AMPMGRPASS';
93.# chown asterisk /etc/modprobe.d/dahdi.conf
94.# rm /etc/asterisk/ccss.conf /etc/asterisk/logger.conf /etc/asterisk/iax.conf /etc/asterisk/extensions.conf /etc/asterisk/sip_notify.conf /etc/asterisk/features.conf /etc/asterisk/sip.conf
- Change
something in freepbx admin panel, click Apply (default
username/password – admin/admin)
- Change default password
Additional installation:
1. # yum -y install bind bind-utils mailx ntp
2. # chkconfig --add named
3. # chkconfig --add ntpdate
4. # service ntpdate start
5. # service named start
6. # echo “nameserver 127.0.0.1” > /etc/resolv.conf
7. # echo “nameserver 8.8.8.8” >> /etc/resolv.conf
8. # yum -y install xinetd tftp-server
9. # vi /etc/xinetd.d/tftp
10.-s /tftp -c
11.# mkdir /tftp &&
12.# chown nobody /tftp
13.# vi /etc/sysconfig/iptables
14.# service xinetd start
-
- Add to
iptables config:
-A INPUT -m udp -p udp -d [IP PBX]/32 --dport 5060 -m hashlimit --hashlimit 10/m --hashlimit-burst 10 --hashlimit-mode srcip,dstip,dstport --hashlimit-htable-expire 180 --hashlimit-name SIP -j ACCEPT