我正在尝试配置 WordPress 以与 Cherokee Web Server 配合使用。WordPress 中设置的多站点是yyy.com
并使用“子域”。因此,我有像这样的站点aaa.yyy.com
-bbb.yyy.com
到目前为止它们都运行良好。
但是,我有另一个完全不同的域名:abcde.com
。在 WordPress 中,设置的子域名是abcde.yyy.com
。当公共用户访问时abcde.com
,无法正确重定向到 WordPress 子域名abcde.yyy.com
。
如何设置 Cherokee 以正确将虚拟域重定向到 WordPress?这意味着,面向公众的域将是abcde.com
WordPress 希望看到的abcde.yyy.com
,以便正确返回特定网站的正确内容。
(我尝试过,它总是被重定向到这样的位置:“http://yyy.com/wp-signup.php?new=abcde.com“)
答案1
首先,设置您的 DNS 以正确指向子域和映射域。
然后,在切诺基……
Create a Source (under Sources)
Type: Remote Host
Nickname: Cherokee
Connection: [the ip and port which can reach Cherokee Web Server]
在 WordPress 中......(您需要先启用多站点)。
Create the WordPress Site
My Sites -> Sites -> (Add New)
add the site...
Then, go to -> My Sites -> Network Admin -> Sites -> (select site)
in Settings, change only these 2 fields:
Home: http://abcde.com
Fileupload Url: http://abcde.com
然后,回到切诺基……
Create a new Virtual Server and assign it to your sub-domain, eg. "abcde.yyy.com"
This is a PHP Virtual Server, so follow the instructions from Cherokee Help Manual,
and test it to make you can get WordPress running.
References:
http://www.cherokee-project.com/doc/cookbook_php.html
http://www.cherokee-project.com/doc/cookbook_wordpress.html
现在,您可以返回 WordPress...
Go to site... configure, etc.
(set permalinks properly, etc.)
最后,回到切诺基……
Create yet another another Virtual Server - this time a HTTP Reverse Proxy server for your mapped domain name
Nick: abcde.com
Document Root: path to WordPress directory
... in Basics
Directory Indexes - empty
... in Rule Management
remove all except Default
change Handler to HTTP Reverse Proxy,
Request -> URL Rewriting
Add RegEx: ^/(.*)$
Substition: http://abcde.yyy.com/$1
... click Add
Back-end Servers
Balancer -> Round Robin
Assign Information Sources
Application Server -> "Cherokee" (as an Information Sources)
最后,重启 Cherokee!就完成了!