Autor Tópico: Erro ao inicar apache2  (Lida 19289 vezes)

Offline pentestbox

  • Usuário Ubuntu
  • *
  • Mensagens: 264
    • Ver perfil
Erro ao inicar apache2
« Online: 04 de Maio de 2015, 13:34 »
Ola pessoal, estou tentando iniciar o serviço do apache com o comando:

$ sudo service apache2 start

so que está aparecendo a seguinte mensagem:

Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details.

com isso eu não consigo iniciar o serviço do apache, estou usando lubuntu 15.04 e nunca tive problemas em utilizar esse comando, gostaria da ajuda de vcs pra solucionar o problema
desde ja agradeço.

Offline irtigor

  • Equipe Ubuntu
  • Usuário Ubuntu
  • *****
  • Mensagens: 4.344
  • Delete, delete, delete!
    • Ver perfil
Re: Erro ao inicar apache2
« Resposta #1 Online: 04 de Maio de 2015, 14:45 »
O Ubuntu 15.04 adotou o systemd... de qualquer forma, rodou os comandos sugeridos?

Offline Rockwave

  • Usuário Ubuntu
  • *
  • Mensagens: 223
    • Ver perfil
Re: Erro ao inicar apache2
« Resposta #2 Online: 04 de Maio de 2015, 14:47 »
Só essa mensagem não nos dá muita informação, rode os comandos que apareceram na mensagem "systemctl status apache2.service" e "journalctl -xe", além do log do apache que deve estar no diretorio /var/log/apache2. Além disso no ubuntu 15.04 é usado o systemd então o mais "correto" para iniciar o apache seria o comando
Código: [Selecionar]
systemctl start apache2, de uma olhada nesse link https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet para aprender mais sobre os comandos do systemd

Offline pentestbox

  • Usuário Ubuntu
  • *
  • Mensagens: 264
    • Ver perfil
Re: Erro ao inicar apache2
« Resposta #3 Online: 04 de Maio de 2015, 16:02 »
fiz o comando $sudo systemctl start apache2 e o problema continua, aparece a mesma mensagem de erro incial

tambem usei o comando abaixo pra ver o status

sudo /etc/init.d/apache2 status

e a saida do comando foi:

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: failed (Result: exit-code) since Seg 2015-05-04 15:24:16 BRT; 7s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 20013 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Mai 04 15:24:16 teste-PC apache2[20013]: Output of config test was:
Mai 04 15:24:16 teste-PC apache2[20013]: AH00558: apache2: Could not reliabl...e
Mai 04 15:24:16 teste-PC apache2[20013]: (2)No such file or directory: AH022...3
Mai 04 15:24:16 teste-PC apache2[20013]: AH00014: Configuration check failed
Mai 04 15:24:16 teste-PC apache2[20013]: Action 'configtest' failed.
Mai 04 15:24:16 teste-PC apache2[20013]: The Apache error log may have more ....
Mai 04 15:24:16 teste-PC systemd[1]: apache2.service: control process exite...=1
Mai 04 15:24:16 teste-PC systemd[1]: Failed to start LSB: Apache2 web server.
Mai 04 15:24:16 teste-PC systemd[1]: Unit apache2.service entered failed state.
Mai 04 15:24:16 teste-PC systemd[1]: apache2.service failed.
Hint: Some lines were ellipsized, use -l to show in full.


abaixo a mensagem do arquivo /var/log/syslog:


May  4 15:26:05 teste-PC systemd[1]: Failed to start LSB: Apache2 web server.
May  4 15:26:05 teste-PC systemd[1]: Unit apache2.service entered failed state.
May  4 15:26:05 teste-PC systemd[1]: apache2.service failed.
May  4 15:26:04 teste-PC systemd[1]: Starting LSB: Apache2 web server...
May  4 15:26:04 teste-PC apache2[20171]: * Starting web server apache2
May  4 15:26:05 teste-PC apache2[20171]: *
May  4 15:26:05 teste-PC apache2[20171]: * The apache2 configtest failed.
May  4 15:26:05 teste-PC apache2[20171]: Output of config test was:
May  4 15:26:05 teste-PC apache2[20171]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
May  4 15:26:05 teste-PC apache2[20171]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for error log of vhost defined at /etc/apache2/apache2.conf:223
May  4 15:26:05 teste-PC apache2[20171]: AH00014: Configuration check failed
May  4 15:26:05 teste-PC apache2[20171]: Action 'configtest' failed.
May  4 15:26:05 teste-PC apache2[20171]: The Apache error log may have more information.
May  4 15:26:05 teste-PC systemd[1]: apache2.service: control process exited, code=exited status=1
May  4 15:26:05 teste-PC systemd[1]: Failed to start LSB: Apache2 web server.
May  4 15:26:05 teste-PC systemd[1]: Unit apache2.service entered failed state.
May  4 15:26:05 teste-PC systemd[1]: apache2.service failed.


Offline Rockwave

  • Usuário Ubuntu
  • *
  • Mensagens: 223
    • Ver perfil
Re: Erro ao inicar apache2
« Resposta #4 Online: 04 de Maio de 2015, 16:06 »
Código: [Selecionar]
May  4 15:26:05 teste-PC apache2[20171]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for error log of vhost defined at /etc/apache2/apache2.conf:223
Eis o seu problema.

Rode um ls -l /etc/apache2/ e coloque o conteudo da linha 223 do arquivo /etc/apache2/apache2.conf .

Offline pentestbox

  • Usuário Ubuntu
  • *
  • Mensagens: 264
    • Ver perfil
Re: Erro ao inicar apache2
« Resposta #5 Online: 04 de Maio de 2015, 16:19 »
Código: [Selecionar]
May  4 15:26:05 teste-PC apache2[20171]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for error log of vhost defined at /etc/apache2/apache2.conf:223
Eis o seu problema.

Rode um ls -l /etc/apache2/ e coloque o conteudo da linha 223 do arquivo /etc/apache2/apache2.conf .

Mtu obrigado, resolvi o meu problema, vlw pela ajuda.

Offline Rockwave

  • Usuário Ubuntu
  • *
  • Mensagens: 223
    • Ver perfil
Re: Erro ao inicar apache2
« Resposta #6 Online: 04 de Maio de 2015, 16:21 »
Código: [Selecionar]
May  4 15:26:05 teste-PC apache2[20171]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for error log of vhost defined at /etc/apache2/apache2.conf:223
Eis o seu problema.

Rode um ls -l /etc/apache2/ e coloque o conteudo da linha 223 do arquivo /etc/apache2/apache2.conf .

Mtu obrigado, resolvi o meu problema, vlw pela ajuda.

Disponha.