Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to configure WordPress to work with Cherokee Web Server. The multi-site set up in WordPress is yyy.com and uses 'sub-domains'. Thus, I have sites like aaa.yyy.com, bbb.yyy.com - they all work fine so far.

However, I have another completely different domain: abcde.com. Within WordPress, the sub-domain set up is abcde.yyy.com. When a public user accesses abcde.com, it cannot properly be redirected to the WordPress sub-domain abcde.yyy.com.

How do I set up Cherokee to properly redirect virtual domains to WordPress? That means, the domain facing public would be abcde.com but WordPress would want to see abcde.yyy.com to properly return the correct content for the specific site.

(I tried and it always get redirected to something like this: "http://yyy.com/wp-signup.php?new=abcde.com")

share|improve this question
    
I just found the proper term is "domain mapping". How do I properly map the domain "abcde.com" to "abcde.yyy.com"? –  ikevinjp Oct 24 '12 at 16:34
    
I have found the solution. (I will provide the answer within a few hours.) –  ikevinjp Oct 24 '12 at 18:16

1 Answer 1

up vote 0 down vote accepted

First, set up your DNS to point both the sub-domain and mapped domain properly.

Then, in Cherokee...

Create a Source (under Sources)
 Type: Remote Host
 Nickname: Cherokee
 Connection: [the ip and port which can reach Cherokee Web Server]

In WordPress.. (you need to enable multisite first).

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

Then, back in Cherokee...

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

Now, you can go back to WordPress...

Go to site... configure, etc.
(set permalinks properly, etc.)

Finally, back in Cherokee...

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)

Lastly, restart Cherokee! That's it!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.