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

I'm extremely new at unix/linux so please bear that in mind in your answer.

I am running an apache server on a Fedora box. I have a static IP and have set up port forwarding through my router/modem - I have opened up port 80, among others, to forward to my Fedora box.

If, from an outside connection, I type my static IP, I successfully get my index page. However, if I try to type my.static.ip/subdirectory this gets instantly replaced with 192.168.2.22/subdirectory (my LAN IP), which of course fails if I'm on an outside connection.

Why is this remapping happening? How can I set up my server such that this remapping doesn't occur when requesting sub-pages/sub-directories from an external connection (while still working correctly if I connect to my local ip from a local LAN connection)?

share|improve this question
    
I suspect you're actually trying to access 1.2.3.4/subdir (without trailing slash) and it redirects you to 192.168.1.1/subdir (with trailing slash). I had this once, but I don't remember how I fixed this, so currently, I can't answer it for you. But this bit of information is relevant for people asking your question. You might want to edit the above. –  Halfgaar May 5 '11 at 22:17

1 Answer 1

up vote 0 down vote accepted

You probably just need to adjust the UseCanonicalName and ServerName settings in your configuration. Either in your httpd.conf file, or in your virtual host definition file.

I believe you want to have

UseCanonicalName Off
share|improve this answer
    
Thanks, that did it! For others who are noobs like me, you'll find httpd.conf here /etc/httpd/conf/httpd.conf –  Tom Auger May 10 '11 at 19:50

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.