Apache的ReWrite的应用mod_rewrite模块使用(9)
来源:asp之家 发布时间:2010-04-04 18:44:00
最后的说明:这样有用吗?www0.foo.com似乎也会超载呀?答案是:没错,它的确会超载,但是它超载的仅仅是简单的代理吞吐请求!所有诸如SSI、CGI、ePerl等等的处理完全是由其他机器完成的,这个才是要点。
硬件/TCP循环
还有一个硬件解决方案。Cisco有一个叫LocalDirector的东西,实现了TCP/IP层的负载均衡,事实上,它是一个位于网站集群前端的电路级网关。如果你有足够资金而且的确需要高性能的解决方案,那么可以用这个。
反向代理
说明:
...
方案:
代码:
##
## apache-rproxy.conf -- Apache configuration for Reverse Proxy Usage
##
# server type
ServerType standalone
Listen 8000
MinSpareServers 16
StartServers 16
MaxSpareServers 16
MaxClients 16
MaxRequestsPerChild 100
# server operation parameters
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
Timeout 400
IdentityCheck off
HostnameLookups off
# paths to runtime files
PidFile /path/to/apache-rproxy.pid
LockFile /path/to/apache-rproxy.lock
ErrorLog /path/to/apache-rproxy.elog
CustomLog /path/to/apache-rproxy.dlog "%t %h -> %e URL: %U"
# unused paths
ServerRoot /tmp
DocumentRoot /tmp
CacheRoot /tmp
RewriteLog /dev/null
TransferLog /dev/null
TypesConfig /dev/null
AccessConfig /dev/null
ResourceConfig /dev/null
# speed up and secure processing
Options -FollowSymLinks -SymLinksIfOwnerMatch
AllowOverride None
# the status page for monitoring the reverse proxy
SetHandler server-status
# enable the URL rewriting engine
RewriteEngine on
RewriteLogLevel 0
# define a rewriting map with value-lists where
# mod_rewrite randomly chooses a particular value
RewriteMap server rnd:/path/to/apache-rproxy.conf-servers
# make sure the status page is handled locally
# and make sure no one uses our proxy except ourself
RewriteRule ^/apache-rproxy-status.* - [L]
RewriteRule ^(http|ftp)://.* - [F]
# now choose the possible servers for particular URL types
RewriteRule ^/(.*.(cgi|shtml))$ to://$/$1 [S=1]
RewriteRule ^/(.*)$ to://$/$1
# and delegate the generated URL by passing it
# through the proxy module
RewriteRule ^to://([^/]+)/(.*) http://$1/$2 [E=SERVER:$1,P,L]
# and make really sure all other stuff is forbidden
# when it should survive the above rules...
RewriteRule .* - [F]
# enable the Proxy module without caching
ProxyRequests on
NoCache *
# setup URL reverse mapping for redirect reponses
ProxyPassReverse / http://www1.foo.dom/
ProxyPassReverse / http://www2.foo.dom/
ProxyPassReverse / http://www3.foo.dom/
ProxyPassReverse / http://www4.foo.dom/
ProxyPassReverse / http://www5.foo.dom/
ProxyPassReverse / http://www6.foo.dom/
##
## apache-rproxy.conf-servers -- Apache/mod_rewrite selection table
##
# list of backend servers which serve static
# pages (HTML files and Images, etc.)
static www1.foo.dom|www2.foo.dom|www3.foo.dom|www4.foo.dom
# list of backend servers which serve dynamically
# generated page (CGI programs or mod_perl scripts)
dynamic www5.foo.dom|www6.foo.dom


猜你喜欢
- 0×00 测试环境centos6.5+apache2.2.15+php5.3.30×01 php的运行模式介绍php的运行模式分四种:1.
- 曾见某大师建议为给用户更好的内容体验,一个主题写个博客。我觉得这条得有前提,因为个人博客就应该服务于个人,总不能以破坏自己节奏的代价去迎合用
- 影响版本:DedeCms V 5.3程序介绍:DedeCms 基于PHP+MySQL的技术开发,支持Windows、Linux、Unix等多
- 本报记者 雷中辉 北京报道“我们还没有接到实施细则的通知,具体怎么办还不清楚。”7月22日,北京市工商行政管理局大厅,当记者询问电子商务网店
- Tar(Tape ARchive,磁带归档的缩写,LCTT 译注:最初设计用于将文件打包到磁带上,现在我们大都使用它来实现备份某个分区或者某
- VirtualBox安装CentOS后,再安装增强功能就可以共享文件夹、粘贴板以及鼠标无缝移动,主要步骤如下:1、yum -y update
- 打开:mode/o/m_user.php查找:m.bday,m.medals,修改为:m.bday,m.medals,m.userstatu
- 1、网关主机设置 服务器上有两块网卡,eth0使用*.*.*.*IP地址连接Internet,eth1连接LAN,则其/etc/n
- 熟悉Firefox的人应该都知道,当你在页面上单击鼠标中键的时候,就可以启动Firefox的Autoscroll功能,并且在页面上会出现一个
- 一个高中没毕业的草根创业者,从域名入手,做着被很多人看作是“投机”的生意,却在不经意间成为中国域名投资领域最成功的人,很多知名公司都从他手中
- JDK的下载与安装第一步:先在官网下载jdk官方下地址 http://www.oracle.com/technetwork/java/jav
- 相信这个问题近两天大家都遇到了吧,DZ官方说是js的冲突造成了,无从考究了,找到了一个解决方法:修改论坛目录下 includejscommo
- 前言Linux不像windows有那么显眼的回收站,不是简单的还原就可以了。linux删除文件还原可以分为两种情况,一种是删除以后在进程存在
- 一条逐渐被证明成熟、可靠的通信行业商业规律正浮现在大家的眼前:第一,给你的手机起个叫“×Phone&
- 博客评论投票是一个常见的功能,如果对某网友的评论比较认同,那么可以对其进行“支持”投票。如果感觉评论内容不好,不同意其观点,可以对其投“反对
- IP安全策略里的设置,可以根据实际情况,增加或删除端口.协议IP协议端口源地址目标地址描述方式ICMP -- -- -- ICMP阻止UDP
- 实现方法: 第一步:channelunit.func.php中添加如下函数 //参数说明:第1个参数是从信息表里读取出来的类别ID,第2个参
- 北京时间12月3日消息,据国外媒体报道,微软网络服务部门高级副总裁萨提娅·纳德拉今天表示,通过付费使出版商和新闻机构屏蔽Google搜索引擎
- Visual Firebug是一个编辑在线页面CSS样式的chrome插件。它的产生是为了让一些不会使用firebug的视觉、交互、运营等同
- 用wordpress有段时间了,总结了一点小经验,要想网站被多收录的话,确实需要下一番功夫,推广是必不可少的,但是从我们自身网站结构来说,也