免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5185 | 回复: 8
打印 上一主题 下一主题

as4上安装apache,mysql,php,cacti,nagios目前都是最新版本上 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-10 15:51 |只看该作者 |倒序浏览
本安装过程以linux AS4 为底本.安装linux时选最小安装+xwindows没有装apache,mysql,php.等,安装cacti,nagios2.0 ,fruity,作为web页面管理测试。
一、安装基本系统:mysql5+php5+apache2
安装mysql:www.mysql.org  
下载了编译版本mysql-max-5.0.18-linux-i686-glibc23.tar.gz
     shell> groupadd mysql
     shell> useradd -g mysql mysql
     shell> cd /usr/local
     shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf -
     shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
     shell> cd mysql
     shell> scripts/mysql_install_db --user=mysql
     shell> chown -R root  .
     shell> chown -R mysql data
     shell> chgrp -R mysql .
     shell> bin/mysqld_safe --user=mysql &
         shell>cp support-files/my-medium.cnf /etc/my.cnf
         shell> cp bin/* /usr/bin/
要开机自动运行mysql:
1、                mkdir /usr/local/etc/rc.d
        vi /usr/local/
                #! /bin/sh
                /usr/local/mysql/bin/mysqld_safe &
        chmod 755 /usr/local/etc/rc.d/mysql.sh
        启动其他服务类似。
2、vi /etc/rc.local
        /usr/local/mysql/bin/mysqld_safe &
如此操作,可以启动服务。rpm安装每次安装后启动不来,放弃。
启动:mysqld_safe &
停止:mysqladmin shudown 。
补充:        ldconfig –v
                cp support-files/mysql.server /etc/init.d/mysql
                cd /etc/rc3.d/
                ln -s ../init.d/mysql S85mysql
                ln -s ../init.d/mysql K85mysql
                cd /etc/rc5.d/
                ln -s ../init.d/mysql S85mysql
                ln -s ../init.d/mysql K85mysql
                cd /etc/init.d/
                chmod 755 mysql

安装APACHE: www.apache.org
下载httpd-2.2.0.tar.gz
# tar zxvf httpd-2.2.0.tar.gz
# cd httpd-2.2.0
# ./configure --prefix=/usr/local/apache --enable-so
# make & make install
# cp /usr/local/apache/bin/*  /usr/bin/
# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
安装gd2:http://www.boutell.com/gd/
   下载 gd-2.0.33.tar.gz
./configure make make install
Libraries have been installed in:
   /usr/local/lib
安装php: www.php.net
  下载 php-5.1.2.tar.gz
./configure --prefix=/usr/local/php --with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-mysqli=/usr/local/mysql/bin/mysql_config --with-xmlpc
cp /usr/local/php/bin/*   /usr/bin
cp /soft/php-5.1.2/ php.ini-dist  /usr/local/php/lib/php.ini
vi /usr/local/apach/conf/httpd.conf
添加如下2行:
AddType application/x-httpd-php .php .phtml .php3 .php4
AddType application/x-httpd-php-source .phps
安装phpmyadmin: www.phpmyadmin.net
下载:phpMyAdmin-2.7.0-pl2.tar.gz
解压后mv到/usr/local/下,然后修改config.default.php 修改相应的用户名和密码即可。
$cfg['Servers'][$i]['auth_type'] = 'http';  // Authentication method (config, http or cookie based)
$cfg['Servers'][$i]['user']     = 'root';  // MySQL user
$cfg['Servers'][$i]['password'] = ' ';    // MySQL password (only needed with 'config' auth_type)
注:如红色部分,用config作为认证方式,则下面得user和password都必须添上,安全性较低
用http做为认证方式,则弹出用户认证对话框.

论坛徽章:
0
2 [报告]
发表于 2006-02-10 15:52 |只看该作者

apache,mysql,php,cacti,nagios目前都是最新版本下

安装net-snmp
下载net-snmp-5.3.0.1-1.EL4.i386.rpm
安装mrtg:www.mrtg.org
下载 mrtg-2.12.2.tar.gz  
./configure  --prefix=/usr/local/mrtg & make & make install  cp /usr/local/mrtg/bin/*  /usr/bin
安装rrdtool:www.rrdtool.org
http://people.ee.ethz.ch/~oetike ... oc/rrdbuild.en.html
(以下部分可以直接copy到linux shell下 自动安装,我是分段copy,整体copy未尝试)
BUILD_DIR=/tmp/rrdbuild
INSTALL_DIR=/usr/local/rrdtool
mkdir -p $BUILD_DIR
mkdir $BUILD_DIR/lb
cd $BUILD_DIR
#####zlib
wget http://people.ee.ethz.ch/oetiker ... s/zlib-1.2.2.tar.gz
tar zxvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
make
make install
cd ..
#####libpng
wget http://people.ee.ethz.ch/oetiker ... 1.2.8-config.tar.gz
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" \
        CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
#########freetype
wget http://people.ee.ethz.ch/oetiker ... eetype-2.1.9.tar.gz
tar zxvf freetype-2.1.9.tar.gz
cd freetype-2.1.9
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
####### libart_lgpl
wget http://people.ee.ethz.ch/oetiker ... _lgpl-2.3.17.tar.gz
tar zxvf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
make
make install
cd ..
########cgilib
wget http://people.ee.ethz.ch/~oetike ... s/cgilib-0.5.tar.gz
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
make CC=gcc CFLAGS="-O3 -fPIC -I."
mkdir -p $BUILD_DIR/lb/include
cp *.h $BUILD_DIR/lb/include
mkdir -p $BUILD_DIR/lb/lib
cp libcgi* $BUILD_DIR/lb/lib
cd ..
#########install rrdtool
ranlib $BUILD_DIR/lb/lib/*.a   # 优化
IR=-I$BUILD_DIR/lb/include
CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
LDFLAGS="-L$BUILD_DIR/lb/lib"
CFLAGS=-O3
export CPPFLAGS LDFLAGS CFLAGS
cd $BUILD_DIR/
wget http://people.ee.ethz.ch/~oetike ... dtool-1.2.12.tar.gz
tar zxvf rrdtool-1.2.12.tar.gz
cd  rrdtool-1.2.12
./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
make
make install
cd ..
***********************RRDTOOL INSTALL SUCCESSFULLY**********************
安装CACTI:www.cacti.net
        cacti-0.8.6h.tar.gz
        tar zxvf cacti-0.8.6h.tar.gz  
cp –R cacti-0.8.6h  /usr/local/cacti/
配置Mysql:
        group-add cacti
        useradd -g cacti cactiuser
        /usr/local/mysql/bin/mysql – --user=root – --password=yanhannet
        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;
        mysql> set password for cactiuser@localhost=password('yanhannet');
        mysql> exit
# mysql --user=root --password=yanhannet cactidb < cacti.sql
# chown -R cactiuser rra/ log/
# chmod –R 777 rra/ log/
# vi cacti/include/config.php
        $database_type = "mysql";
        $database_default = "cactidb";
        $database_hostname = "localhost";
        $database_username = "cactiuser";
        $database_password = "yanhannet";
        $database_port = "3306";
vi /etc/ctrontab (crontab -u cactiuser –e)
       */5 * * * * cactiuser php /usr/local/cacti/poller.php > /dev/null 2>&1
配置apache
vi /usr/local/apache/conf/conf.d/cacti.conf
Alias /cacti /usr/local/cacti
<Directory "/usr/local/cacti">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
#    AuthName "XXXXX"
#    AuthType Basic
#    AuthUserFile /XXX/htpasswd.users
#    Require  valid-user
</Directory>
******************CACTI  INSTALL  SUCCESSFULLY ***********************
安装nagios   www.nagios.org
useradd nagios
mkdir /usr/local/nagios
chown nagios.nagios /usr/local/nagios/
usermod -G nagcmd apache
usermod -G nagcmd nagios
./configure --prefix=/usr/local/nagios --with-gd-lib=/usr/lib --with-gd-inc=/usr/include
注:红色部分为gd库位置,如果不加,这会出现The statusmap, trends and histogram CGIs are missing or dont work!
查看3-D status map 需要在本机下载插件contvrml
http://www.parallelgraphics.com/bin/cortvrml.exe
在apache配置文档目录下
vi nagios.conf
scriptalias  /nagios/cgi-bin /usr/local/nagios/sbin
<Directory "/usr/local/nagios/sbin">
        allowoverride authconfig
        options execcgi
        order allow,deny
        allow from all
</directory>
alias /nagios /usr/local/nagios/share
<directory "/usr/local/nagios/share">
        options none
        allowoverride authconfig
        order allow,deny
        allow from all
</directory>
在nagiosroot目录下
vi .htaccess
authname "nagios access"
authtype basic
authuserfile  /usr/local/nagios/etc/.nagios.users
require valid-user
生成用户文件
htpasswd -c /usr/local/nagios/etc/.nagios.users nagiosadmin
具体参数配置参考官方文档

工具插件:www.nagiosexchange.org
fruity 要求php5以上
下载:https://sourceforge.net/project/showfiles.php?group_id=136248
http://pear.php.net/get/HTML_TreeMenu-1.2.0.tgz   
http://sourceforge.net/project/s ... p;release_id=387862  
直接解压复制到fruity 下 分别改名为HTML 和adodb 其他不做修改
修改 fruity/includes下的config.ifg,需要更改的地方有,路径,mysql信息
mysql 添加fruity 数据库和user,password.

论坛徽章:
0
3 [报告]
发表于 2006-02-10 15:53 |只看该作者
欢迎加入群17901979讨论。。

论坛徽章:
0
4 [报告]
发表于 2006-02-17 15:32 |只看该作者
能用中文说明一下各步骤的作用就比较好........

[ 本帖最后由 ddie 于 2006-2-17 16:12 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-02-18 11:44 |只看该作者
同意楼上的

论坛徽章:
0
6 [报告]
发表于 2006-03-09 10:34 |只看该作者
好东东,最近我也在学习这个。

论坛徽章:
0
7 [报告]
发表于 2006-03-12 22:49 |只看该作者
奇怪, 我是在A3下面部署这个的。
执行groupadd mysql 时候, 系统提示说没这个命令...

论坛徽章:
0
8 [报告]
发表于 2006-03-12 23:02 |只看该作者
原帖由 cqf820 于 2006-3-12 22:49 发表
奇怪, 我是在A3下面部署这个的。
执行groupadd mysql 时候, 系统提示说没这个命令...


su 到 root 時,忘記加上 -l 參數?

论坛徽章:
0
9 [报告]
发表于 2006-03-12 23:06 |只看该作者
老實說每次看到一些文章都是 tarball 安裝,我真的在思考後續若是系統要維護的話,實在是一個很頭大的問題。

若是系統一直要使用最新版本的程式,是否考慮使用 gentoo linux?因為 portage 架構可以滿足這個需求。

==
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP