Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
Olá, Flávio. Tudo bem?
Pode me dizer exatamente quais passos você executou até chegar nesse erro? As vezes a gente esquece de executar um comando ou outro quando estamos acompanhando a aula.
Fico aguardando.
Boa noite, Vitor. Não fiz nada demais. Só o apt-get install apache2.
Oi, Flavio.
Você fez os seguintes passos?
sudo apt-get install apache2
# mover o arquivo do projeto para o diretório do apache
sudo mv ~/Downloads/index.html /var/www/html/index.html
# iniciar o serviço
sudo service apache2 start
Se não funcionar, experimenta desinstalar o apache, reiniciar o computador e repetir o processo. Se o mesmo erro aparecer, executa os comandos que o erro indicou para a gente ter uma ideia do que pode ser.
FIco aguardando.
$ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2021-01-07 23:16:31 -03; 29s ago
Process: 21447 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAIL
jan 07 23:16:31 fcba-Lenovo apachectl[21447]: AH00558: apache2: Could not reliab
jan 07 23:16:31 fcba-Lenovo apachectl[21447]: (98)Address already in use: AH0007
jan 07 23:16:31 fcba-Lenovo apachectl[21447]: (98)Address already in use: AH0007
jan 07 23:16:31 fcba-Lenovo apachectl[21447]: no listening sockets available, sh
jan 07 23:16:31 fcba-Lenovo apachectl[21447]: AH00015: Unable to open logs
jan 07 23:16:31 fcba-Lenovo apachectl[21447]: Action 'start' failed.
jan 07 23:16:31 fcba-Lenovo apachectl[21447]: The Apache error log may have more
jan 07 23:16:31 fcba-Lenovo systemd[1]: apache2.service: Control process exited,
jan 07 23:16:31 fcba-Lenovo systemd[1]: apache2.service: Failed with result 'exi
jan 07 23:16:31 fcba-Lenovo systemd[1]: Failed to start The Apache HTTP Server.
lines 1-17/17 (END)
$ journalctl -xe
jan 07 23:16:35 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:16:45 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:16:55 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:17:01 fcba-Lenovo CRON[21461]: pam_unix(cron:session): session opened
jan 07 23:17:01 fcba-Lenovo CRON[21462]: (root) CMD ( cd / && run-parts --repo
jan 07 23:17:01 fcba-Lenovo CRON[21461]: pam_unix(cron:session): session closed
jan 07 23:17:05 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:17:15 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:17:21 fcba-Lenovo kernel: [UFW BLOCK] IN=wlp2s0 OUT= MAC=01:00:5e:00:0
jan 07 23:17:25 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:17:35 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:17:45 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:17:55 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:18:03 fcba-Lenovo kernel: [UFW BLOCK] IN=wlp2s0 OUT= MAC=5c:c9:d3:6f:6
jan 07 23:18:04 fcba-Lenovo kernel: [UFW BLOCK] IN=wlp2s0 OUT= MAC=5c:c9:d3:6f:6
jan 07 23:18:05 fcba-Lenovo kernel: [UFW BLOCK] IN=wlp2s0 OUT= MAC=5c:c9:d3:6f:6
jan 07 23:18:05 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:18:06 fcba-Lenovo kernel: [UFW BLOCK] IN=wlp2s0 OUT= MAC=5c:c9:d3:6f:6
jan 07 23:18:15 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:18:25 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:18:35 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:18:46 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
jan 07 23:18:55 fcba-Lenovo influxd[1627]: [httpd] 127.0.0.1 - - [07/Jan/2021:23
lines 1310-1332/1332 (END)
Olá, Flávio.
Pelo resultado do primeiro comando, aparentemente, o apache está tentando usar uma porta da sua máquina, mas ela já está em uso. Normalmente, ele usa a porta 80, mas não tive como ter certeza, pois o texto veio cortado.
Você pode executar o comando netstat -ltnp
para verificar quais portas estão sendo usadas e se a 80 está ocupada.