Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|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 '12 at 19:46
    
When I put the archives of my site in the paste '/var/www/domain'. The site no appears. –  user2692786 Feb 7 '12 at 19:48
    
Have you restarted Apache after making changes to your virtual hosts file? –  dannymcc Feb 7 '12 at 19:48
    
Restart apache. –  Joel E Salas Feb 7 '12 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 '12 at 20:43
show 8 more comments

1 Answer

up vote 1 down vote accepted

Check if you have the correct NameVirtualHost directive:

NameVirtualHost *:80
share|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 '12 at 20:37
    
NameVirtualHost *:80 –  yarek Feb 7 '12 at 20:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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