apache/IIS做301转向

分类:Apache301 redirect: 301代表永久性转移(Permanently Moved),301重定向是网页更改地址后对搜索引擎友好(SEO)的最好方法,只要不是暂时搬移的情况,都建议使用301来做转址。

现在知道的有2类,一类是在web服务软件上做(apache,IIS),还有就是在程序里面做(jsp,php,asp,ruby,perl)
继续阅读 »

Apache的Mod_rewrite 例子

分类:Apache防止GetRight和Curl来抓取网內的数据的代码

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^curl [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight
RewriteRule ^.* – [F]
继续阅读 »

关于mod_jk的一些命令

分类:Tomcat/Resin分类:Apache定义workers
JkWorkersFile 指定mod_jk的workers定义.

JkWorkersFile /etc/httpd/conf/workers.properties

Logging
JkLogFile指定mod_jk放log文件的位置.

JkLogFile /var/log/httpd/mod_jk.log
继续阅读 »

2008-10-01Apache

没有评论
46

用apache屏敝搜索引擎

分类:ApacheGoogle, Yahoo 的搜寻引擎之所以可以搜寻到很多资料,是因為他们时时刻刻都派著 “robot” 在网路上巡逻,Google 的叫 googlebot, MSN 叫 msnbot, Yahoo! 叫 Yahoo Slurp 等等,任务就是捉新的网页或更新的网页回去资料中心. 為了隐私之类的原因,国际组织订有规则,规范 robot 的行為 — 基本上是 robot 要先参考网站根目录的一个 robots.txt 的档案,内容写著 robot 的名称及禁止捉取的目录或档案,例如:

User-agent: abc
Disallow: /not_for_abc/
User-agent: *
Disallow: /secret/

继续阅读 »

httpd与僵尸进程

分类:Apache在用top命令的时候,出现这个

3021  daemon    9   0     0    0     0 Z    10.4  0.0   0:01 httpd
3046  daemon    9   0     0    0     0 Z     9.7   0.0   0:01 httpd

这大概就是传说中的“僵尸进程”,僵尸进程表现为一般指连接数过多,造成的部分进程死掉的现象,维持几秒钟后会自动消失
,网上这样定义的,“僵尸进程是指的父进程已经退出,而该进程dead之后没有进程接受,就成为僵尸进程.(zombie)进程. 继续阅读 »

Setting Up A High-Availability Load Balancer (With Failover and Session Support) With HAProxy/Heartbeat On Debian Etch

分类:Lvs/Ha分类:Debian/Ubuntu分类:ApacheThis article explains how to set up a two-node load balancer in an active/passive configuration with HAProxy and heartbeat on Debian Etch. The load balancer sits between the user and two (or more) backend Apache web servers that hold the same content. Not only does the load balancer distribute the requests to the two backend Apache servers, it also checks the health of the backend servers. If one of them is down, all requests will automatically be redirected to the remaining backend server. In addition to that, the two load balancer nodes monitor each other using heartbeat, and if the master fails, the slave becomes the master, which means the users will not notice any disruption of the service. HAProxy is session-aware, which means you can use it with any web application that makes use of sessions (such as forums, shopping carts, etc.). 继续阅读 »

查询并禁止apache中异常访问量的用户

分类:ApacheApache中的异常访问,通常指的是频繁、大量访问的用户,通过apache的log,结合linux下的几个命令,可以分析这些用户,并通过apache的配置文件来禁止他们访问。

首先,更改apache的log方式,不记录一些图像、css等文件,这样在log中每一行基本上都能对应一次访问,如果不去除图像等文件的记录,正常用户访问一个页面,同时也会下载页面上的图像、css等文件,会产生多条log记录,影响计数的结果。在apache的conf文件中增加如下配置: 继续阅读 »


返回顶部