Когда я пытаюсь запустить httpd:
[root@cameronaziz www]# service httpd start
Starting httpd: Syntax error on line 292 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]
Строка 292 моей конфигурации:
DocumentRoot "/var/www/html"
И перечисляем каталог www:
[root@cameronaziz www]# ll
total 16
drwxr-xr-x. 2 root root 4096 Feb 13 14:33 cgi-bin
drwxr-xr-x. 3 root root 4096 Jul 11 21:03 error
drwxrwxrwx. 9 root 6226 4096 Aug 2 14:02 html
drwxr-xr-x. 3 root root 4096 Jul 11 21:17 icons
и
[root@cameronaziz ~]# ls -laZ /var/www/html/
drwxrwxrwx. apache 6226 unconfined_u:object_r:admin_home_t:s0 .
drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 ..
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 authorize.php
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 CHANGELOG.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 COPYRIGHT.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 cron.php
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 .gitignore
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 .htaccess
drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 includes
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 index.php
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.mysql.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.pgsql.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 install.php
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.sqlite.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.txt
-rw-rw-r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 LICENSE.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 MAINTAINERS.txt
drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 misc
drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 modules
drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 profiles
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 README.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 robots.txt
drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 scripts
drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 sites
-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 test.php
drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 themes
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 update.php
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 UPGRADE.txt
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 web.config
-rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 xmlrpc.php
Что не так с моей конфигурацией, которая не позволяет запускать apache? Я использую CentOS.
drwxrwxrwx. apache 6226 unconfined_u:object_r:admin_home_t:s0 .
Ваш DocumentRoot был настроен на неправильный контекст безопасности (admin_home_t).
Выполните следующую команду и попробуйте еще раз:
# chcon -R -h -t httpd_sys_content_t /var/www/html/