2

I have a working rails application that I want to be served through another domain name. So I modified the VirtualHost by adding it as a ServerAlias:

<VirtualHost *:80>
        DocumentRoot /home/my/app/public
        ServerName long_server_name.com
        ServerAlias short_name.com
        RewriteEngine On

        ProxyRequests Off
        ProxyPass / http://localhost:3000/
        ProxyPassReverse / http://localhost:3000/
        ProxyPreserveHost on   

         <Proxy *>
          Order deny,allow
          Allow from all
        </Proxy>
</VirtualHost> 

But, for some odd reason, when I go to short_name.com it gives me the Fedora test page.

I'm able to find documents under /public if i go to them directly (eg. short_name.com/somepage.html). But the requests are not being handled by Rails. Going to the root path should redirect to the login (by rails).

Any ideas? How can I debug what's going on?

(A possible unrelated caveat: 'short_name.com' is a URL that's being leased from someone else as they are the owner.)

1
  • Did you restart apache after adding ServerAlias? Seems like your requests are still getting caught by a default vhost. Aug 11, 2011 at 19:03

1 Answer 1

1

On the basis that you're almost certainly working on the same problem as last time, and don't appear to have worked on most of the issues involved there, I'll reiterate my previous advice:

It does look like they're proxying. You can verify this by hitting the site and looking at the source IP -- if it's yours, then they're not proxying, they're doing something really weird, otherwise the source IP should be that of their proxy box. I would imagine that their proxying is probably doing all sorts of unpleasant things to the setup -- if the Host header being sent by their proxy server isn't what you're expecting, for instance, then that'll naturally cause problems. I always log the provided vhost name in my "default vhost" logs for this very reason -- it shows me what people might be hitting me from.

When it comes to the setup, I'd strongly recommend getting them to change the DNS to point to your server directly. That you're "leasing" the domain is irrelevant; DNS can still be managed properly. The only time proxying makes sense is if they're only redirecting part of the site to you, and serving other content on the same domain locally.

3
  • I created a different question because there is new evidence (and I will likely delete the other one). I checked the IP on the request and it IS my IP. Given that I can actually reach the file at the DocRoot, I'm less inclined to think it's a (dns) proxy issue as opposed to an apache proxy issue. I can't obtain the domain name form them (I guess leasing is common so this should work).
    – freshfunk
    Aug 11, 2011 at 19:08
  • Also, the reason why I created a different question was that I left out the issue of them proxying since I took your advice and verified that my IP was showing up in the access logs. shrug
    – freshfunk
    Aug 11, 2011 at 19:11
  • It ended up being an issue due to the proxying. Blergh. Anyway, this ends up being a dupe of this (I described the issue in detail here) serverfault.com/questions/299921/…
    – freshfunk
    Aug 11, 2011 at 21:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .