LAMP+MRTG+CACTI+IGENUS
Posted On 2008年11月8日星期六 at 时间: 22:58:00 by David LuATTENTION
# Set up Hostname and DNS server first# Turn off SELINUX by edit /etc/selinux/config
LAMP Installation
#Version and Path of main packagesMYSQL_VER="5.0.45"
APACHE_VER="2.2.6"
PHP_VER="5.2.5"
ZNED_VER="3.3.3-linux-glibc23-i386"
MYSQL_LOCATION="/usr/local/mysql5"
APACHE_LOCATION="/usr/local/apache2"
PHP_LOCATION="/usr/local/php5"
#Remove all existing main softwares
rpm -e `rpm -qa | grep php` --nodeps &> /dev/null
rpm -e `rpm -qa | grep mysql` --nodeps &> /dev/null
rpm -e `rpm -qa | grep httpd` --nodeps &> /dev/null
#Installing dependent development libraries
yum install gcc gcc-c++ openssl openssl-devel libtermcap-devel libxml2-devel gmp-devel gd-devel zlib-devel curl-devel net-snmp-devel libpng-devel libjpeg-devel freetype-devel -y &> /dev/null
#Installing MySQL
tar jxf mysql-$MYSQL_VER.tar.bz2 &> /dev/null
groupadd mysql
useradd -g mysql -c "MySQL Server" mysql
cd mysql-$MYSQL_VER
./configure --prefix=$MYSQL_LOCATION \
--with-charset=gb2312 \
--with-extra-charsets=all \
--enable-assembler \
--enable-thread-safe-client \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--without-debug &> /dev/null
make &> /dev/null && make install &> /dev/null
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chkconfig mysqld on
chown -R mysql.mysql $MYSQL_LOCATION/*
$MYSQL_LOCATION/bin/mysql_install_db --user=mysql &> /dev/null
chown -R root $MYSQL_LOCATION/*
chown -R mysql $MYSQL_LOCATION/var
ln -s $MYSQL_LOCATION/bin/* /usr/bin/
/etc/init.d/mysqld start &> /dev/null && echo "Mysql Success"; cd .. ; rm mysql-$MYSQL_VER -fr || echo "Mysql Failed"
#Installing Httpd
tar jxf httpd-$APACHE_VER.tar.bz2 &> /dev/null
cd httpd-$APACHE_VER
./configure --prefix=$APACHE_LOCATION \
--enable-ssl \
--enable-cgi \
--enable-cgid \
--enable-rewrite \
--enable-speling \
--enable-shared \
--enable-so &> /dev/null
make &> /dev/null && make install &> /dev/null
$APACHE_LOCATION/bin/apachectl start &> /dev/null && echo "apache success"; cd .. ; rm httpd-$APACHE_VER -fr || echo "apache fail"
ln -s $APACHE_LOCATION/bin/apachectl /usr/bin
#Installing libmcrypt
tar zxf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure &>/dev/null && make &>/dev/null && make install &>/dev/null
#Installing PHP
tar jxf php-$PHP_VER.tar.bz2
cd php-$PHP_VER
./configure --prefix=$PHP_LOCATION \
--with-apxs2=$APACHE_LOCATION/bin/apxs \
--with-mysql=$MYSQL_LOCATION \
--with-openssl \
--with-snmp \
--with-gd \
--with-zlib \
--with-curl \
--with-libxml-dir \
--with-png-dir \
--with-jpeg-dir \
--with-freetype-dir \
--with-pear \
--with-gettext \
--with-gmp \
--with-mcrypt \
--disable-debug \
--enable-soap \
--enable-ftp \
--enable-sockets \
--enable-mbstring &> /dev/null
make &> /dev/null && make install &> /dev/null
cp php.ini-dist $PHP_LOCATION/etc/php.ini
cd .. ; rm php-$PHP_VER -fr
echo "AddType application/x-httpd-php .php .phtml " >> $APACHE_LOCATION/conf/httpd.conf
echo "" > $APACHE_LOCATION/htdocs/index.php
#DO NOT forget to add “index.php” under the section
#Installing ZendOptimizer
tar jxf ZendOptimizer-$ZEND_VER.tar.bz2
cd ZendOptimizer-$ZNED_VER
./install
MRTG--The Multi Router Traffic Grapher
MRTG Configuration HOW-TO http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/mrtg/
Author’s website
http://oss.oetiker.ch/mrtg/
CACTI--too powful to explain : )
Offical website: http://www.cacti.netIGENUS--qmail+mysql+vpopmail
Offical website: http://www.igenus.org/--
知行合一