I have a server which hosts multiple domains. A couple of days ago I had to re-install apache, and after that typing the IP address in the browser returns a 404 error. I still can access all the sites hosted correctly through the domain names.
For example, say the domain name myserver.com pointed to /var/www. When I type http://myserver.com I get the page hosted in /var/www, but the IP address returns 404. I cannot access http:///index.html or anything like that.
I'm practically a n00b when it comes to situations like these. I'd checked apache's configuration files but couldn't understand what has gone wrong.
Sorry if my question is unclear, please do tell me if I've to add anymore info on this.
Thanks
Asked
Active
Viewed 984 times
1
![](../../users/profiles/41383.webp)
shyam
- 187
- 3
- 11
1 Answers
4
Most likely your Apache is using name-based virtual hosting and has no default virtual host defined in case host name is missing in http request. Or then the default virtual host has no content at all. Post your config.
![](../../users/profiles/49773.webp)
Janne Pikkarainen
- 31,454
- 4
- 56
- 78
-
Ok, I've found what the problem was. The default virtual host configuration was disabled. `a2ensite default` fixed the problem. Thanks for the comment. – shyam Sep 22 '11 at 07:35
-
Glad I was able to help! :) – Janne Pikkarainen Sep 22 '11 at 08:00