O Apache não irá parar / iniciar graciosamente

2

CentOs 6 64bit executando o apache 2.2.15-29.el6.centos. Quando tento parar / iniciar ou reiniciar o httpd, recebo um erro que diz que falhou. Uma cauda do log de erros está abaixo. Também notei que um arquivo httpd.pid não é criado, mesmo que esteja configurado no arquivo conf principal.

Se eu definir o selinux como permissivo, funcionará bem. Eu não quero executá-lo com o selinux desativado. Se eu excluir o arquivo SSL_Mutex, ele será iniciado.

O HTTPD estava funcionando bem até que tentei adicionar a configuração ssl. Copiei o arquivo ssl.conf de um servidor em funcionamento para a pasta conf.d. Eu também copiei uma pasta sslcert para a pasta conf. Ele contém o arquivo certs, key, csr e password. Acho que o problema tem a ver com o contexto do selinux para a pasta sslcert que foi copiada, mas não tenho certeza e não tenho certeza de como corrigi-la.

Abaixo está o contexto de segurança para a pasta sslcert depois de executar restorecon -R sslcert
ls -Z

-rw-r--r--. root root system_u:object_r:httpd_config_t:s0 httpd.conf
-rw-r--r--. root root system_u:object_r:httpd_config_t:s0 magic
**drwxr-xr-x. root root system_u:object_r:httpd_config_t:s0 sslcert**

tail -f /var/log/httpd/error_log

[Thu Oct 17 13:33:19 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Oct 17 13:33:20 2013] [notice] Digest: generating secret for digest authentication ...
[Thu Oct 17 13:33:20 2013] [notice] Digest: done
[Thu Oct 17 13:33:20 2013] [warn] pid file /etc/httpd/logs/ssl.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Oct 17 13:33:20 2013] [notice] Apache/2.2.15 (Unix) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips configured -- resuming normal operations
[Thu Oct 17 21:04:48 2013] [notice] caught SIGTERM, shutting down
[Thu Oct 17 21:06:42 2013] [notice] **SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0**
[Thu Oct 17 21:06:42 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Oct 17 21:06:42 2013] [error] (17)File exists: Cannot create SSLMutex with file '/etc/httpd/logs/ssl_mutex'

Também vi menções a possíveis problemas com semáforos. Abaixo está a saída dos semáforos atuais e o apache não está atualmente em execução.

ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x00000000 0          root       600        1
0x00000000 65537      root       600        1

Finalmente, o selinux relata o seguinte erro.

'sealert -a /var/log/audit/audit.log'  
0% donetype=AVC msg=audit(1382034755.118:420400): avc:  denied  { write } for  pid=3393 comm="httpd" name="ssl_mutex" dev=dm-0 ino=9513484 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_log_t:s0 tclass=file

**** Invalid AVC allowed in current policy ***

100% doneERROR: failed to read complete file, 1044649 bytes read out of total 1043317 bytes (/var/log/audit/audit.log)
found 1 alerts in /var/log/audit/audit.log
--------------------------------------------------------------------------------

SELinux is preventing /usr/sbin/httpd from remove_name access on the directory ssl_mutex.
    
por ddjammin 18.10.2013 / 06:42

2 respostas

1

Um problema semelhante foi corrigido antes:

link

Verifique se a configuração do ssl mutex é a mesma que no ssl.conf padrão.

Espero que ajude.

    
por 18.10.2013 / 10:33
0

If I set selinux to permissive, it works just fine. I do not want to run it with selinux disabled. If I delete the SSL_Mutex file it will start.

adicione "rm -fv / caminho / para / apache / ssl_mutex_file" ao seu script de inicialização httpd?

[Thu Oct 17 21:06:42 2013] [error] (17)File exists: Cannot create SSLMutex with file '/etc/httpd/logs/ssl_mutex'

meio que hackish, mas deve funcionar. Eu geralmente desabilito o selinux em servidores não compartilhados.

    
por 18.10.2013 / 08:17