I installed the Apache. I created a directory with the name of my site:

/var/www/domain

and I configured the virtualhosts:

<VirtualHost *:80>
    ServerAdmin webmaster@domain.com
    DocumentRoot /var/www/domain
    ServerName www.domain.com
</VirtualHost>

When I access domain.com, the content appears not from the directory /var/www/domain, but from /var/www.

Why?


The problem was solved! Just add:

<directory /var/www/domain/htdocs>
    Options -Indexes
</directory>

Thank you all!

link|improve this question
From the looks of it you've set '/var/www/incoreside' as the document root, but uploaded the content of your website to '/var/www/domain'. Unless of course you've forgotten to replace incoreside with domain in your example? – dannymcc Feb 7 at 19:46
When I put the archives of my site in the paste '/var/www/domain'. The site no appears. – codelogical.py Feb 7 at 19:48
Have you restarted Apache after making changes to your virtual hosts file? – dannymcc Feb 7 at 19:48
Restart apache. – JoelESalas Feb 7 at 19:49
1  
One possibility is that the default VirtualHost block still exists (or some other conflicting VirtualHost). Use httpd -S to see how Apache parsed your configuration file. – cyberx86 Feb 7 at 20:43
show 8 more comments
feedback

1 Answer

Check if you have the correct NameVirtualHost directive:

NameVirtualHost *:80
link|improve this answer
Can you provide some details of what a "correct NameVirtualHost directive" may look like in the OP's config? – jscott Feb 7 at 20:37
NameVirtualHost *:80 – yarek Feb 7 at 20:45
feedback

Your Answer

 
or
required, but never shown

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