Apache

SOS,spark!xxx网站打开奇慢,快点给看看,赶忙帮个忙解决。

因而代班超人紧急出动,SSH登陆后台,按照俺一向的二把刀操做手法:

一、检查内存使用状况
free -m

二、查看当前进程状况
top

以上两步未看出啥异常,那就看看apache进程吧
ps -aux|grep apache

好象进程数是多了点,但也不离谱呀,懒得深究,重启下apache得了!(自已鄙视本身一下)

无果,仍是慢,并且是一启动就很慢,这就不对劲了!并且很奇怪,一启动apache的进程数就达到httpd.conf中设置的上限了!

以我多年的经验,嘿... 被人盗链了!找出病因,下药就很简单了!

编辑httpd.conf中加入防盗链设置:
php

Xml代码 复制代码
  1. < VirtualHost  *:80 >   
  2.         DirectoryIndex index.htm index.html index.php  
  3.         LogLevel debug  
  4.         HostNameLookups off  
  5.         ServerName www.xxxxx.com  
  6.         ServerAlias xxxxx.com  
  7.         DocumentRoot /var/www/html  
  8.         SetEnvIfNoCase Referer "^http://www.xxxxx.com" local_ref = 1   
  9.         SetEnvIfNoCase Referer "^http://sign51.cn" local_ref = 1   
  10.         SetEnvIfNoCase Referer ".*\.xxxxx\.com" local_ref = 1   
  11.         < FilesMatch  "\.(gif|jpg|png|css|swf)" >   
  12.                 Order Allow,Deny  
  13.                 Allow from env = local_ref   
  14.          FilesMatch >   
  15. VirtualHost >   
 
  
  DirectoryIndex index.htm index.html index.php LogLevel debug HostNameLookups off ServerName www.xxxxx.com ServerAlias xxxxx.com DocumentRoot /var/www/html SetEnvIfNoCase Referer "^http://www.xxxxx.com" local_ref=1 SetEnvIfNoCase Referer "^http://sign51.cn" local_ref=1 SetEnvIfNoCase Referer ".*\.xxxxx\.com" local_ref=1 
 
  
    Order Allow,Deny Allow from env=local_ref 
   

 


其中xxxxx.com改为你本身的域名(喂,你当观众是猪呀?没力法,真的有时候就有是猪呢!)

保存后,service httpd restart搞掂收工!

本人原创文章,欢迎转载,转载请注明出处! css



已有 0 人发表留言,猛击->>这里<<-参与讨论


JavaEye推荐
相关文章
相关标签/搜索