(1)下载
http://httpd.apache.org/
下载httpd-2.2.10.tar.gz
(2)解压缩
# gzip -d httpd-2_0_NN.tar.gz
# tar xvf httpd-2_0_NN.tar
(3) 配置.
# ./configure --prefix =/usr/local/apache
表示Apache将安装在/usr/local/apache目录下
(4) 编译与安装
# make
# make install
(5) 测试
# /usr/local/apache/bin/apachectl start
另外关闭: # /usr/local/apache/bin/apachectl stop
(6) 配置
ServerName new.host.name:80 #web客户搜索的主机名称
KeepAliveTimeout 15 #规定了连续请求之间等待15秒,若超过,则重新建立一条新的TCP连接
MaxKeepAliveRequests 100 #永久连接的HTTP请求数
MaxClients 150 #同一时间连接到服务器上的客户机总数
ErrorLog logs/error_log #用来指定错误日志文件的名称和路径
PidFile run/httpd.pid #用来存放httpd进程号,以方便停止服务器。
Timeout 300 #设置请求超时时间,若网速较慢则应把值设大。
DocumentRoot /var/www/html #用来存放网页文件