Install Centos 6.5
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:
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux
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 Additional 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 wget vim php-xml uuid-devel libtool sqlite-devel unixODBC mysql-connector-odbc
IPTables
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 channel-update pear.php.net 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
reboot
Install Dependencies for Google Voice (If needed/wanted)
Install iksemel
cd /usr/src wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz tar xf iksemel-*.tar.gz cd iksemel-* ./configure make make install
Add the Asterisk User
adduser asterisk -M -c "Asterisk User"
Install and Configure Asterisk
Download Asterisk source files.
cd /usr/src 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-13-current.tar.gz git clone https://github.com/akheron/jansson.git wget http://www.pjsip.org/release/2.2.1/pjproject-2.2.1.tar.bz2
Compile and install DAHDI and LibPRI
If you don't have any physical hardware you don't need to run these commands, however, it is still suggested to compile the modules, to allow you to add hardware later.
cd /usr/src tar xvfz dahdi-linux-complete-current.tar.gz tar xvfz libpri-current.tar.gz rm -f dahdi-linux-complete-current.tar.gz libpri-current.tar.gz cd dahdi-linux-complete-* make all make install make config cd /usr/src/libpri-* make make install
Compile and install pjproject
If you are doing this on a 64 bit system, please note that you MUST set the following during configure:
--libdir=/usr/lib64
cd /usr/src tar -xjvf pjproject-2.2.1.tar.bz2 cd pjproject-2.2.1 CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound\ --disable-resample --disable-video --disable-opencore-amr --libdir=/usr/lib64 make dep make make install
Compile and Install jansson
If you are doing this on a 64 bit system, please note that you MUST set the following during configure:
--libdir=/usr/lib64
cd /usr/src/jansson autoreconf -i ./configure --libdir=/usr/lib64 make make install
Compile and install Asterisk
If you are doing this on a 64 bit system, please note that you MUST set the following during configure:
--libdir=/usr/lib64
cd /usr/src tar xvfz asterisk-13-current.tar.gz rm -f asterisk-13-current.tar.gz cd asterisk-* contrib/scripts/install_prereq install ./configure --libdir=/usr/lib64 contrib/scripts/get_mp3_source.sh make menuselect
You will be prompted at the point to pick which modules to build. Most of them will be enabled, but if you want to have MP3 support, you need to manually turn on 'format_mp3' on the first page.
After selecting 'Save & Exit' you can then continue
make make install make config ldconfig
Install Asterisk-Extra-Sounds
Note that this installs the (8khz) 'wav' soundfiles and G722 (High Definition 'Wideband') audio.
mkdir -p /var/lib/asterisk/sounds cd /var/lib/asterisk/sounds wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz tar xfz asterisk-extra-sounds-en-wav-current.tar.gz rm -f asterisk-extra-sounds-en-wav-current.tar.gz # Wideband Audio download wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-g722-current.tar.gz tar xfz asterisk-extra-sounds-en-g722-current.tar.gz rm -f asterisk-extra-sounds-en-g722-current.tar.gz
Install and Configure FreePBX
Download and extract FreePBX.
cd /usr/src wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-12.0-latest.tgz tar vxfz freepbx-12-latest.tgz
Set ownership permissions.
chown asterisk. /var/run/asterisk chown -R asterisk. /etc/asterisk chown -R asterisk. /var/{lib,log,spool}/asterisk chown -R asterisk. /usr/lib/asterisk chown -R asterisk. /usr/lib64/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
Set permissions on MYSQL database.
mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY '${ASTERISK_DB_PW}';" mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO [email protected] IDENTIFIED BY '${ASTERISK_DB_PW}';" mysql -u root -e "flush privileges;"
Restart Asterisk and install FreePBX.
cd /usr/src/freepbx ./start_asterisk start ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW} amportal chown amportal a ma installall amportal a reload amportal a ma refreshsignatures amportal chown
If you see an error about "Uncaught exception 'RuntimeException' with message 'gpg took too long to run.'" it is safe to run "amportal a ma installall" again.
Finally, one last mod and start FreePBX.
ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3 amportal restart
Start FreePBX
Navigate:
http://yourlocalipaddress/html or if you prefer http://localhost/admin
Install and Setup Commercial Modules
Enable the FreePBX Commercial yum repos
wget -P /etc/yum.repos.d/ -N http://yum.schmoozecom.net/schmooze-commercial/schmooze-commercial.repo
yum clean all to clean out yum cache so it will find out new RPMs
yum clean all
yum install needed RPMs for Commercial Modules
yum -y install php-5.3-zend-guard-loader sysadmin fail2ban incron ImageMagick
Restart Apache and Install Sysadmin
service httpd restart amportal a ma download sysadmin amportal a ma install sysadmin
20 Comments
Weslley Jesus de Oliveira
CDR not working...
The database asteriskcdrdb is clear.
There is no other error in FreePBX.
I have done the entire procedure three times. In all the CDR does not work.
thanks!
Andrew Nagy
Please use the forms for any questions. In terms of CDR you have to setup ODBC which is not documented in this tutorial.
Weslley Jesus de Oliveira
Sorry. I will look this up. Thank you!
Joel Snyder
I fiddled with this a bit without knowing a huge amount about what was going on with the adaptive CDRs. Apparently just writing to mySQL is being deprecated, and adaptive CDR is what you want. Who knew. Anyway: I had to install the mysql connector to ODBC:
yum install mysql-connector-odbc
Then, I made the /etc/odbc.ini file to point to the database that the instructions had created:
[
[email protected] asterisk]# cat /etc/odbc.ini
#
# ODBC connection to CDR database
#
[MySQL-asteriskcdrdb]
description = MySQL-asteriskcdrdb
Trace = Off
TraceFile = stderr
Driver = MySQL
SERVER = localhost
PORT = 3306
DATABASE = asteriskcdrdb
#
socket = /var/lib/mysql/mysql.sock
option = 3
You can test that you have gotten this far with isql:
isql MySQL-asteriskcdrdb asteriskuser <thepasswordyoupicked-which-might-be-amp109>
SQL>
Type "help" and if you see the cdr (call data records) and cel (channel event logs) databases, then you're pretty far along.
There was no /etc/asterisk/cdr_adaptive_odbc.conf created, so I created one:
[asteriskcdrdb]
connection=asteriskcdrdb
loguniqueid=yes
table=cdr
alias start => calldate
Then a restart and a CLI> cdr show status and an example call showed that it was all working.
This seems to be the minimum steps needed, at least for me.
tomasrov
thanks for this, CDR works!
dacho
Hello FreePBX junkies
I am trying to install FreePBX 12 on my CentOS 6.6 minimal installation, but I have encountered a problem (see below). Is this a "normal" error that can be ignored?
-------------------------------------------------------------------------
Checking for upgrades..No further upgrades necessary
PHP Notice: Undefined variable: db in /usr/src/freepbx/amp_conf/htdocs/admin/libraries/cronmanager.class.php on line 92
..OK
Clouseau
Tried twice, and I got this issue at the end of
amportal a ma installall
/var/lib/asterisk/bin/freepbx_engine: line 734: syntax error near unexpected token `('
/var/lib/asterisk/bin/freepbx_engine: line 734: ` Usermanager Specific Operations (requires root) (Type 'amportal a userman' to see more)'
Any ideas?
Andrew Nagy
You arent running it as the root user.
Clouseau
Close. It was selinux.
Thanks for the quick reply though
agidi
Help needed, suggestions or pointers.
New VPS Centos 6.5
Im getting on the install and compila asterisk part.
--> Finished Dependency Resolution
Error: Package: libffado-2.1.0-4.el7.x86_64 (epel)
Requires: libm.so.6(GLIBC_2.15)(64bit)
Error: Package: spandsp-0.0.6-0.10.pre21.el7.x86_64 (epel)
Requires: libtiff.so.5()(64bit)
Error: Package: iksemel-1.4-6.el7.x86_64 (epel)
Requires: libgnutls.so.28()(64bit)
Error: Package: pjproject-2.3-6.el7.x86_64 (epel)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: jack-audio-connection-kit-1.9.9.5-4.el7.x86_64 (epel)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: libffado-2.1.0-4.el7.x86_64 (epel)
Requires: libconfig++.so.9()(64bit)
Error: Package: spandsp-0.0.6-0.10.pre21.el7.x86_64 (epel)
Requires: libm.so.6(GLIBC_2.15)(64bit)
Error: Package: libxml++-2.37.1-1.el7.x86_64 (epel)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: jack-audio-connection-kit-1.9.9.5-4.el7.x86_64 (epel)
Requires: libopus.so.0()(64bit)
Error: Package: freetds-0.91-12.git0a42888.el7.x86_64 (epel)
Requires: libgnutls.so.28(GNUTLS_1_4)(64bit)
Error: Package: iksemel-1.4-6.el7.x86_64 (epel)
Requires: libgnutls.so.28(GNUTLS_1_4)(64bit)
Error: Package: freetds-0.91-12.git0a42888.el7.x86_64 (epel)
Requires: libgnutls.so.28()(64bit)
Error: Package: spandsp-0.0.6-0.10.pre21.el7.x86_64 (epel)
Requires: libtiff.so.5(LIBTIFF_4.0)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
please advice
Kevin R
I think there's a missing step right before Install and Configure FreePBX. When you follow the instructions as they're written now, FreePBX gets downloaded to the /var/lib/asterisk/sounds directory when it should go to /usr/src/
Maybe add cd /usr/src/ as the first step in installing FreePBX?
Andrew Nagy
Fixed thanks
Renato
I ran into some error messages during the installation following the script, It should be updated in favor of accuracy if possible.
Some of them still unsolved.
I could not install Digium Add-on Modules
The part of CDR that is out of this tutorial could be included. It would help a lot.
Libgnutls also did not install, as this is only for Google Voice I believe it is safe to ignore it.
.htaccess files were disabled
I used other reference and I believe it would be great to have it in the tutorial as well
Last but not least, when installing the freepbx with the command line (I had to run it twice, first time failed)
./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
it gave me several error messages, probably the tutorial is out dated.
Despite the erros mentioned above it seems the installation got thru but my concerns are what can be done to fix all of that.
Thanks guys. I am a big fan of freepbx, and I miss the times we had the script to convert new installations into official Distro.
BR,
tbagalini
everything went fine until..
[[email protected] freepbx]$ sudo amportal chown
sudo: amportal: command not found
[[email protected] freepbx]$
any ideas??
Thanks!
Preda Spreda
Yes.
Copy /usr/bin/freepbx-12xxx/amp_conf/sbin/amportal to /usr/bin and /usr/sbin
Then do a chmod +x on those files, and do a amportal a ma refreshsignatures
P,
Developer City - dcorp.co
Tom Ray
Added the unixODBC mysql-connector-odbc packages to the "Install Additional Required Dependencies" section for connecting to the CDR database via adaptive CDR.
Nica Gomez
hello, i am new here in freepbx i hope you can help me with my queries.
I placed my freepbx server in the cloud (aws to be particular) and did installed in CentOS 6.5. I used this page as my guide in installation and finished it cleanly. It so happened when I logged to my gui, I received an error 500. and when I do the "amportal a ma install" i received now an error which is
Setting operator panel web root and enabling dev state....<br>Done<br>Setting callevents = yes....<br>Creating client symlink....<br>Done<br>Enabling voicemail box polling<br/>PHP Fatal error: Call to a member function send_request() on a non-object in /var/www/html/admin/libraries/BMO/Codecs.class.php on line 0
I appreciate your big help.
Thanks.
Nica Gomez
Dr Virus
Hello Guys , here is a video on youtube that cover the setup above
i hope it help you .
Nikhil Jain
sh-4.1$ sudo ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
Checking for PEAR DB..FAILED
[FATAL] PEAR must be installed (requires DB.php). Include path: .:/usr/local/php/pear
But when I try to install pera DB It showa following error.
sh-4.1$ sudo pear install DB
No releases available for package "pear.php.net/DB"
install failed
I already have pear installed
sh-4.1$ pear version
PEAR Version: 1.9.4
PHP Version: 5.3.3
Zend Engine Version: 2.3.0
Running on: Linux dktp-lab-29 2.6.32-642.13.1.el6.x86_64 #1 SMP Wed Jan 11 20:56:24 UTC 2017 x86_64
Still It is showing the error
How to resolve this error? I have been trying to solve this since last 2 days. Any help will greatly be appreciated.
rajesh maurya
I am using php 5.6 and centos 6.8
I could not install Digium Add-on Modules
please help about this problem