"Warning: DocumentRoot [/ var / www / vhosts] does not exist," although I created / var / www / vhosts?

I installed apache and configured my virtual host on my CentOS 6.4.

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

-> this is my virtual host 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 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 
+6
source share
2 answers

I think you are probably working with SELinux enabled. This requires additional steps to ensure the availability of resources (which is good for security).

In these questions, there are recommendations for enabling your DocumentRoot:

If you do not want to work with SELinux, you can disable it by setting SELINUX=disabled in / etc / selinux / config. The following links may help if you want to know more.

+4
source

Try moving the vhosts folder inside the html folder and changing the SELinux security context by running

chcon -R --reference=/var/www/html /var/www/html/vhosts

0
source

Source: https://habr.com/ru/post/956131/


All Articles