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
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.
I can guarantee that the problem isn't apache. You should be looking at whatever is producing your html content... ie. php, etc.