It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
yum update1. Let's check if SELinux is disabled as this can be a cause for unexpected troubles:
sestatusIn results, you should see "Disabled"
yum -y groupinstall core base "Development Tools"
yum -y install lynx tftp-server unixODBC unixODBC-devel mysql-connector-odbc mariadb-server mariadb httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel kernel-headers git crontabs cronie cronie-anacron wget vim uuid-devel sqlite sqlite-devel net-tools gnutls-devel python-devel texinfo libuuid-devel libxml2-devel libsrtp-devel libtool-ltdl libtool-ltdl-devel e2fsprogs-devel keyutils-libs-devel krb5-devel libogg libselinux-devel libsepol-devel libxml2-devel libtiff-devel gmp audiofile-devel libogg-devel openssl-devel zlib-devel perl-DateManip sox git wget net-tools psmisc speex-devel gsm-devel libtool libedit-devel libtool-ltdl libtool-ltdl-devel xmlstarlet3. Let's add repositories for PHP 5:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpmInstall PHP 5.6 for FreePBX
yum -y install php56w php56w-pdo php56w-mysql php56w-mbstring php56w-pear php56w-process php56w-xml php56w-opcache php56w-ldap php56w-intl php56w-soap4. Setup nodeJS:
curl -sL https://rpm.nodesource.com/setup_10.x | bash --
yum install -y nodejs
systemctl enable mariadb.serviceSetup secure settings for MySQL:
systemctl start mariadb
mysql_secure_installation
adduser asterisk -m -c "Asterisk User"7. Set up Apache to autostart and star it:
systemctl enable httpd.service systemctl start httpd.service
pear install Console_Getopt9. Set up "srtp" for create a possibility to Asterisk send encrypted "rtp" data:
cd /usr/src && wget http://sourceforge.net/projects/srtp/files/srtp/1.4.4/srtp-1.4.4.tgz
tar zxvf srtp-*.tgz &&10. Setup libjansson
sed -i 's/RTPW\=rtpw/RTPW\=\.\/rtpw/' /usr/src/srtp/test/rtpw_test.sh &&
cd srtp && autoconf &&
./configure CFLAGS=-fPIC --prefix=/usr &&
make &&
make runtest &&
make uninstall &&
make install
cd /usr/src
wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.10.tar.gz11. Download Asterisk packets:
tar vxfz jansson.tar.gz
rm -f jansson.tar.gz
cd jansson-*
autoreconf -i
./configure --libdir=/usr/lib64
make
make install
cd /usr/src &&12. Setup Lame for MP3 format coding:
wget http://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz &&
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz &&
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz &&
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
cd /usr/src &&13. Setup and compile Dahdi and LibPri:
tar zxvf lame-3.98.4.tar.gz &&
cd lame-3.98.4 &&
./configure &&
make &&
make uninstall &&
make install
cd /usr/src &&
tar xvfz dahdi-linux-complete-current.tar.gz &&
cd dahdi-linux-complete-* &&
make all &&
make install &&
make config
cd /usr/src &&14. Setup and compile Asterisk 16:
tar xvfz libpri-*.tar.gz &&
cd /usr/src/libpri-* &&
make &&
make install
cd /usr/src &&Configure:
tar xvfz asterisk-16*.tar.gz &&
cd asterisk-16.*
./configure --libdir=/usr/lib64 --with-pjproject-bundled --with-crypto --with-ssl=ssl --with-srtp
contrib/scripts/get_mp3_source.sh
make menuselect
make && make install && make config && ldconfig15. Change owner privileges:
chown asterisk.asterisk /var/run/asterisk &&16. Change apache settings:
chown -R asterisk.asterisk /etc/asterisk &&
chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk &&
chown -R asterisk.asterisk /usr/lib64/asterisk
sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 120M/' /etc/php.ini
sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf &&
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
systemctl restart httpd.service && systemctl enable httpd
cd /usr/srcSetup it:
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-14.0-latest.tgz
tar xfz freepbx-14.0-latest.tgz
cd freepbx18. Setup FreePBX to autostart:
./start_asterisk start
./install -n
nano /etc/systemd/system/freepbx.serviceAnd insert this script:
[Unit]Autostart of FreePBX:
Description=FreePBX VoIP Server
After=mariadb.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/fwconsole start -q
ExecStop=/usr/sbin/fwconsole stop -q
[Install]
WantedBy=multi-user.target
systemctl enable freepbx.service
systemctl start freepbxCheck if FreePBX started correctly:
systemctl status -l freepbx.service19. By default the port 80 for http connection is filtered on our CentOS template as you can only access this port from the actual localhost and not from any other public host. To open a port 80 on we need to add an iptables rule. For this template uses firewall-cmd. First, add your port 80 rule with a following command:
firewall-cmd --zone=public --add-port=80/tcp --permanentOnce you add the above firewall rule reload firewall service:
firewall-cmd --reloadAnd check whether the port was added to ipatables rules:
iptables-save | grep 80
-A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPTAnd you are DONE! FreePBX documentation: http://wiki.freepbx.org/