0

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!

13
  • 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. – Gustavo Siqueira 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
1

Check if you have the correct NameVirtualHost directive:

NameVirtualHost *:80
2
  • 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 – yrk Feb 7 '12 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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