Apache基礎安裝(一)

一、下載安裝軟件包安裝

[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

[[email protected]]#make

[[email protected]]#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]




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章