Não consigo iniciar o apache, diz pasta html não diretório

1

Quando tento iniciar o 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]

Linha 292 da minha configuração:

DocumentRoot "/var/www/html"

E listando o diretório 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

e

[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

O que há de errado com minha configuração que não permitirá que o apache comece? Estou rodando o CentOS.

    
por Cameron Aziz 03.08.2012 / 06:16

1 resposta

3
drwxrwxrwx. apache 6226 unconfined_u:object_r:admin_home_t:s0 .

Seu DocumentRoot foi configurado para o contexto de segurança errado (admin_home_t).

Execute o seguinte comando e tente novamente:

# chcon -R -h -t httpd_sys_content_t /var/www/html/
    
por 03.08.2012 / 10:56