问题描述
我有一个Apache服务器在我的机器上运行(端口80)
我有我的机器上运行一个Zope服务器(端口8080)
I have an Apache server running on my machine (port 80)I have a Zope server running on my machine (port 8080)
我希望所有用户,无论域(允许使用www.example.com现在)被推到Zope的情况下,无缝地
i want all users, irrespective of domain (lets use www.example.com for now) to be pushed to the zope instance, seamlessly
IE
如果我输入到我的浏览器
将显示的效果
BUT
我想要的网址仍然说
(子)域应无关,这将有2个或3个结构域指向同一服务器
(sub-)domain should be irrespective, as will have 2 or 3 domains pointing to the same server
我应该在看的mod_rewrite或mod_proxy的?
am i supposed to be looking at mod_rewrite or mod_proxy?
我有mod_rewrite的一半工作,L,但它的变化是什么浏览器?
I have the mod_rewrite half working,l but it changes what is in the browser?
目前正在
RewriteEngine on
RewriteRule ^($|/.*) http://localhost:8080/$1 [P]
但得到服务器500
but getting server 500
使用连接的http://本地主机/ mysite的
Connecting using "http://localhost/mysite"
推荐答案
Zope的支持您的方案外的开箱即用的一些特殊的重写,使用 VirtualHostMonster
标志在路径中。这可以确保Zope的(通过扩展,Plone的)产生的任何网址是否正确的代理请求为好。
Zope supports your scenario out-of-the-box with some special rewriting, using a VirtualHostMonster
flags in the path. This ensures that any URLs generated by Zope (and by extension, Plone) are correct for proxied requests as well.
您应该使用的两个的的mod_rewrite
和的mod_proxy
,他们将在工作演唱会。
You should use both mod_rewrite
and mod_proxy
, they'll be working in concert.
为使创建正确的重写URL更容易,有人建立了一个极好的。堵在你的具体的例子输出:
To make creating the right rewrite URLs easier, someone built an excellent RewriteRule Witch. Plugging in your specific example outputs:
RewriteRule ^/mysite($|/.*) \
http://127.0.0.1:8080/VirtualHostBase/\
http/%{SERVER_NAME}:80/mysite/VirtualHostRoot/_vh_mysite$1 [L,P]
因此,在 http://www.example.com/mysite
根深蒂固的任何URL,重写这些被从本地主机端口8080上运行的服务器提供服务,使得确保Zope的产生与同根的URL。
Thus, for any URLs rooted at http://www.example.com/mysite
, rewrite these to be served from the server running on localhost port 8080, making sure that Zope generates URLs with the same root.
查看详细的文档。
这篇关于阿帕奇重写或代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!