ผู้เขียน หัวข้อ: http://www.clarkconnect.com/  (อ่าน 7402 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

doramon

  • บุคคลทั่วไป
http://www.clarkconnect.com/
« เมื่อ: พฤษภาคม 25, 2008, 17:04:51 PM »
0

doramon

  • บุคคลทั่วไป
Re: http://www.clarkconnect.com/
« ตอบกลับ #1 เมื่อ: พฤษภาคม 25, 2008, 17:10:23 PM »
0

doramon

  • บุคคลทั่วไป
Re: http://www.clarkconnect.com/
« ตอบกลับ #2 เมื่อ: พฤษภาคม 25, 2008, 17:13:08 PM »
0
http://www.prestonmoore.com/images/cc-freepbx

#  LAST UPDATE: 12-16-2006
#  ClarkConnect 3.2
#  For help refer to forum at: http://www.prestonmoore.com/forum/
#---------------------------------------------------------------
echo
echo "**** INSTALLING UPDATES AND UPGRADES ****"
echo
cd /etc/apt
sed -i 's/Allow-Duplicated { "^kernel-sourcecode"; "^drbd-kernel"; "^kernel$"; "^kernel-devel$"; "^kernel-smp$"; "^gpg-pubkey$"; };/Allow-Duplicated { "^kernel-sourcecode"; "^drbd-kernel"; "^kernel$"; "^kernel-devel$"; "^kernel-smp$"; "^kernel-smp-devel$"; "^gpg-pubkey$"; };/' apt.conf
apt-get update
apt-get -y upgrade
apt-get -y dist-upgrade
apt-get -y install cc-devel
apt-get -y install mysql-devel
apt-get -y install kernel-devel=2.6.9-27.cc
apt-get -y install kernel-smp-devel=2.6.9-27.cc
apt-get -y install php-mbstring lm_sensors cc-squirrelmail nmap
rpm -ivh http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/lame-3.96.1-2.2.el4.rf.i386.rpm
#----------------------------------------------------------------
echo
echo "**** GETTING ASTERISK PACKAGES ****"
echo
cd /usr/src
wget http://easynews.dl.sourceforge.net/sourceforge/amportal/freepbx-2.1.3.tgz
tar xfz freepbx-2.1.3.tgz
mv -vf freepbx-2.1.3 freepbx
rm -vf freepbx-2.1.3.tgz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.14.tar.gz
tar -zxvf asterisk-1.2.14.tar.gz
rm -vf asterisk-1.2.14.tar.gz
mv -vf 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
rm -vf zaptel-1.2.12.tar.gz
mv -vf 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
rm -vf libpri-1.2.4.tar.gz
mv -vf 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
rm -vf asterisk-addons-1.2.5.tar.gz
mv -vf 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
rm -vf asterisk-sounds-1.2.1.tar.gz
mv -vf asterisk-sounds-1.2.1 asterisk-sounds
#------------------------------------------------------------
echo
echo "**** INSTALLING ZAPTEL USING ZTDUMMY MODULE ****"
echo
cd /usr/src/zaptel
mv -vf ztdummy.c ztdummy.c.orig
sed "s/if 0/if 1/" < ztdummy.c.orig > ztdummy.c
cd /usr/src/kernels/2.6.9-27.cc-i686/include/linux/
mv -vf 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
echo "STARTING ZAPTEL"
/etc/init.d/zaptel start
#------------------------------------------------------------

useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
chown asterisk /var/lib/php/session/
cp -v /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.original
sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf
sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf
#-------------------------------------------------------------
echo
echo "**** INSTALLING LIBRI ****"
echo
cd /usr/src/libpri
make install
#--------------------------------------------------------------
echo
echo "**** INSTALLING ASTERISK ****"
echo
cd /usr/src/asterisk
mkdir /var/run/asterisk
make install
make config
#-------------------------------------------------------------
echo
echo "STARTING MYSQL DATABASE"
/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"
#-------------------------------------------------------------
echo
echo "**** INSTALLING ASTERISK-ADDONS ****"
echo
cd /usr/src/asterisk-addons
cp Makefile Makefile.orig
sed -i 's/SOURCE/SOURCE -DMYSQL_LOGUNIQUEID/' Makefile
make && make install
#--------------------------------------------------------------
echo
echo "**** INSTALLING ASTERISK-SOUNDS ****"
echo
cd /usr/src/asterisk-sounds
make install
#-------------------------------------------------------------
echo
echo "**** INSTALLING FREEPBX INTERFACE ****"
echo
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
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
cd /var/www/html/admin/images/
wget http://www.clarkconnect.com/images/logos/poweredbycc.png
sed -i "s|AMPFOOTERLOGO=blank.gif|AMPFOOTERLOGO=poweredbycc.png|" /etc/amportal.conf
sed -i "s|AMPADMINHREF=www.freepbx.org|AMPADMINHREF=www.clarkconnect.com|" /etc/amportal.conf
#---------------------------------------------------------------
echo
echo "**** INSTALLING ADDITIONAL ADMIN MODULES ****"
echo
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
#---------------------------------------------------------------
#echo
#echo "**** INSTALLING ADDITIONAL MUSIC-ON-HOLD MP3 FILES ****"
#echo
#cd /var/lib/asterisk/mohmp3
#wget http://www2.signate.com/free-moh/mp3/signate-moh-mp3.tar.gz
#tar -xzvf signate-moh-mp3.tar.gz
#rm -vf signate-moh-mp3.tar.gz
#---------------------------------------------------------------

chown -v asterisk:asterisk /var/lib/squirrelmail/prefs/
chown -v asterisk:asterisk /var/lib/squirrelmail/prefs/default_pref
cd /etc/asterisk
mv extensions_custom.conf.sample extensions_custom.conf
touch sip_nat.conf
echo "#NOTE: I have been unable to get my xxxxx.pointclark.net address to work.  I use the free dyndns.org account" >> /etc/asterisk/sip_nat.conf
echo "#nat=yes" >> /etc/asterisk/sip_nat.conf
echo "#localnet=192.168.1.0/255.255.255.0" >> /etc/asterisk/sip_nat.conf
echo "#externip=yourdomain.com" >> /etc/asterisk/sip_nat.conf
#---------------------------------------------------------------
echo
echo "**** INSTALLING PHPSYSINFO ****"
echo
cd /tmp
wget http://easynews.dl.sourceforge.net/sourceforge/phpsysinfo/phpsysinfo-2.5.2-rc3.tar.gz
tar -xzvf phpsysinfo-2.5.2-rc3.tar.gz
rm -vf phpsysinfo-2.5.2-rc3.tar.gz
mv -vf phpsysinfo /var/www/html
cd /var/www/html/phpsysinfo
cp -v config.php.new config.php
cp -v includes/xml/hardware.php includes/xml/hardware.php.original
chown -vR asterisk:asterisk /var/www/html/phpsysinfo
sed -i "s|CPU/CpuTemp|CPU/Cputemp|" includes/xml/hardware.php
#-----------------------------------------------------------------

cd /tmp
wget http://digium-cvs.netmonks.ca/viewcvs.cgi/phpconfig.tar.gz
tar -xzvf phpconfig.tar.gz
mv -vf phpconfig /var/www/html
rm -vf phpconfig.tar.gz
cd /var/www/html/phpconfig
chmod -v 755 asterisk.reload
cp -v cls_phpconfig.php cls_phpconfig.php.original
cp -v phpconfig_init.php phpconfig_init.php.original
cp -v asterisk.reload asterisk.reload.original
chown -vR asterisk:asterisk /var/www/html/phpconfig
sed -i "s/fgetc/fgets/" cls_phpconfig.php
sed -i "s|/bin/asterisk.reload|./asterisk.reload|" cls_phpconfig.php
sed -i "s|asterisk.reload|./asterisk.reload|" phpconfig_init.php
sed -i "s/Secret: secret/Secret: amp111/" asterisk.reload
sed -i "s|DirectoryIndex index.html index.html.var|DirectoryIndex index.html index.html.var phpconfig.php|" /etc/httpd/conf/httpd.conf
#--------------------------------------------------------------------
echo
echo "**** INSTALLING ASTERISK LOGROTATE FILE ****"
echo
cd /etc/logrotate.d
wget http://www.prestonmoore.com/images/asterisk
#-----------------------------------------------------------------
echo
echo "**** PATCHING CONFIGEDIT AND SYSSTATUS MODULES ****"
echo
cd /var/www/html/admin/modules/configedit
wget http://www.prestonmoore.com/images/asterisk.reload
chmod -v 755 asterisk.reload
cp -v cls_phpconfig.php cls_phpconfig.php.original
cp -v phpconfig_init.php phpconfig_init.php.original
chown -vR asterisk:asterisk /var/www/html/admin/modules/configedit
sed -i "s/fgetc/fgets/" cls_phpconfig.php
sed -i "s|/bin/asterisk.reload|./asterisk.reload|" cls_phpconfig.php
sed -i "s|/bin/asterisk.reload|./asterisk.reload|" phpconfig_init.php
#------------------------------------------------------------------
#   fix for sysstatus module
#
cd /var/www/html/admin/modules/sysstatus
sed -i "s|#!/usr/bin/perl|#!/usr/bin/perl -w|" status.pl
chmod -v 775 status.pl
#
#    fix for sysinfo SCSI error message (comment out if using SCSI hardware)
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

cd /root
wget http://humdi.net/vnstat/vnstat-1.4.tar.gz
tar -xvzf vnstat-1.4.tar.gz
cd vnstat-1.4
make && make install
vnstat -u -i eth0
vnstat -u -i eth1
echo "0-55/5 * * * * vnstat -u" >> /etc/crontab
rm -rf vnstat*
cd /var/www/html/
wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.2.1.tar.gz
tar -xvzf vnstat_php_frontend-1.2.1.tar.gz
mv vnstat_php_frontend-1.2.1 net-stats
rm -rf vnstat_php_frontend-1.2.1.tar.gz
cd net-stats
mv config.php config.php.old
wget http://www.prestonmoore.com/images/config
mv config config.php

#   password protect the sysinfo, phpconfig, and the FOP
echo "<Directory /var/www/html/panel/>" >> /etc/httpd/conf/httpd.conf
echo "AuthType Basic" >> /etc/httpd/conf/httpd.conf
echo 'AuthName "Private Access"' >> /etc/httpd/conf/httpd.conf
echo "AuthUserFile /usr/local/passwd" >> /etc/httpd/conf/httpd.conf
echo "Require user admin" >> /etc/httpd/conf/httpd.conf
echo "</Directory>" >> /etc/httpd/conf/httpd.conf
echo "<Directory /var/www/html/phpconfig/>" >> /etc/httpd/conf/httpd.conf
echo "AuthType Basic" >> /etc/httpd/conf/httpd.conf
echo 'AuthName "Private Access"' >> /etc/httpd/conf/httpd.conf
echo "AuthUserFile /usr/local/passwd" >> /etc/httpd/conf/httpd.conf
echo "Require user admin" >> /etc/httpd/conf/httpd.conf
echo "</Directory>" >> /etc/httpd/conf/httpd.conf
echo "<Directory /var/www/html/phpsysinfo/>" >> /etc/httpd/conf/httpd.conf
echo "AuthType Basic" >> /etc/httpd/conf/httpd.conf
echo 'AuthName "Private Access"' >> /etc/httpd/conf/httpd.conf
echo "AuthUserFile /usr/local/passwd" >> /etc/httpd/conf/httpd.conf
echo "Require user admin" >> /etc/httpd/conf/httpd.conf
echo "</Directory>" >> /etc/httpd/conf/httpd.conf
echo "<Directory /var/www/html/net-stats/>" >> /etc/httpd/conf/httpd.conf
echo "AuthType Basic" >> /etc/httpd/conf/httpd.conf
echo 'AuthName "Private Access"' >> /etc/httpd/conf/httpd.conf
echo "AuthUserFile /usr/local/passwd" >> /etc/httpd/conf/httpd.conf
echo "Require user admin" >> /etc/httpd/conf/httpd.conf
echo "</Directory>" >> /etc/httpd/conf/httpd.conf
echo "Enter a password you will use to access the Flash Panel, Sysinfo and phpconfig"
echo "the user name will be: admin"
htpasswd -c /usr/local/passwd admin
cd /var/www/html/
mv index.html index.html.old
wget http://www.prestonmoore.com/images/index.html
#apt-get -y install php-devel
#cd /tmp/
#wget http://bart.eaccelerator.net/source/0.9.5/eaccelerator-0.9.5.zip
#unzip eaccelerator-0.9.5.zip
#rm -f eaccelerator-0.9.5.zip
#cd eaccelerator-0.9.5
#phpize
#./configure
#make && make install
#cd /etc/php.d/
#wget http://www.prestonmoore.com/images/eaccelerator.ini
#mkdir /var/cache/eaccelerator
#chmod 0777 /var/cache/eaccelerator
chkconfig httpd on
chkconfig mysqld on
chkconfig postfix on
chkconfig asterisk off
chkconfig ntpd on

echo "--------------I N S T A L L A T I O N   C O M P L E T E---------------"
shutdown -r now