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 have an apache2 server that is behind a firewall. The external address is 24.89.xxx.xxx and the internal address is 10.10.58.1

The server's hostname is 'myhost'. I don't have a DNS entry for the 24.89.xxx.xxx address because it's not live yet. The domain name that will resolve to it is currently in use for the existing site.

I would like the web-dev team to be able to access the site via the 24.89.xxx.xxx address. However, whenever they view the site, all the URLs get the local hostname inserted into them.

So, <a href="index.php?id=9">Link</a> produces a URL of http://myhost/index.php?id=9 However, I would like it to produce a URL of http://24.89.xxx.xxx/index.php?id=9

Apache is installed on Debian Lenny. I'm using the "default" site. I've tried variations of setting the NamedVirtualHost to the IP, ServerName to the IP, UseCanonicalName off, VirualHost, etc... Everything I do produces no change whatsoever. Yes, I'm reloading the config each time.

I've also tried cutting out the firewall, and I get the same result. I've also made a bunch of changes to the /etc/hosts file.

/etc/hosts:

127.0.0.1       localhost
10.10.58.1      myhost
24.89.xxx.xxx   www.inusedomain.org
share|improve this question
1  
This is a programming question, not a sysadmin one. –  womble Dec 1 '09 at 21:03
2  
I beg to differ, considering I'm not doing any programming. –  Swoogan Dec 1 '09 at 21:08
1  
how is that ever a programming question? –  hop Dec 1 '09 at 22:28
    
It's a programming question because this is an issue with his content producing system, not apache. However, it could be easily mis-identified as a server issue. –  phoebus Dec 1 '09 at 22:42

2 Answers 2

up vote 2 down vote accepted

Reading more carefully, I think this might be a php issue. Generally, you need to set some sort of 'base URL' in the config for a website, so php knows how to create all of the links ("Over write the urls"). Look for a config.php, or something like that in the root dir of the website.

If you have bad developers, it might be not in a single variable, and all over the place. To find this, or maybe to find it in a single location, use grep -Ri --include='*.php*' 'localhost' *, changing localhost to whatever it is that is currently being overwritten.

Not a Complete Answer:
I am not entirely sure, but I think I remember that binding a virtual host to specific IP, or changing the listen directive requried a total restart, not just a graceful restart or a configuration reload.

share|improve this answer

I can guarantee that the problem isn't apache. You should be looking at whatever is producing your html content... ie. php, etc.

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.