系统:CentOS6.2
服务器:Httpd2.2.21
卸载系统自带的httpd:
rpm -qa|grep httpd
rpm -e httpd-2.2.15-15.el6.centos --nodeps
rpm -e httpd-tools
安装过程:
www.apache.org下载httpd-2.2.21.tar.gz
tar zxvf httpd-2.2.21.tar.gz
cd httpd-2.2.21
./configure --prefix=/usr/apache --sysconfdir=/etc/httpd --enable-so -enable-modules-shared=all --with-mpm=worker
make
make install
说明:--with-mpm=worker 指定apache的进程模型为worker,默认情况下,进程模型为prefork,改为worker后会改善apache的性能;安装目录可以自己指定;安装过程如果出错的话,自己解决吧 这是基本功
启动停止:
/usr/apache/bin/apachectl start
/usr/apache/bin/apachectl stop
检查配置错误:
/usr/apache/apachectl -t
/usr/apache/apachectl configtest
目录说明:
配置文件的每一行包括一个指令,配置文件中的指令是不区分大小写的,指令的参数通常是大小写敏感的;
--enable-so DSO capability
--enable-modules=MODULE-LIST
Space-separated list of modules to enable | "all" | "most"
是将模块编译到apache中
--enable-mods-shared=MODULE-LIST
Space-separated list of shared modules to enable |"all" | "most"
--enable-modules-shared是将模块独立编译、动态加载,也就是所谓的dso
--enable-disk-cache disk caching module
--enable-mem-cache memory caching module
--enable-reqtimeout Limit time waiting for request from client
--enable-expires Expires header control
--enable-headers HTTP header control
--enable-proxy Apache proxy module
--enable-proxy-connect Apache proxy CONNECT module
--enable-proxy-ftp Apache proxy FTP module
--enable-proxy-http Apache proxy HTTP module
--enable-proxy-scgi Apache proxy SCGI module
--enable-proxy-ajp Apache proxy AJP module
--enable-http HTTP protocol handling
--enable-info server information
--enable-rewrite rule based URL manipulation