httpd2.4
httpd2.4的新特性(1)MPM支持允许DOS机制(2)支持event MPM(3)支持异步读写(4)支持每个模块及每个目录分别使用各自的日志级别(5)支持每个请求配置<if>(6)增强版的表达式分析器(7)支持毫秒级的keepalive timeout(8)基于FQDN的虚拟主机不再需要NameVirtualHost指令(9)支持用户自定义变量
新模块:(1)mod_proxy_fcgi php(2)mod_ratelimit 速率限制(3)mod_remoteip 指明远程客户端ip地址
配置机制的修改 不再支持使用Order,Deny,Allow来做基于IP的访问控制
httpd依赖于apr,apr-util,apr-iconapr:apache protable runtime
安装可参考下面文档http://www.linuxea.com/index.php/archives/apachectl2-4.html
配置:1,切换使用mpmLoadModule mpm_NAME_module modules/mod_mpm_NAME.so NAME:prefork,event,worker2,修改主机的文档路径,'Main' server的DocumentRoot3,基于IP的访问控制法则允许所有主机访问:Require all granted拒绝所有主机访问:Require all deny
控制特定IP访问: Require ip IPADDR :授权指定来源地址的主机访问 Require not ip IPADDR:拒绝指定来源地址的主机访问
IPADDR: IP:172.16.100.100 network/mask:172.16.100.100/23 network/mask:172.168.100.100/16
虚拟主机!#vim /etc/httpd24/extra/httpd-vhsots.conf<VirtualHost *:80> ServerAdmin webmaster@a.com DocumentRoot "/vhost/a.com" ServerName www.a.com ErrorLog "logs/www.a.com-error_log" CustomLog "logs/www.a.com-access_log" combined <Directory "/vhost/a.com"> Options none AllowOverride none Require all granted </Directory></VirtualHost>
<VirtualHost *:80> ServerAdmin webmaster@b.com DocumentRoot "/vhost/b.com" ServerName www.b.com ErrorLog "logs/www.b.com-error_log" CustomLog "logs/www.b.com-access_log" combined <Directory "/vhost/b.com"> Options none AllowOverride none Require all granted </Directory></VirtualHost>