项目

通用

个人资料

操作

Zope 和 Plone 配置

此配置示例用于代理到一个 Zope 实例,该实例在同一台服务器上提供两个 Plone 站点和一个 ITracker 站点。此示例假设在同一主机上只运行一个 Zope 服务器,并且所有站点都位于根文件夹中。如果您的站点位于其他文件夹中,您需要相应调整配置。例如

请查阅 Plone.org 上 Virtual Host Monster 的条目 http://plone.org/documentation/tutorial/plone-apache/vhm ,以获取关于如何排序 URL 重写的更详细解释。

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site1.example.com:80/the_folder_name/site1/VirtualHostRoot/$1" )

VS.

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site1.example.com:80/site1/VirtualHostRoot/$1" )

注意:我正在使用哈希平衡方法,因为只运行一个 Zope 服务器。如果您运行多个 Zope 服务器,可能需要更改此设置。请查阅代理模块文档以获取更多信息。

# Proxy to the first Plone site.

$HTTP["host"] == "site1.example.com" {

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site1.example.com:80/site1/VirtualHostRoot/$1" )

proxy.balance = "hash" 
proxy.server  = ( "/VirtualHostBase" =>
     (
       ( "host" => "127.0.0.1", "port" => 8080 ) ) )
}

# Proxy to the second Plone site.

$HTTP["host"] == "site2.example.com" {

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/site2.example.com:80/site2/VirtualHostRoot/$1" )

proxy.balance = "hash" 
proxy.server  = ( "/VirtualHostBase" =>
     (
       ( "host" => "127.0.0.1", "port" => 8080 ) ) )
}

# Proxy to an ITracker instance.

$HTTP["host"] == "sitebugs.example.com" {

url.rewrite-once = ( "^/(.*)$" =>
"/VirtualHostBase/http/sitebugs.example.com:80/VirtualHostRoot/sitebugs/$1" )

proxy.balance = "hash" 
proxy.server  = ( "/VirtualHostBase" =>
     (
       ( "host" => "127.0.0.1", "port" => 8080 ) ) )
}

gstrauss3 年多前更新 · 7 次修订