Jump to content

Can access website externally but not locally


danep

Recommended Posts

Sorry for the somewhat obscure title, I don't know how to describe this problem succinctly. Basically, I run a "live" and "development" version of my website on my server using name-based virtual hosts, so example.com has DocumentRoot /var/www/live while dev.example.com has DocumentRoot /var/www/dev. I can get to both websites fine from other machines. However, if I use Lynx or Curl on the server to try to get to example.com, I get the directory listing for /var/www instead. Does anybody know why that might be? Let me know if you would like me to post Apache config files. I appreciate the help, this has been driving me absolutely nuts.

Ah, I think I solved part of it... I was only editing httpd.conf to do virtual hosting. What I didn't realize was that there was a default configuration file loaded in sites-enabled that had a virtual host with DocumentRoot /var/www. I changed this default virtual host DocumentRoot to /var/www/live and the problem is solved. However, I still don't understand why the problem existed in the first place- i.e., why everything worked when browsing from another machine but not when using Lynx from the local machine.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.