I've just set up a new apache 2 install and I'm adding my first virtualhost. I'm seeing some odd behaviour. The virtualhost seems to work, in that if I browse to a URL under the root of my virtualhost in a web browser I get what I expect to see, however if I just go to www.$myhost.com, I get the default apache "It works!" page, which is ironic, because that's exactly what's not happening. If I do www.$myhost.com/index.html, I get the correct page. My DirectoryIndex is set correctly for the virtualhost, and even if it wasn't, the default in mods-enabled is set up to use index.html before anything else. Why is it dropping through to the index.html in the root folder? Why does it pick up the right file when I specifically ask for it, but not when I allow the server to pick the index file? I've googled, but I can't seem to find anyone with the same problem I'm having.

Any help greatly appreciated.

link|improve this question
feedback

2 Answers

up vote 0 down vote accepted

Have you refreshed your browsers cache?

link|improve this answer
Marked as the right answer as I can only assume that's what happened. It's all working now, and I've changed nothing whatsoever. Thanks. Feel a complete n00b now, but at least it works! – user9417 Jun 14 '09 at 21:16
I used to look after a bunch of apache servers and I developed refresh-tourets after running around in circles trying to work out what was wrong only to find out my browser was playing silly buggers. :) – Neobyte Jun 17 '09 at 15:05
feedback

If you're accessing your virtualhost with any name different of what you specified in the virtualhost's ServerName, you might be accesing some other unintended virtualhost.

Please provide a copy of your apache config files and the output of apache2 -D DUMP_VHOSTS

link|improve this answer
I've just checked it this evening, and despite not having changed a single thing, it's suddenly working fine. I guess it must have been cached, though I'm not sure how, as I only tried to visit the site after putting the correct (current, working) config in place. Anyway, thanks for listening to me talk rubbish. I'm off to boil my head. – user9417 Jun 14 '09 at 21:15
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.