系統(tǒng)環(huán)境:centos5.2
CODE:
# ./configure \
"--prefix=/usr" \
"--with-pam" \
"--with-zlib" \
"--sysconfdir=/etc/ssh" \
"--with-ssl-dir=/usr/local/openssl" \
"--with-md5-passwords"
# makeCODE:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
./configure \
"--prefix=/usr/local/mysql" \
"--localstatedir=/data/mysql/data" \
"--with-comment=Source" \
"--with-server-suffix=-LinuxTone" \
"--with-mysqld-user=mysql" \
"--without-debug" \
"--with-big-tables" \
"--with-charset=gbk" \
"--with-collation=gbk_chinese_ci" \
"--with-extra-charsets=all" \
"--with-pthread" \
"--enable-static" \
"--enable-thread-safe-client" \
"--with-client-ldflags=-all-static" \
"--with-mysqld-ldflags=-all-static" \
"--enable-assembler" \
"--without-isam" \
"--without-innodb" \
"--without-ndb-debug"
make && make install
mkdir -p /data/mysql/data
useradd mysql -d /data/mysql -s /sbin/nologin
/usr/local/mysql/bin/mysql_install_db --user=mysql
cd /usr/local/mysql
chown -R root:mysql .
chown -R mysql /data/mysql/data
cp share/mysql/my-huge.cnf /etc/my.cnf
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
/etc/rc.d/init.d/mysqld start
cd /usr/local/mysql/bin
for i in *; do ln -s /usr/local/mysql/bin/$i /usr/bin/$i; done
#sh mysql.sh 即可開始編譯.CODE:
./configure \
"--prefix=/usr/local/apache2" \
"--with-included-apr" \
"--enable-so" \
"--enable-deflate=shared" \
"--enable-expires=shared" \
"--enable-rewrite=shared" \
"--enable-static-support" \
"--disable-userdir"
make
make install
echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local
4).編譯安裝PHPCODE:
./configure \
"--prefix=/usr/local/php" \
"--with-apxs2=/usr/local/apache2/bin/apxs" \
"--with-config-file-path=/usr/local/php/etc" \
"--with-mysql=/usr/local/mysql" \
"--with-libxml-dir=/usr/local/libxml2/bin" \
"--with-gd=/usr/local/gd2" \
"--with-jpeg-dir" \
"--with-png-dir" \
"--with-bz2" \
"--with-xmlrpc" \
"--with-freetype-dir" \
"--with-zlib-dir " \
"--with-openssl=/usr/local/openssl" \
"--with-mcrypt=/usr/local/libmcrypt" \
"--enable-sysvsem" \
"--enable-inline-optimization" \
"--enable-soap" \
"--enable-gd-native-ttf" \
"--enable-ftp" \
"--enable-mbstring" \
"--enable-exif" \
"--disable-debug" \
"--disable-ipv6" \
"--enable-sockets" \
"--disable-cgi" \
"--with-snmp"
make
make install
cp php.ini-dist /usr/local/php/etc/php.ini
2、整合Apache與PHP及系統(tǒng)初化配置.CODE:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin hamgua@gmail.com
DocumentRoot "/data/www/wwwroot"
ServerName cacti.test.comServer
Alias cacti.test.cn
# ErrorLog "logs/dummy-host.example.com-error_log"
# CustomLog "|/usr/sbin/cronolog /data/logaccess_www.linuxtone.org.%Y%m%d" combined
</VirtualHost>
CODE:
net-snmp-libs-5.3.1-24.el5_2.2
net-snmp-perl-5.3.1-24.el5_2.2
net-snmp-utils-5.3.1-24.el5_2.2
net-snmp-5.3.1-24.el5_2.2
net-snmp-devel-5.3.1-24.el5_2.2
CODE:
warning: rrdtool-1.3.4-2.fc9.i386.rpm:
Header V3 DSA signature: NOKEY, key ID 6df2196f
error: Failed dependencies:
dejavu-lgc-fonts is needed by rrdtool-.3.4-2.fc9.i386
#yum -y install dejavu-lgc-fontsCODE:
warning: rrdtool-1.3.4-2.fc9.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6df2196f
Preparing... ###########################################[100%]
1:rrdtool ########################################### [100%]
六、安裝配置cactiCODE:
groupadd cactiuser
useradd -g cacti cactiuser
mysql -uroot -p
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost identified by '123456';
mysql> flush privileges;
mysql> exit
CODE:
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "123456";
$database_port = "3306";
CODE:
*/5 * * * * /usr/local/php/bin/php /data/www/wwwroot/cacti/poller.php > /dev/null 2>&1
CODE:
# SNMP configfile for Linux servers
com2sec local 127.0.0.1 public
com2sec local 192.168.22.0/24 public
group MyROGroup v1 local
group MyROGroup v2c local
group MyROGroup usm local
view all included .1 80
access MyROGroup "" any noauth exact all none nones
yslocation (/etc/snmpd/snmpd.conf)
syscontact Me <hamgua@gmail.com>
#service snmpd restart