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.

Just a quick note: I'm pretty new with Apache and my local network may be a bit screwy. I may be completely off-base.

I recently setup an internal network Ruby application running on a virtual host in Apache2. The IP address will immediately try to resolve the "ServerName" attribute, which isn't a fully-qualified domain name.

Everytime I try to access the application by IP it automatically redirects to the invalid URL. Adding a DNS record for the invalid URL to forward back to this server poses another problem as I'm learning to hate Windows DNS Server.

Is it possible to access this virtualhost via the local IP address?

share|improve this question
add comment

1 Answer

Apache will not redirect without a directive telling it to do so; it will either answer with a domain that matches a ServerName, or will answer with the site on that port that loads first. If none of those are configured to redirect (probably not in your situation), then Apache won't do it.

More likely the ruby application itself has a DNS name configured that it's attached to, and is sending redirects to try to get clients to use that name.

But, if you can't find where the redirect is coming from, setting a static entry in your system's hosts file is an option for a workaround.

share|improve this answer
    
I added a record to the host file for the URL the application is configured to use: 127.0.0.1 FOO.BAR While a ping test will resolve 127.0.0.1, a computer on my network still redirects to the wrong URL. I will continue to look for the source of the redirection in the application. –  robusto Mar 25 '11 at 19:33
    
@robusto If you configure a hosts entry for the URL that it's redirecting to, does it work? –  Shane Madden Mar 25 '11 at 19:54
    
A hosts entry on my local machine redirects to the application no problem. –  robusto Mar 25 '11 at 20:25
add comment

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.