0

I've set up a new VirtualHost on Apache with this configuration:

DocumentRoot "/var/www/html" <VirtualHost *:80> ServerName mydomain.net DocumentRoot /var/www/html/mydomain.net </VirtualHost> 

When I access to mydomain.net I get the correct document root. But If I go to http://myIP it access to /var/www/html/mydomain.net instead of /var/www/html

Any idea how to fix this ?

Thanks!

1 Answer 1

1

You need to set up a default virtualhost to catch unspecified requests, otherwise the mydomain.net one will catch those.

Here's the Apache documentation on this topic:

http://httpd.apache.org/docs/2.2/vhosts/examples.html#default

2
  • 1
    Thansk cjc: Ive put this in my httpd.conf <VirtualHost default:*> DocumentRoot /var/www/html </VirtualHost> But now, It shows me the /var/www/html directory when I go to mydomain.net Commented Apr 18, 2012 at 9:38
  • Are you running NameVirtualHosts ? Commented Apr 18, 2012 at 9:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.