centos下安装与配置Apache方法    

下面以httpd-2.0.55.tar.gz版本为例,介绍Apache在Linux中的安装过程:
1、解压和解包安装文件:
gzip -d httpd-2.0.55.tar.gz
tar xvf httpd-2.0.55.tar
2、配置:
cd httpd-2.0.55
./configure --prefix=/usr
3、编译:
make
4、安装:
make install
5、配置:
vi /usr/conf/httpd.conf
将文件中“#ServerName www.example.com:80”这一行中的“#”删掉,并将www.example.com 改为linux本机的IP地址。
6、启动服务:
/usr/bin/apachectl start   (如果启动服务失败后,由将第五步配置中,改成ServerName localhost:80即可)
7、测试:
在浏览器中输入http://ip/测试安装是否成功