Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10725664
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-03-23 11:15:06

     近段时间一直在整服务器监控方面的东西,以下就是cacti中英文版安装的全过程,各安装包基本都是最新的,基于Centos 5.2平台下安装的!!
 
#!/bin/bash
# BY kerryhu
# QQ:263205768
# MAIL:king_819@163.com
# BLOG:http://kerry.blog.51cto.com
# Please manual operation yum of before Operation.....
#Centos 5.2
# yum install ntp vim-enhanced gcc gcc-c++ flex bison autoconf \
# automake bzip2-devel ncurses-devel libjpeg-devel libpng-devel \
# libtiff-devel freetype-devel pam-devel kernel netconfig
#########################################
ntpdate time.nist.gov
groupadd mysql        
useradd mysql -d /dev/null -g mysql -s /sbin/nologin
cd /opt
#####################################
#2、安装ncurses-5.6
tar -zxvf  ncurses-5.6.tar.gz
cd ncurses-5.6
./configure --prefix=/usr --with-shared --without-debug
make
make install
make install clean
####################################
#3、安装mysql-5.0.51a
cd /opt
tar -zxvf mysql-5.0.51a.tar.gz
cd mysql-5.0.51a
./configure --with-mysqld-user=mysql --prefix=/usr/local/mysql5 --with-charset=gbk --with-extra-charset=all --without-isam --exec-prefix=/usr/local/mysql5
make
make install
/usr/local/mysql5/bin/mysql_install_db       
chown -R mysql.mysql /usr/local/mysql5/
cp /usr/local/mysql5/share/mysql/my-medium.cnf /etc/my.cnf 
cp support-files/mysql.server /etc/rc.d/init.d/mysqld     
chmod 700 /etc/rc.d/init.d/mysqld                        
/usr/local/mysql5/bin/mysqld_safe --user=mysql &         
/etc/rc.d/init.d/mysqld start
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
ln -s /usr/local/mysql5/bin/mysql /sbin/mysql
ln -s /usr/local/mysql5/bin/mysqladmin /sbin/mysqladmin
#配置库文件搜索路径
echo "/usr/local/mysql5/lib/mysql" >> /etc/ld.so.conf
#添加/usr/local/mysql5/bin到环境变量PATH中
export PATH=$PATH:/usr/local/mysql5/bin
########################################################
#4、安装ZLIB2
#  如果不安装,等下编译安装openssl 就会报错,所以提前编译安装
cd /opt
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
make
make install
######################################################
#5、安装openssl-0.9.8g
cd /opt
tar zxvf openssl-0.9.8g.tar.tar
cd openssl-0.9.8g
./config shared zlib
make
make test
make install
mv /usr/bin/openssl /usr/bin/openssl.OFF
mv /usr/include/openssl /usr/include/openssl.OFF
rm /usr/lib/libssl.so
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
ln -sv /usr/local/ssl/lib/libssl.so.0.9.8 /usr/lib/libssl.so
#配置库文件搜索路径
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
#################################################
#6、安装BerkeleyDB
cd /opt
tar zxvf db-4.5.20.tar.gz
cd db-4.5.20/build_unix
../dist/configure --prefix=/usr/local/BerkeleyDB
make;make install
ln -sv /usr/local/BerkeleyDB/include /usr/include/db4
ln -sv /usr/local/BerkeleyDB/include/db.h /usr/include/db.h
ln -sv /usr/local/BerkeleyDB/include/db_cxx.h /usr/include/db_cxx.h
echo "/usr/local/BerkeleyDB/lib" >> /etc/ld.so.conf
ldconfig
####################################################
#7、安装httpd-2.2.8
cd /opt
tar jxvf httpd-2.2.8.tar.bz2
cd httpd-2.2.8
./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl --with-ssl=/usr/local/ssl --enable-track-vars --enable-rewrite --with-zlib --enable-mods-shared=most --enable-suexec --with-suexec-caller=daemon
make;make install
 
echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local
/usr/local/apache/bin/apachectl start
#################(8)安装libPNG######################################
cd /opt
tar zxvf  libpng-1.2.26.tar.gz
cd libpng-1.2.26
cp scripts/makefile.linux ./makefile
./configure --prefix=/usr/local/libpng
make;make install
##################(9)安装freetype##################################
cd /opt
tar zxvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure
 make;make install
##################(10)安装JPEG6##################################
cd /opt
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
mkdir -pv /usr/local/jpeg/{,bin,lib,include,man/man1,man1}
./configure --prefix=/usr/local/jpeg --enable-shared --enable- static
make;make install
##################(11)安装GD####################################
cd /opt
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --with-png --with-freetype --with-jpeg=/usr/local/jpeg/
make;make install
##################(12)安装LIBXML2################################
cd /opt
tar zxvf libxml2-2.6.31.tar.gz
cd libxml2-2.6.31
./configure --prefix=/usr/local/libxml2
make;make install
cp xml2-config /usr/bin
##################(13)安装libmcrypt###############################
cd /opt
tar zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
 make;make install
##################(14)安装PHP5.2.5###################################
cd /opt
tar zxvf php-5.2.5.tar.gz
cd php-5.2.5
./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql5 --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/include/freetype2 --with-zlib --with-png-dir=usr/local/libpng12 --with-libxml-dir=/usr/local/libxml2 --with-gd --enable-ftp --enable-sockets -enable-mbstring=all- --with-mcrypt --with-mysqli=/usr/local/mysql5/bin/mysql_config
make;make install
cp php.ini-dist /usr/local/php5/lib/php.ini
mv /usr/local/apache/conf/http.conf /usr/local/apache/conf/http.conf.bak
cp /opt/httpd.conf /usr/local/apache2/conf/httpd.conf
cp /opt/index.php /usr/local/apache2/htdocs/
##############################################
# INSTALL ZendOptimizer
cd /opt
tar -zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.3-linux-glibc23-i386
./install
echo "LINUX+MYSQL+APACHE2+PHP5+ZEND INSTALL OK"
#安装Time::HiRes
cd /opt
tar zxvf Time-HiRes-1.9715.tar.gz
cd Time-HiRes-1.9715
perl Makefile.PL
make
make test
make install
#安装File::Tail
cd /opt
tar zxvf File-Tail-0.99.3.tar.gz
cd File-Tail-0.99.3
perl Makefile
make
make test
make install
cd /opt
rpm -ivh libart_lgpl-devel-2.3.17-4.i386.rpm
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make
cp libcgi.a /usr/local/lib
cp cgi.h /usr/include
ln -s /usr/local/include/freetype2/ /usr/include/freetype2
#安装rrdtool-1.2.23
cd /opt
tar zxvf rrdtool-1.2.23.tar.gz
cd rrdtool-1.2.23
./configure --prefix=/usr/local/rrdtool
make
make install
#========================安装net-snmp========================
cd /opt
tar -zxvf net-snmp-5.3.2.tar.gz
cd net-snmp-5.3.2
./configure –prefix=/usr/snmp –enable-mfd-rewrites --enable-developer
make;make install
cp EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.conf
#vi /usr/local/net-snmp/share/snmp/snmpd.conf
#com2sec local localhost public
#com2sec mynetwork 192.168.8.0/24 public

/usr/local/net-snmp/sbin/snmpd -c /usr/local/net-snmp/share/snmp/snmpd.conf
echo "/usr/local/net-snmp/sbin/snmpd -c /usr/local/net-snmp/share/snmp/snmpd.conf" >> /etc/rc.local
PATH=/usr/local/net-snmp/bin/:/usr/local/net-snmp/sbin/:$PATH
cd ../
#=======================安装 英文版cacti============================
#下载
阅读(410) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~