Mass Virtual Hosting 到底怎么实现啊?捆饶已久Web服务器教程
|
| 论文作者:佚名 论文来源:不详 论文发布时间:2006-6-18 22:59:26 论文发布人:chjchjchj |
减小字体
增大字体
摘要:Mass Virtual Hosting 到底怎么实现啊?捆饶已久 Mass Virtual Hosting Description: The <VirtualHost> feature of Apache is nice and works great when you just have a few dozens virtual hosts. But when you are an ISP and have hundreds of virtual hosts to provide this feature is not the best choice. Solution: To provide this feature we map the remote webpage or even the complete remote webarea to our namespace by the use of the Proxy Throughput feature (flag [P]): ## ## vhost.map ## www.vhost1.dom:80 /path/to/docroot/vhost1 www.vhost2.dom:80 /path/to/docroot/vhost2 : www.vhostN.dom:80 /path/to/docroot/vhostN ## ## httpd.conf ## : # use the canonical hostname on redirects, etc. UseCanonicalName on
: # add the virtual host in front of the CLF-format CustomLog /path/to/access_log "%{VHOST}e %h %l %u %t \"%r\" %>s %b" :
# enable the rewriting engine in the main server RewriteEngine on
# define two maps: one for fixing the URL and one which defines # the available virtual hosts with their corresponding # DocumentRoot. RewriteMap lowercase int:tolower RewriteMap vhost txt:/path/to/vhost.map
# Now do the actual virtual host mapping # via a huge and complicated single rule: # # 1. make sure we don't map for common locations RewriteCond %{REQUEST_URI} !^/commonurl1/.* RewriteCond %{REQUEST_URI} !^/commonurl2/.* : RewriteCond %{REQUEST_URI} !^/commonurlN/.* # # 2. make sure we have a Host header, because # currently our approach only supports # virtual hosting through this header RewriteCond %{HTTP_HOST} !^$ # # 3. lowercase the hostname RewriteCond ${lowercase:%{HTTP_HOST}|NONE} ^(.+)$ # # 4. lookup this hostname in vhost.map and # remember it only when it is a path # (and not "NONE" from above) RewriteCond ${vhost:%1} ^(/.*)$ # # 5. finally we can map the URL to its docroot location # and remember the virtual host for logging puposes RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}] :
按照上边做的,好象没有用,加不加都一样。 我用的是apache 1.3.17, 应该包含 rewrite模块了吧(重新启动httpd,不报错误,说明认识 rewriteengine等指令) 为什么 url rewrite 不起作用?
kelei 回复于:2003-05-04 23:41:27高手快点来啊
。。。。。。。。
kelei 回复于:2003-05-05 09:30:08鼎鼎顶
mb 回复于:2003-05-05 13:06:45去了httpd.conf下的virtualhost语句 用miss virtual hosts时,不要再用virtualhost了
kelei 回复于:2003-05-05 15:59:59两者有冲突,不能混用吗?
kelei 回复于:2003-05-05 16:00:19[quote:ccde805755="mb"]去了httpd.conf下的virtualhost语句 用miss virtual hosts时,不要再用virtualhost了[/quote:ccde805755]
两者有冲突,不能混用吗?
kelei 回复于:2003-05-05 19:17:51[quote:4c8e9d710a="mb"]去了httpd.conf下的virtualhost语句 用miss virtual hosts时,不要再用virtualhost了[/quote:4c8e9d710a]
我试着去掉 virtualhost, 可以网站都不能访问了啊, 应该怎么做啊?
kelei 回复于:2003-05-06 22:46:37顶
kelei 回复于:2003-05-09 09:30:56人气好差阿,高手们哪里去了?
HonestQiao 回复于:2003-05-09 09:52:35先说说你要达到什么样的效果
rewrite可以做得很的事情很多很多的
如果只是一般的子目录跳转
不必要virtualhost设置的
kelei 回复于:2003-05-09 18:16:36[quote:b89a2d32c4="HonestQiao"]先说说你要达到什么样的效果
rewrite可以做得很的事情很多很多的
如果只是一般的子目录跳转
不必要virtualhost设置的[/quote:b89a2d32c4]
就像上边所说的 mass virtualhost 想用rewrite实现virtualhost, 省的改httpd.conf 简化管理
kelei 回复于:2003-05-12 11:28:16Mass Virtual Hosting
真的没有人能帮我吗?
macleo 回复于:2003-05-12 12:56:28顶了再说!
mb 回复于:2003-05-12 14:28:25选确定你的apache的httpd.conf中是在编译中加入了rewrite_module支持,要是没有的话当然是不行了,你的vhost.map文件能被apache组用户有r权限吗?
mb 回复于:2003-05-12 14:29:38是的,不能同时用,你用了vhost.map还用virtualhost做什么,有方但的还用哪个老的做什么
kelei 回复于:2003-05-13 12:30:19[quote:af8866a4ef="mb"]选确定你的apache的httpd.conf中是在编译中加入了rewrite_module支持,要是没有的话当然是不行了,你的vhost.map文件能被apache组用户有r权限吗?[/quote:af8866a4ef]
我的httpd.conf 加入了rewrite_module支持,而且在.htaccess文件中设置过,也证实了是起作用的
我的vhost.map文件权限设置 777
我把 conf 文件中 virtual host 的所有条目都注释掉了,还是不行
请问,会有别的可能的原因吗?
我的apache 1.3.17
mb 回复于:2003-05-13 13:38:27apache 1.3.17是您编译时加入了rewrite了,有mod_rewrite.so吗,默认是没有的 vhost中的域名是谁为您解析的,要是能正常指向您服务器的ip的话,哪么您要是能确定rewrite_module以被加载 在不能访问时出现了什么提示(apache要是能解析说明您的web页路径不对)
kelei 回复于:2003-05-14 20:31:42[quote:06a25c13e4="mb"]apache 1.3.17是您编译时加入了rewrite了,有mod_rewrite.so吗,默认是没有的 vhost中的域名是谁为您解析的,要是能正常指向您服务器的ip的话,哪么您要是能确定rewrite_module以被加载 在不能访问时出现了什么提?.........[/quote:06a25c13e4] rewrite.so是静态模块,不需要静态的和apache编译到一起吧? 我的系统里有rewirte.so文件 httpd.conf文件中有 load module 和 addmodule 相关语句, 而且在 htaccess中设置 rewri
|
|
|
|
|
|
|
| ∷相关技术评论 |
(评论内容只代表网友观点,与本站立场无关!) [查看发表评论...] | |
|
|
| |
站内广告 |
| |
|
站内搜索 |
| |
栏目导航 |
| |
|
|
本月热门 |
| |
|
|
本日热门 |
| |
|
|
|