- 论坛徽章:
- 0
|
一,编译,安装apache
./configure --prefix=/usr/local/apache2 --enable-module=most --enable-shared=max --enable-rewrite --enable-so --with-mpm=worker
make
make install
二、修改配置
vi /usr/local/apache2/conf/httpd.conf
ServerName 127.0.0.1:80
DocumentRoot "/data"
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Options Indexes 目录显示
防盗链
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.wyzx.cn/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.wyzx.cn$ [NC]
RewriteCond %{HTTP_REFERER} !^http://bbs.wyzx.cn/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://bbs.wyzx.cn$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|rar|zip|exe)$ http://www.wyzx.cn/index.php [R,NC]
SetEnvIfNoCase Referer "^http://.*\.wyzx\.cn" local_ref=1
SetEnvIfNoCase Referer ".*\.wyzx\.cn" local_ref=1
Order Allow,Deny
Allow from env=local_ref
三、修改mpm设置
vi /usr/local/apache2/conf/extra/httpd-mpm.conf
StartServers 10
ServerLimit 128
ThreadLimit 1024
MaxClients 4096
MinSpareThreads 32
MaxSpareThreads 64
ThreadsPerChild 32
MaxRequestsPerChild 0
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/75896/showart_2162965.html |
|