Linux Apache + php + Mysql + cactus 安装 安装

  
 

yum -y instala gcc gcc-c ++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib repartidos -devel


1. 安装 mysql

tar zxvf mysql-5.0.92.tar.gz

cd mysql-5.0.92

./configure --prefix = /usr /local /mysql --sysconfdir = /etc --with-unix-socket-path = /usr /local /mysql /var /mysql /mysql.sock - without-debug --enable-isam --with-mysqld-user = mysql --with-mysqld-ldflags = -all-static --with-client-ldflags = -all-staticmake &&make installuseradd mysql /usr /local /mysql /bin /mysql_install_dbcp support-files /my-medium.cnf /etc/my.cnfcp support-files /mysql.server /etc/rc.d/init.d/mysqldchmod 755 /etc /rc.d/init.d/mysqldchown -R mysql.mysql /usr/local/mysql/var/etc/rc.d/init.d/mysqld startcd ..

2. 安装 apache

tar zxvf httpd-2.2.17.tar.gz

cd httpd-2.2.17

./configure --prefix = /usr /local /http --enable- así --enable-mods-shared = all --enable-vhost-alias --enable-deflate --enable-expires --enable-rewrite --enable-authn-dbm = shared --enable-ssl --with- sslmake &&make installcp /usr /local /http /bin /apachectl /etc/rc.d/init.d/httpdchmod 755 /etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd start输入 地址 栏 输入 IP, 看到 funciona 说明 apache 正常 启动

3. 安装 phptar zxvf php-5.2.17.tar.gzcd php-5.2.17./configure --prefix = /usr /local /php --with-apxs2 = /usr /local /http /bin /apxs --with-config-file-path = /usr /local /php /etc --with-mysql = /usr /local /mysql - -with-mysqli = /usr /local /mysql /bin /mysql_config --with-mcrypt --with-config-file-path = /usr /local /php5 --enable-safe-mode --enable-zip - with-bz2 --with-jpeg-dir --with-png-dir --with-freetype-dir --without-iconv --with-libxml-dir --with-zlib-dir --with-xmlrpc - with-gd - with-curl --enable-mbstring --with-curlwrappers --with-xsl --enable-sockets --disable-rugable --disable-debugmake &&make installcp php.ini-production /usr/local/php/etc/php.inivi /usr/local/http/conf/httpd.conf

application AddType application /x-gzip .gz .tgz 在 下行填 application Aplicación AddType /x-httpd-php .phpAddType application /x-httpd-php-source .phps 找到 index.html 后边 加 填, 填 加 index.php

4. 填 加 PHP
页 页 vi /usr/http/htdocs/index.php 代码 <? Phpphpinfo ()? ≫

5. 重启 apacheservice httpd restart

6. 在 地址输入 输入 ip: /index.php 可以 看到 测试, 说明 PHP 正常 启动

1. cactus tar : tar -xzvf cacti-0.8.7g.tar.gz

cd cacti-0.8.7g

2. mv cacti-0.8.7g /usr /local /http /htdocs /cacti (apache 默认 www 目录)

3. cd /usr /local /http /htdocs /cacti

chmod 777 rrachmod 777 logchmod 777 poller.php

4. vi /usr/local/http/htdocs/include/config.php 修改 下面 设置 $ database_type = " mysql "; $ database_default = " cactus "; # (连接 cacti 库) $ database_hostname = " 127.0.0.1 "; # (连接 到 那个 地址) $ database_username = " cactus "; # (使用 的 数据库 名) $ database_password = " "; # (密码) $ database_port = " 3306 ";

5.然后 登录 数据库 ; mysql > crear base de datos cacti; mysql > utilizar mysql; mysql > conceda todos los privilegios en cacti. * a cacti @ localhost identificado por 'cacti' con opción de concesión; mysql > conceda todos los privilegios en cacti. * a [email protected] identificado por 'cacti' con opción de concesión; mysql > actualizar la contraseña establecida por el usuario = contraseña (" ") donde el usuario = " cactus "; mysql > privilegios de descarga; mysql > utilice cacti; mysql > source /usr/local/http/htdocs/cacti.sql; # (导入 数据库)

6. Ip 器 下 用 # 用 浏览 器 http: //ip /cacti , cacti 的 安装 指南 , 出现 了 # 点击 " Next " # 选择 " New Install ", " Siguiente " # 指定 rrdtool 、 php 、 snmp 工具 的 Binary 文件 路径 , 确保 的 路径 都是 l " ENCONTRADO ", 没有 " NO ENCONTRADO " 的 , 点击 Finish # Cacti 默认 的 用户 与 密码 密码 admin , 用户 , 密码 , , login # php us us /usr /local /php /bin /php (上面 php 安装 的 时候) # 为了 安全 的 , , act 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的 的台 界面 : # 点击 gráficas , 查看 cactus 监控 本 的 图表 : :

7. crontab -e * /5 * * * * root /usr /local /php /bin /php /usr/local/http/htdocs/cacti/poller.php > /dev /null 2 ​​> &1

8. vi /etc /crontab * /5 * * * * root /usr /local /php /bin /php /usr/local/http/htdocs/cacti/poller.php > /dev /null 2 ​​> &1

rd rrdtool 包 : yun install perl-rrdtool-1.2.30-1.el5.rf.i386.rpm rrdtool-1.2.30-1.el5.rf. i386.rpm rrdtool-devel-1.2.30-1.el5.rf.i386.rpm # (三个 , , 要不然 会 报错。)

snmp 安装 配置 :

Copyright © Conocimiento de Windows All Rights Reserved