Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“Warning: DocumentRoot [/var/www/vhosts] does not exist” although I've created /var/www/vhosts?

I've installed apache and config my virtual host on my CentOS 6.4.

But when i restart apache ( using this command : sudo service httpd restart ) it's warning me that "Warning: DocumentRoot [/var/www/vhosts] does not exist". I've check the directory /var/www/vhosts, it already created and permission is 0777. What wrong i did? any help please...

-> this is my virtual hosts configuration.

DocumentRoot /var/www/vhosts
ServerName trien.cba
ServerAlias trien.cba
ErrorLog /var/log/httpd/trien.cba.error.log
CustomLog /var/log/httpd/trien.cba.access.log common
AllowOverride All
Order allow,deny
Allow from all
Options -Indexes

....

-> and this is the warning:

[root@test-cba ~]#sudo service httpd restart
Stopping httpd: [ OK ]
Starting httpd: Warning: DocumentRoot [/var/www/vhosts] does not exist
Warning: DocumentRoot [/var/www/vhosts] does not exist
like image 273
Tấn Triển Nguyễn Avatar asked Oct 17 '13 01:10

Tấn Triển Nguyễn


1 Answers

I think you are probably running with SELinux enabled. This requires additional steps to make resources accessible (which is good for security).

These questions have guidelines on how to enable your DocumentRoot:

  • https://serverfault.com/questions/293866/apache-says-documentroot-doesnt-exist-when-it-does
  • https://serverfault.com/questions/323511/selinux-on-rhel6-httpd-config-documentroot-path-does-exist-does-not-exist

If you don't want to work with SELinux, you can disable it by setting SELINUX=disabled in /etc/selinux/config. The following links might help if you want to learn more.

  • http://wiki.centos.org/HowTos/SELinux
  • http://fedoraproject.org/wiki/SELinux
like image 50
Zac Thompson Avatar answered Oct 06 '22 01:10

Zac Thompson