#UPDATED 11-27-06 #www.prestonmoore.com # #How to Install Asterisk and FreePBX on CentOS 4 #========================================== #KISS(Keep It Simple Stupid) #CentOS 4 installation: #You will need the Centos 4 "Server Edition" #I used graphical install mode #Disable the SELINUX and Firewall #Install the "minimal" package (it's at the bottom of the package selection) # #This guide is now executable!!!! # #run "yum update" and then reboot prior to executing this script! #execute this script by entering "sh guide.txt" at the linux prompt #----------------------------------------------------------------------------------- clear yum -y install gcc libxml2-devel libtiff-devel mysql-server php-gd php-mbstring php-mysql kernel-devel bison ncurses-devel audiofile-devel libogg-devel openssl-devel httpd rpm -ivh http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/lame-3.96.1-2.2.el4.rf.i386.rpm #------------------------------------------------------------------------------------ cd /usr/src wget http://easynews.dl.sourceforge.net/sourceforge/amportal/freepbx-2.1.3.tgz tar xfvz freepbx-2.1.3.tgz mv freepbx-2.1.3 freepbx #-------------------------------------------------------------------------------------- wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.14.tar.gz tar -zxvf asterisk-1.2.14.tar.gz mv asterisk-1.2.14 asterisk wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.12.tar.gz tar -zxvf zaptel-1.2.12.tar.gz mv zaptel-1.2.12 zaptel wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.4.tar.gz tar -zxvf libpri-1.2.4.tar.gz mv libpri-1.2.4 libpri wget http://ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.2.5.tar.gz tar -zxvf asterisk-addons-1.2.5.tar.gz mv asterisk-addons-1.2.5 asterisk-addons wget http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz tar -zxvf asterisk-sounds-1.2.1.tar.gz mv asterisk-sounds-1.2.1 asterisk-sounds #------------------------------------------------------------------------------------------- cd /usr/src/zaptel mv ztdummy.c ztdummy.c.orig sed "s/if 0/if 1/" < ztdummy.c.orig > ztdummy.c cd /usr/src/kernels/`uname -r`-`uname -m`/include/linux/ mv spinlock.h spinlock.h.orig sed "s/rw_lock_t/rwlock_t/" < spinlock.h.orig > spinlock.h cd /usr/src/zaptel make linux26 make install make config cd /etc/sysconfig mv -vf zaptel zaptel.old touch zaptel echo "TELEPHONY=yes" >> /etc/sysconfig/zaptel echo "#DEBUG=yes" >> /etc/sysconfig/zaptel echo 'MODULES="$MODULES ztdummy"' >> /etc/sysconfig/zaptel modprobe zaptel modprobe ztdummy echo "modprobe ztdummy" >> /etc/rc.d/rc.local #----------------------------------------------------------------------------------------------- cd /usr/src/libpri make install #----------------------------------------------------------------------------------------------- cd /usr/src/asterisk mkdir /var/run/asterisk make install make config #------------------------------------------------------------------------------------------------- useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk chown asterisk /var/lib/php/session/ sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf #--------------------------------------------------------------------------------------------------- /etc/init.d/mysqld start cd /usr/src/freepbx mysqladmin create asterisk mysqladmin create asteriskcdrdb mysql asterisk < SQL/newinstall.sql mysql asteriskcdrdb < SQL/cdr_mysql_table.sql mysql -vv -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109'" mysql -vv -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109'" mysql -vv -e "flush privileges" mysqladmin -u root password 'passw0rd' #-------------------------------------------------------------------------------------------------------- cd /usr/src/asterisk-addons cp Makefile Makefile.orig sed -i 's/SOURCE/SOURCE -DMYSQL_LOGUNIQUEID/' Makefile make && make install #--------------------------------------------------------------------------------------------------------- cd /usr/src/asterisk-sounds make install #---------------------------------------------------------------------------------------------------------- clear ifconfig eth0 cd /usr/src/freepbx ./install_amp mkdir /var/lib/asterisk/sounds/custom chmod 775 /var/lib/asterisk/sounds/custom echo /usr/sbin/amportal start >> /etc/rc.local chkconfig httpd on chkconfig mysqld on cd /etc/asterisk touch zapata.conf echo "[channels] " >> /etc/asterisk/zapata.conf echo "language=en " >> /etc/asterisk/zapata.conf echo "#include zapata_additional.conf " >> /etc/asterisk/zapata.conf chkconfig asterisk off chkconfig ntpd on #------------------------------------------------------------------------------------------------------------ cd /var/www/html/admin/modules/ wget http://www.voipeye.com.au/invoke/maint-modules.zip unzip maint-modules.zip rm -vf maint-modules.zip cd /var/www/html/admin/modules/sysstatus sed -i "s|#!/usr/bin/perl|#!/usr/bin/perl -w|" status.pl chmod -v 775 status.pl cd /var/www/html/admin/modules/sysinfo/includes/os sed -i "s|$bufr = rfts( '/proc/scsi/scsi' );|$bufr = rfts( '/proc/scsi/scsi', 0, 4096, false );|" class.Linux.inc.php #------------------------------------------------------------------------------------------------------------ echo "Congradulations!!!...you can reboot the system now."