apache2.2支持worker,rewrite模块,支持线程

 

apache编译安装
//httpd2.2
./configure --prefix=/home/www --enable-rewrite --enable-so --with-mpm=worker --with-threads=yes


apache编译安装
//httpd2.2
./configure --prefix=/home/www --enable-rewrite --enable-so --with-mpm=worker --with-threads=yes

//lt_LogFormat
LogFormat "%h %l %u %{[%Y/%m/%d/%w:%H:%M:%S]}t "%r" %>s %b "%{User-agent}i"" combined
CustomLog "|/usr/local/sbin/cronolog /home/www20/logs/web-%Y%m%d.log" combined


//fj_LogFormat
LogFormat "%h %l %u %{,%a%Y/%m/%d:%H:%M:%S}t "%r" %>s %b "%{User-Agent}i"" common
CustomLog "|/usr/local/sbin/cronolog /home/www20/logs/web-%Y%m%d.log" common

<Directory "/var/www/html/web">
Options -Indexes FollowSymLinks
AllowOverride None
AuthType Basic
AuthName renzhen   
AuthUserFile /usr/local/apache/conf/pass
require valid-user + 用户   
</Directory>

cd /usr/local/apache/bin
./htpasswd -c /usr/local/apache/conf/pass +用户名
chown apache.apache /usr/local/apache/conf/pass

//http TRACE 跨站攻击
下面介绍一下怎样打开apache的mod_rewrite功能。
#tar -zxvf httpd-2.0.59.tar.gz
#cd httpd-2.0.59
#./configure -prefix=/opt/apache2 -enable-modules=so -enable-module=rewrite -enable-shared=rewrite -

enable-shared=max
#make
#make install
# httpd -l //看到有worker.c说明已经支持worker模块


apache安装完毕,下面来加载编译mod_rewrite.so这个模块。
#cd /soft/httpd-2.0.59/modules/mappers
#/opt/apache2/bin/apxs -c mod_rewrite.c -lgdbm
#gcc -shared -o mod_rewrite.so mod_rewrite.o -lgdbm
#/opt/apache2/bin/apxs -i -A -n rewrite mod_rewrite.so

是Apache, 在各虚拟主机的配置文件里添加如下语句:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]

//httpd2.2
修改$APACHE_HOME/conf/httpd.conf
#Include conf/extra/httpd-mpm.conf
取消前面注释

编辑conf/extra/httpd-mpm.conf
找到# worker MPM
MaxClients 150

在其前面添加
ServerLimit 16

============================================

编译多个apache

make clean; ./configure --prefix=/app/apache/apache_hd --enable-rewrite --enable-so --with-mpm=worker --with-threads=yes --enable-headers --enable-deflate ;make ;make install
make clean; ./configure --prefix=/app/apache/apache_hnd --enable- --enable-so --with-mpm=worker --with-threads=yes ;make ;make install
make clean; ./configure --prefix=/app/apache/apache_pd --enable-rewrrewriteite --enable-so --enable-headers --enable-deflate ;make ;make install
make clean; ./configure --prefix=/app/apache/apache_pnd --enable-rewrite --enable-so ;make ;make install
make clean; ./configure --prefix=/app/apache/apache_cache --enable-rewrite --enable-so --with-mpm=worker --with-threads=yes --enable-headers --enable-deflate --enable-cache --enable-disk-cache --enable-mem-cache;make ;make install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值