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

来源:互联网 发布:小米自动抢购软件神器 编辑:程序博客网 时间:2024/05/22 06:49
 

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

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 手臂到手指麻痛怎么办 拔完智齿特别疼怎么办 躺着胃烧的难受怎么办 喝酒胃烧的难受怎么办 舌头破了特别疼怎么办 舌头又厚又大怎么办 牙齿咬到舌头了怎么办 舌头起了好多泡怎么办 舌头尖起泡很痛怎么办 舌头上起泡怎么办很疼 月经来了二十多天还不干净怎么办 三岁宝宝缺锌怎么办 无舌苔,舌头很红怎么办 嘴唇上肿了一块怎么办 下嘴唇突然肿了怎么办 上嘴唇突然肿厚怎么办 舌尖上火了好疼怎么办 舌头针扎似的疼怎么办 手麻了怎么办小妙招 月子生气奶少了怎么办 颈椎会引起脸麻怎么办 脑梗引起的手麻怎么办 着凉引起的腰疼怎么办 受凉引起的腰疼怎么办 着凉了腰疼厉害怎么办 腰疼压迫神经腿麻木怎么办 运动后小腿变粗怎么办 跑步后小腿变粗怎么办 嘴腮里面肉肿了怎么办 左胳膊左腿发麻怎么办 右胳膊和右腿麻怎么办 站久了腿肿胀疼怎么办 坐电脑前脖子疼怎么办 一做颈椎就疼怎么办 出了月子腿疼怎么办 坐久了屁股麻木怎么办 搬东西把腰扭了怎么办 蹲时间长了脚麻怎么办 马桶坐久了腿麻怎么办 睡觉手麻怎么办小妙招 手麻了怎么办小妙招吗