multiple domains and mod_proxy

Using a single web hosting account to host multiple sites

multiple domains and mod_proxy

Postby bshaurette » Thu Oct 09, 2008 3:14 pm

I'm doing some troubleshooting, and looking for general ideas as to what I should be looking for.

I've got several domains/vhosts, all hitting the same python app (on mod_python, apache 2.0.52). So, for example, the mapping should be something like this:

domain1.com => thisserver.com/page/view/domain1/
domain2.com => thisserver.com/page/view/domain2/

And so on ...

I've got rewrite rules that appear to be working:

Code: Select all
    RewriteEngine on
    RewriteLog /blahblahblah/logs/my_rewrite.log
    RewriteLogLevel 9

    RewriteCond %{HTTP_HOST} ^domain1\.com [NC]
    RewriteRule ^/$ http://thisserver.com/page/view/domain1/ [P]

    RewriteCond %{HTTP_HOST} ^domain2\.com [NC]
    RewriteRule ^/$ http://thisserver.com/page/view/domain2/ [P]


They work perfectly on a local testing environment (OS X, also mod_python/apache 2.0.52). The problem comes when I move to our dev environment. I can see the proxy request in the rewrite log:

Code: Select all
(4) RewriteCond: input='domain1.com' pattern='^domain1\.com' => matched
(2) rewrite / -> http://thisserver.com/page/view/domain1/
(2) forcing proxy-throughput with http://thisserver.com/page/view/domain1/
(1) go-ahead with proxy request proxy:http://thisserver.com/page/view/domain1/ [OK]

(4) RewriteCond: input='domain2.com' pattern='^domain2\.com' => matched
(2) rewrite / -> http://thisserver.com/page/view/domain2/
(2) forcing proxy-throughput with http://thisserver.com/page/view/domain2/
(1) go-ahead with proxy request proxy:http://thisserver.com/page/view/domain2/ [OK]


But instead of the page I'm expecting, I get a big ol' 404.

So clearly the problem is the environment, not the mod_rewrite. What other things should I be looking at? mod_proxy is loaded ... I'm just not sure what else to look for.
bshaurette
 
Posts: 1
Joined: Thu Oct 09, 2008 3:13 pm
Location: San Francisco, CA

Postby richardk » Fri Oct 10, 2008 12:27 pm

Can you proxy to a different site, like Google?
Is it a 404 error from "thisserver.com" or the server with the mod_rewrite?
If you replace P with R does it redirect correctly?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 22 guests

cron