CentOS Install

From FusionPBX
Revision as of 18:03, 8 June 2011 by Admin (talk | contribs)
Jump to: navigation, search

GIT Install

cd /usr/local/src
yum -y install gcc gcc-c++ make gettext-devel expat-devel curl-devel zlib-devel openssl-devel bzip2
wget http://kernel.org/pub/software/scm/git/git-1.7.4.tar.bz2
tar -xvjf git-1.7.4.tar.bz2
cd git-1.7.4
make prefix=/usr/local all
make prefix=/usr/local install

Dependencies Install

Install the following dependencies

yum install subversion autoconf automake libtool gcc-c++ git-core ncurses-devel make expat-devel zlib zlib-devel
yum install nano unixODBC-devel openssl-devel gnutls-devel libogg-devel libvorbis-devel curl-devel libtiff-devel libjpeg-devel python-devel expat-devel zlib zlib-devel bzip2

FreeSWITCH Install

Then use the following

cd /usr/src/
git clone git://git.freeswitch.org/freeswitch.git
cd /usr/src/freeswitch
./bootstrap.sh

Edit modules.conf to enable or disable desired modules. To enable a few extra features you may want to go ahead and edit modules.conf. Remove the # in front of the lines with these modules:

mod_spandsp
mod_shout
mod_flite
mod_pocketshpinx

Complete the FreeSWITCH compile.

./configure
make install
make cd-sounds-install
make cd-moh-install
make hd-moh-install
make hd-sounds-install
+---------- FreeSWITCH install Complete ----------+
+ FreeSWITCH has been successfully installed.     +
+                                                 +
+       Install sounds:                           +
+       (uhd-sounds includes hd-sounds, sounds)   +
+       (hd-sounds includes sounds)               +
+       ------------------------------------      +
+                make cd-sounds-install           +
+                make cd-moh-install              +
+                                                 +
+                make uhd-sounds-install          +
+                make uhd-moh-install             +
+                                                 +
+                make hd-sounds-install           +
+                make hd-moh-install              +
+                                                 +
+                make sounds-install              +
+                make moh-install                 +
+                                                 +
+       Install non english sounds:               +
+       replace XX with language                  +
+       (ru : Russian)                            +
+       ------------------------------------      +
+                make cd-sounds-XX-install        +
+                make uhd-sounds-XX-install       +
+                make hd-sounds-XX-install        +
+                make sounds-XX-install           +
+                                                 +
+       Upgrade to latest:                        +
+       ----------------------------------        +
+                make current                     +
+                                                 +
+       Rebuild all:                              +
+       ----------------------------------        +
+                make sure                        +
+                                                 +
+       Install/Re-install default config:        +
+       ----------------------------------        +
+                make samples                     +
+                                                 +
+                                                 +
+       Additional resources:                     +
+       ----------------------------------        +
+       http://www.freeswitch.org               +
+       http://wiki.freeswitch.org              +
+       http://jira.freeswitch.org              +
+       http://lists.freeswitch.org             +
+                                                 +
+       irc.freenode.net / #freeswitch            +
+                                                 +
+-------------------------------------------------+


In the future to upgrade use the following:

cd /usr/src/freeswitch
make current

After this you have the latest FreeSWITCH ready for use with FusionPBX

FreeSWITCH Auto Start

Copy the sample-init-file to /etc/init.d/

 cp build/freeswitch.init.redhat /etc/init.d/freeswitch

Open /etc/init.d/freeswitch and change the freeswitch-directory from /opt/freeswitch to /usr/local/freeswitch

 nano /etc/init.d/freeswich
  PID_FILE=${PID_FILE-/usr/local/freeswitch/run/freeswitch.pid}
  FS_FILE=${FS_FILE-/usr/local/freeswitch/bin/freeswitch}
  FS_HOME=${FS_HOME-/usr/local/freeswitch}
 


Set the permissions and add it to run on startup

chmod 755 /etc/init.d/freeswitch
chkconfig --add freeswitch
chkconfig --level 5 freeswitch on
chkconfig --list freeswitch

CentoOS 32-bit Install

   * Take a look at, installing FusionPBX on CentOS in 4 Steps. 

CentoOS 64-bit Install

If you don't have 64-bit support, just remove x86_64 from the below packages.

Additional Tools

On CentOS w/ 64-bit support: CentOS does not yet ship a recent enough version of PHP, so we suggest you use the RPMs provided in the REMI repository. To do so:

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm 
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
rpm -Uvh remi-release-5.rpm


yum install zaptel.x86_64 zaptel-lib.x86_64 zaptel-utils.x86_64 libpri.x86_64 spandsp.x86_64

PostgreSQL

rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm  
yum --enablerepo=remi install php php-common php-pgsql php-pdo php-soap php-xml php-xmlrpc
yum --enablerepo=remi upgrade php php-common php-pdo


MySQL

Before installing the remi packages, it is suggested that you install the dependent libraries. The upstream packages does not have the correct version and conflict with each other. To do so:

wget http://downloads.mysql.com/archives/mysql-5.1/MySQL-shared-compat-5.1.30-0.rhel5.x86_64.rpm
rpm -Uvh MySQL-shared-compat-5.1.30-0.rhel5.x86_64.rpm

If you get a conflict, force it.

rpm -Uvh MySQL-shared-compat-5.1.30-0.rhel5.x86_64.rpm --force

Now that you have all the version of mysql client libraries; things just install cleanly.

rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm  yum --enablerepo=remi install php php-common php-mysql php-pdo php-soap php-xml php-xmlrpc 
yum --enablerepo=remi upgrade php php-common php-pdo

Permissions

Set permissions

adduser freeswitch
chown -R freeswitch:freeswitch /usr/local/freeswitch
chown -R apache:apache /var/www/fusionpbx
chmod 766 -R /var/www/fusionpbx

Add the apache user to the freeswitch group

nano /etc/group

Before:

freeswitch:x:500

After:

freeswitch:x:500:freeswitch,apache

Fusionpbx

Dependencies Subversion

yum install subversion

Apache

yum install apache2

PHP >= 5.2.3

yum install php5 php5-pdo php-sqlite php5-pdo_sqlite 

Install the backend of your choice

sqlite

yum install sqlite3 php5-pdo_sqlite

mysql

yum install mysql-server.x86_64  mysql.x86_64 mysql-server-devel.x86_64 php5-pdo_mysql

postgresql

yum install php5-pdo_pgsql postgresql-server.x86_64 postgresql.x86_64

FusionPBX install

Download FusionPBX source and add it to Apache

cd /var/www
sudo svn checkout http://fusionpbx.googlecode.com/svn/trunk/fusionpbx /var/www/fusionpbx

Network Time Protocol

If NTP is not installed then install it.

yum install ntp
chkconfig ntpd on
ntpdate pool.ntp.org
service ntpd start

If NTP is running then do the following:

service ntpd stop
ntpdate pool.ntp.org
service ntpd start

Additional Notes

Optional TDM card instructions. CentOS Install TDM

How to start stop FreeSWITCH

/usr/local/freeswitch/bin/freeswitch -stop
/usr/local/freeswitch/bin/freeswitch -nc 

How to start, stop and restart Apache

service httpd start
service httpd stop
service httpd restart

Change the CentOS root password

su root
passwd