CentOS5.5+Nagios详细配置和设置+问题排除
一、创建LAMP环境 Apache+MySQL+PHP for CentOS(一)、Apache安装(使用yum安装或者官网下载软件包安装)
1、到Apache官网下载httpd软件包。网址:http://httpd.apache.org/解压到本地的httpd包
# tar -zxvf httpd-2.0.64.tar.gz(注意名称以你下载的软件包型号为准)
# cd httpd-2.0.64 (切换入目录)
完成解压后,对httpd进行编译安装,--enable-module=so:加载modul动态模块。
# ./configure --prefix=/usr/local/apache --enable-module=so \\
编译安装出现如下问题及解决方法
#./configure --prefix……检查编辑环境时出现:
checking for APR... no
configure: error: APR not found .Please read the documentation
解决办法:
1.下载所需软件包:
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
2.编译安装:
yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs
具体步骤如下:
a:解决apr not found问题>>>>>>
# tar -zxf apr-1.4.5.tar.gz
# cdapr-1.4.5
# ./configure --prefix=/usr/local/apr
# make && make install
b:解决APR-util not found问题>>>>
# tar -zxf apr-util-1.3.12.tar.gz
# cd apr-util-1.3.12
# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
# make && make install
c:解决pcre问题>>>>>>>>>
#unzip -o pcre-8.10.zip
#cd pcre-8.10
#./configure --prefix=/usr/local/pcre
#make && make install
4.最后编译Apache时加上:
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util/ \
--with-pcre=/usr/local/pcre
成功编译完成~
\\
#make
#make install
/usr/local/apache/bin/apchectl –t (检查语法)
/usr/local/apache/bin/apchectl start(启动)
\\
服务启动过程遇到端口占用的情况及解决方法
# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
1.netstat -lnp|grep 80
tcp 0 0 192.168.180.68:61027 0.0.0.0:* LISTEN 6289/oproxyd
tcp 0 0 :::80 :::* LISTEN 846/httpd
tcp 0 0 ::ffff:192.168.180.68:7001 :::* LISTEN 32015/java
找到pid 846
#ps 846
查看
#kill -9 846
杀掉
#./apachectl start
\\
页:
[1]