Difference between revisions of "Installing FusionPBX 3.2 on CentOS 6.5 and Mysql"

From FusionPBX
Jump to: navigation, search
(Install Basic CentOS Server Installation)
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  
 +
[[User:Scristopher]]
  
 +
==Install Basic CentOS Server Installation==
 +
**Dev SVN Branch can also be installed this way, the only difference is fusionpbx**
  
Install Basic CentOS Server Installation
+
Hi there, it seems this guide was hastily thrown together before I happened to stumble upon it with alot of things that might have either hosed your system or made it difficult to use. I'm currently reworking this page to make it a '''proper''' installation guide. Any questions feel free to put in the talk page. Alot of the packages listed for installation here may or may not be needed, the list was here before I got here, but its alot better than when I first stumbled upon it. Previously if you tried the old guide it would hose your apache install (I mean majorly, apache would literally stackdump), and majorly screw up other system utilities. This just needs to be a simple and plain freeswitch + fusionpbx installation, nothing more, nothing less.
  
you can download centOS 6.4 from  
+
you can download centOS 6.5 from  
  
http://mirror.sunnyvision.com/centos/6.4/isos/i386/CentOS-6.4-i386-minimal.iso
+
  
 +
<strike>http://mirror.sunnyvision.com/centos/6.4/isos/i386/CentOS-6.4-i386-minimal.iso</strike> dead link <br />
 +
Use the latest 6.5 Installation, its up to you how you would like to install, best bet is netinstall using the basic server as the base once you get to the package selection: '''!!Never download ISOs from unknown sources!!'''
 +
''(centos 7 will be supported soon!)''
 +
 +
64 bit isos:
 +
http://isoredirect.centos.org/centos/6.5/isos/x86_64/
 +
 +
32 bit isos:
 +
http://isoredirect.centos.org/centos/6.5/isos/i386/
  
 
Then Do update to up to date
 
Then Do update to up to date
  
yum update -y
+
yum update -y
  
  
 
Disabling SELINUX
 
Disabling SELINUX
  
/bin/sed -i -e s,'SELINUX=enforcing','SELINUX=disabled', /etc/selinux/config
+
/bin/sed -i -e s,'SELINUX=enforcing','SELINUX=disabled', /etc/selinux/config
 +
 
 +
Reboot so selinux is off.
 +
 
 +
Install Epel:
 +
su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'
  
 +
Install a bunch of needed packages:
  
yum -y install autoconf automake gcc-c++ git-core libjpeg-devel libtool make ncurses-devel pkgconfig libedit-devel  unixODBC-devel openssl-devel gnutls-devel libogg-devel libvorbis-devel curl-devel libtiff-devel libjpeg-devel python-devel expat-devel zlib zlib-devel bzip2 which  subversion screen vim php* ntp libX11-devel libzrtpcpp-devel alsa-lib-devel libdb-devel uuid-devel @development-tools gdbm-devel db4-devel libjpeg libjpeg-devel libtermcap libtermcap-devel ncurses ntp screen sendmail sendmail-cf bison gettext-devel httpd-devel apr-devel apr-util-devel cyrus-sasl-devel gettext-libs openldap-devel  
+
yum -y install autoconf automake gcc-c++ git-core libjpeg-devel libtool make ncurses-devel pkgconfig \
 +
libedit-devel  unixODBC-devel openssl-devel gnutls-devel libogg-devel libvorbis-devel curl-devel libtiff-devel \
 +
libjpeg-devel python-devel expat-devel zlib zlib-devel bzip2 which  subversion screen vim php php-mysql ntp libX11-devel \
 +
libzrtpcpp-devel alsa-lib-devel libdb-devel uuid-devel @development-tools gdbm-devel db4-devel libjpeg libjpeg-devel \
 +
libtermcap libtermcap-devel ncurses ntp screen sendmail sendmail-cf bison gettext-devel httpd-devel apr-devel apr-util-devel \
 +
cyrus-sasl-devel gettext-libs openldap-devel ldns ldns-devel
  
 
Installing Apache webserver
 
Installing Apache webserver
  
yum install http*
+
yum install httpd httpd-devel
  
 
Install MySQL.
 
Install MySQL.
  
yum install mysql*
+
yum install mysql mysql-server mysql-server-devel mysql-devel
 +
 
 +
Configuring autostart
  
Changing mysql root password
+
chkconfig mysqld on
  
/usr/bin/mysqladmin -u root password "yourpassword"
+
Starting mysql
  
 +
service mysqld start
  
Install Freeswitch
+
Changing mysql root password
  
cd /usr/src
+
/usr/bin/mysqladmin -u root password "yourpassword"
  
git clone git://git.freeswitch.org/freeswitch.git
 
  
cd freeswitch
+
Install Freeswitch
 +
Note: this is now obsoleted, please use: https://confluence.freeswitch.org/display/FREESWITCH/CentOS+6 instead.
  
./bootstrap.sh  
+
cd /usr/src
 +
git clone git://git.freeswitch.org/freeswitch.git
 +
cd freeswitch
 +
./bootstrap.sh  
  
  
Line 50: Line 79:
 
Remove the # in front of the lines with these modules:
 
Remove the # in front of the lines with these modules:
  
mod_rtmp
+
mod_rtmp
mod_directory
+
mod_directory
mod_callcenter
+
mod_callcenter
mod_tts_commandline
+
mod_tts_commandline
mod_dingaling
+
mod_dingaling
mod_flite
+
mod_flite
mod_shout
+
mod_shout
mod_pocketsphinx
+
mod_pocketsphinx
mod_cidlookup
+
mod_cidlookup
 +
 
  
 +
Installing Freeswitch
  
 +
configure --enable-core-odbc-support && make && make install
 +
make cd-moh-install && make cd-sounds-install
  
./configure
+
If you get an error, it will likely be module related, see what module it errored on in the output and comment that module out - or try to fix it.
make
 
make install
 
make cd-moh-install && make cd-sounds-install
 
  
 
Add a user for freeswitch
 
Add a user for freeswitch
  
useradd freeswitch
+
useradd freeswitch
  
  
 
set ownership, perms, and install init scripts
 
set ownership, perms, and install init scripts
  
cd /usr/local/
+
cd /usr/local/
 
+
chown -R freeswitch:freeswitch freeswitch
chown -R freeswitch:freeswitch freeswitch
+
chmod -R g+w freeswitch
 
+
cd /usr/src/freeswitch/build
chmod -R g+w freeswitch
+
cp freeswitch.init.redhat /etc/init.d/freeswitch
 
+
chmod +x /etc/init.d/freeswitch
cd /usr/src/freeswitch/build
+
cp freeswitch.sysconfig /etc/sysconfig/freeswitch
 
 
cp freeswitch.init.redhat /etc/init.d/freeswitch
 
 
 
chmod +x /etc/init.d/freeswitch
 
 
 
cp freeswitch.sysconfig /etc/sysconfig/freeswitch
 
  
  
 
Add Settings to freeswitch sysconfig  
 
Add Settings to freeswitch sysconfig  
  
cat >> /etc/sysconfig/freeswitch <<EOT
+
cat >> /etc/sysconfig/freeswitch <<EOT
 
+
PID_FILE=/var/run/freeswitch/freeswitch.pid
PID_FILE=/var/run/freeswitch/freeswitch.pid
+
FS_USER=freeswitch
 
+
FS_FILE=/usr/local/freeswitch/bin/freeswitch
FS_USER=freeswitch
+
FS_HOME=/usr/local/freeswitch
 
+
EOT
FS_FILE=/usr/local/freeswitch/bin/freeswitch
 
 
 
FS_HOME=/usr/local/freeswitch
 
 
 
EOT
 
  
  
 
Change permission Add Freeswitch Service to start at boot time
 
Change permission Add Freeswitch Service to start at boot time
  
chmod 765 /etc/init.d/freeswitch
+
chmod 765 /etc/init.d/freeswitch
 
+
/sbin/chkconfig freeswitch on
/sbin/chkconfig --add freeswitch
+
/sbin/chkconfig --list freeswitch
 
 
/sbin/chkconfig --level 5 freeswitch on
 
 
 
/sbin/chkconfig --list freeswitch
 
  
 
Move Default Freeswitch config files to noload
 
Move Default Freeswitch config files to noload
  
cd /usr/local/freeswitch/conf/dialplan/default
+
cd /usr/local/freeswitch/conf/dialplan/default
 +
mv 00_ladspa.xml 00_ladspa.noload
 +
mv 00_pizza_demo.xml 00_pizza_demo.noload
 +
mv 01_Talking_Clock.xml 01_Talking_Clock.noload
  
mv 00_ladspa.xml 00_ladspa.noload
 
  
mv 00_pizza_demo.xml 00_pizza_demo.noload
+
Linking fs_cli
  
mv 01_Talking_Clock.xml 01_Talking_Clock.noload
+
cd /usr/local/bin/
 +
ln -s /usr/local/freeswitch/bin/fs_cli fs_cli
  
cd /usr/local/bin/
 
 
ln -s /usr/local/freeswitch/bin/fs_cli fs_cli
 
  
 +
installing Fusion
  
installing Fusion
+
cd /var/www/html
 +
mkdir fusionpbx
 +
svn co http://fusionpbx.googlecode.com/svn/trunk/fusionpbx fusionpbx
  
cd /var/www/html
 
mkdir fusionpbx
 
svn co http://fusionpbx.googlecode.com/svn/trunk/fusionpbx fusionpbx
 
  
 
Fix FusionPBX Ownership and Perms
 
Fix FusionPBX Ownership and Perms
  
cd /var/www/html
+
cd /var/www/html
chown -R apache:apache fusionpbx
+
chown -R apache:apache fusionpbx
  
cd /usr/local/freeswitch/conf/
+
cd /usr/local/freeswitch/conf/
chmod 770 `find . -type d`
+
chmod 770 `find . -type d`
chmod 660 `find . -type f`
+
chmod 660 `find . -type f`
  
 
Add apache to the freeswitch Group
 
Add apache to the freeswitch Group
  
usermod -a -G freeswitch apache
+
usermod -a -G freeswitch apache
 
 
  
start up some services and set them to run at boot
+
Add database and odbc configuration:
 +
<pre>
 +
mysql> create database freeswitch
 +
mysql> grant all privileges on freeswitch.* to 'admin'@'localhost' identified by 'YOUR-DATABASE-PASSWORD';
 +
mysql> exit
 +
</pre>
  
service freeswitch start
+
edit /etc/odbc.ini:
 +
<pre>
 +
[freeswitch]
 +
Driver  = MySQL
 +
SERVER  = localhost
 +
PORT    = 3306
 +
DATABASE = freeswitch
 +
OPTION  = 67108864
 +
Socket  = /var/lib/mysql/mysql.sock
 +
</pre>
  
service httpd restart
+
Test your database connection:
 +
<pre>
 +
[root@testfusion]# isql freeswitch  admin YOUR-DATABASE-PASSWORD
 +
+---------------------------------------+
 +
| Connected!                            |
 +
|                                      |
 +
| sql-statement                        |
 +
| help [tablename]                      |
 +
| quit                                  |
 +
|                                      |
 +
+---------------------------------------+
 +
SQL> quit
 +
</pre>
  
chkconfig freeswitch on
+
start up some services and set them to run at boot
 
 
chkconfig httpd on
 
 
 
service monit start
 
  
chkconfig monit on
+
service freeswitch start
 +
service httpd restart
 +
chkconfig freeswitch on
 +
chkconfig httpd on
 +
service monit start
 +
chkconfig monit on
  
  
Line 167: Line 208:
 
Installing FusionPBX from GUI
 
Installing FusionPBX from GUI
  
http://youraddress/
+
http://youraddress/fusionpbx

Latest revision as of 01:35, 10 September 2014

User:Scristopher

Install Basic CentOS Server Installation

    • Dev SVN Branch can also be installed this way, the only difference is fusionpbx**

Hi there, it seems this guide was hastily thrown together before I happened to stumble upon it with alot of things that might have either hosed your system or made it difficult to use. I'm currently reworking this page to make it a proper installation guide. Any questions feel free to put in the talk page. Alot of the packages listed for installation here may or may not be needed, the list was here before I got here, but its alot better than when I first stumbled upon it. Previously if you tried the old guide it would hose your apache install (I mean majorly, apache would literally stackdump), and majorly screw up other system utilities. This just needs to be a simple and plain freeswitch + fusionpbx installation, nothing more, nothing less.

you can download centOS 6.5 from


http://mirror.sunnyvision.com/centos/6.4/isos/i386/CentOS-6.4-i386-minimal.iso dead link
Use the latest 6.5 Installation, its up to you how you would like to install, best bet is netinstall using the basic server as the base once you get to the package selection: !!Never download ISOs from unknown sources!! (centos 7 will be supported soon!)

64 bit isos:

http://isoredirect.centos.org/centos/6.5/isos/x86_64/

32 bit isos:

http://isoredirect.centos.org/centos/6.5/isos/i386/

Then Do update to up to date

yum update -y


Disabling SELINUX

/bin/sed -i -e s,'SELINUX=enforcing','SELINUX=disabled', /etc/selinux/config

Reboot so selinux is off.

Install Epel:

su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'

Install a bunch of needed packages:

yum -y install autoconf automake gcc-c++ git-core libjpeg-devel libtool make ncurses-devel pkgconfig \
libedit-devel  unixODBC-devel openssl-devel gnutls-devel libogg-devel libvorbis-devel curl-devel libtiff-devel \
libjpeg-devel python-devel expat-devel zlib zlib-devel bzip2 which  subversion screen vim php php-mysql ntp libX11-devel \
libzrtpcpp-devel alsa-lib-devel libdb-devel uuid-devel @development-tools gdbm-devel db4-devel libjpeg libjpeg-devel \
libtermcap libtermcap-devel ncurses ntp screen sendmail sendmail-cf bison gettext-devel httpd-devel apr-devel apr-util-devel \
cyrus-sasl-devel gettext-libs openldap-devel ldns ldns-devel

Installing Apache webserver

yum install httpd httpd-devel

Install MySQL.

yum install mysql mysql-server mysql-server-devel mysql-devel

Configuring autostart

chkconfig mysqld on

Starting mysql

service mysqld start

Changing mysql root password

/usr/bin/mysqladmin -u root password "yourpassword" 


Install Freeswitch Note: this is now obsoleted, please use: https://confluence.freeswitch.org/display/FREESWITCH/CentOS+6 instead.

cd /usr/src
git clone git://git.freeswitch.org/freeswitch.git
cd 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_rtmp
mod_directory
mod_callcenter
mod_tts_commandline
mod_dingaling
mod_flite
mod_shout
mod_pocketsphinx
mod_cidlookup


Installing Freeswitch

configure --enable-core-odbc-support && make && make install
make cd-moh-install && make cd-sounds-install

If you get an error, it will likely be module related, see what module it errored on in the output and comment that module out - or try to fix it.

Add a user for freeswitch

useradd freeswitch


set ownership, perms, and install init scripts

cd /usr/local/
chown -R freeswitch:freeswitch freeswitch
chmod -R g+w freeswitch
cd /usr/src/freeswitch/build
cp freeswitch.init.redhat /etc/init.d/freeswitch
chmod +x /etc/init.d/freeswitch
cp freeswitch.sysconfig /etc/sysconfig/freeswitch


Add Settings to freeswitch sysconfig

cat >> /etc/sysconfig/freeswitch <<EOT
PID_FILE=/var/run/freeswitch/freeswitch.pid
FS_USER=freeswitch
FS_FILE=/usr/local/freeswitch/bin/freeswitch
FS_HOME=/usr/local/freeswitch
EOT


Change permission Add Freeswitch Service to start at boot time

chmod 765 /etc/init.d/freeswitch
/sbin/chkconfig freeswitch on
/sbin/chkconfig --list freeswitch

Move Default Freeswitch config files to noload

cd /usr/local/freeswitch/conf/dialplan/default
mv 00_ladspa.xml 00_ladspa.noload
mv 00_pizza_demo.xml 00_pizza_demo.noload
mv 01_Talking_Clock.xml 01_Talking_Clock.noload


Linking fs_cli

cd /usr/local/bin/
ln -s /usr/local/freeswitch/bin/fs_cli fs_cli


installing Fusion

cd /var/www/html
mkdir fusionpbx
svn co http://fusionpbx.googlecode.com/svn/trunk/fusionpbx fusionpbx


Fix FusionPBX Ownership and Perms

cd /var/www/html
chown -R apache:apache fusionpbx
cd /usr/local/freeswitch/conf/
chmod 770 `find . -type d`
chmod 660 `find . -type f`

Add apache to the freeswitch Group

usermod -a -G freeswitch apache

Add database and odbc configuration:

mysql> create database freeswitch
mysql> grant all privileges on freeswitch.* to 'admin'@'localhost' identified by 'YOUR-DATABASE-PASSWORD';
mysql> exit

edit /etc/odbc.ini:

[freeswitch]
Driver   = MySQL
SERVER   = localhost
PORT     = 3306
DATABASE = freeswitch
OPTION  = 67108864
Socket   = /var/lib/mysql/mysql.sock

Test your database connection:

[root@testfusion]# isql freeswitch  admin YOUR-DATABASE-PASSWORD
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> quit

start up some services and set them to run at boot

service freeswitch start
service httpd restart
chkconfig freeswitch on
chkconfig httpd on
service monit start
chkconfig monit on


Installing FusionPBX from GUI

http://youraddress/fusionpbx