一、下载安装软件包安装
[root@eric6 home]# mkdir -p /home/tools
[root@eric6 tools]# wget http:#mirror.esocc.com/apache/httpd/httpd-2.2.25.tar.gz
[root@eric6 tools]# tar -zxvf httpd-2.2.25.tar.gz
[root@eric6 tools]# cd httpd-2.2.25
[root@eric6 httpd-2.2.25]# ./configure \
--prefix=/application/apache2.2.25\
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most\
--enable-so \
--with-mpm=worker \
--enable-rewrite
[root@eric6httpd-2.2.25]#make
[root@eric6httpd-2.2.25]#make install
[root@eric6 httpd-2.2.25]# ln -s/application/apache2.2.25 /application/apache
[root@eric6 httpd-2.2.25]#/application/apache/bin/apachectl -l
Compiled inmodules:
core.c
mod_authn_file.c
mod_authn_dbm.c
mod_authn_anon.c
mod_authn_dbd.c
mod_authn_default.c
…..略
[root@eric6 httpd-2.2.25]#/application/apache/bin/apachectl –M
[root@eric6 httpd-2.2.25]#/application/apache/bin/apachectl start
httpd: apr_sockaddr_info_get()failed for eric6.4
httpd: Could notreliably determine the server's fully qualified domain name, using 127.0.0.1for ServerName
[root@eric6 httpd-2.2.25]# lsof -i:80
COMMANDPIDUSERFDTYPE DEVICE SIZE/OFF NODE NAME
httpd4734root4uIPv6 1635410t0TCP *:http (LISTEN)
httpd4736 daemon4uIPv6 1635410t0TCP *:http (LISTEN)
httpd4737 daemon4uIPv6 1635410t0TCP *:http (LISTEN)
httpd4738 daemon4uIPv6 1635410t0TCP *:http (LISTEN)
httpd4821 daemon4uIPv6 1635410t0TCP *:http (LISTEN)
[root@eric6 httpd-2.2.25]# netstat -lnt
Active Internetconnections (only servers)
Proto Recv-Q Send-QLocal AddressForeignAddressState
tcp 00 0.0.0.0:1110.0.0.0:*LISTEN
tcp00 0.0.0.0:521130.0.0.0:*LISTEN
tcp00 127.0.0.1:250.0.0.0:*LISTEN
tcp00 :::111:::*LISTEN
tcp00 :::80:::*LISTEN
tcp00 :::52113:::*LISTEN
[root@eric6 httpd-2.2.25]# ps -ef|grep httpd
root473410 23:03 ?00:00:00/application/apache2.2.25/bin/httpd -k start
daemon473547340 23:03 ?00:00:00/application/apache2.2.25/bin/httpd -k start
daemon473647340 23:03 ?00:00:00/application/apache2.2.25/bin/httpd -k start
daemon473747340 23:03 ?00:00:00/application/apache2.2.25/bin/httpd -k start
daemon473847340 23:03 ?00:00:00 /application/apache2.2.25/bin/httpd-k start
daemon482147340 23:03 ?00:00:00/application/apache2.2.25/bin/httpd -k start
root485542350 23:04 pts/000:00:00 grep httpd
打开浏览器输入IP,提示:It works!
二、安装完成排错
如果打不开排查:服务是否启动、防火墙、selinux是否关闭、查看80端口是否存在、查看进程、查看日志
本地使用wget测试,是否正常
[root@eric6 httpd-2.2.25]# wget 10.0.0.249
--2013-10-1623:08:07--http:#10.0.0.249/
Connecting to10.0.0.249:80... connected.
HTTP request sent,awaiting response... 200 OK
Length: 44[text/html]
Saving to:`index.html.1'
100%[==============================================================>]44--.-K/sin 0s
2013-10-16 23:08:07(10.8 MB/s) - `index.html.1' saved [44/44]
转载于:https://blog.51cto.com/laoshuxmao/1312446