O Apache não está ligado à porta 80?

3

Estou tendo problemas com o Apache. Acabei de instalar o Centos e esperar para criar um servidor web próprio. Eu estou seguindo as instruções de " o servidor perfeito para centos 7.2 " e me deparei com esse erro na minha máquina

[root@server01 /]# sudo systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

[root@server01 /]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-11-02 14:04:03 PDT; 14s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 30113 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 30065 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 30065 (code=exited, status=1/FAILURE)

Nov 02 14:04:01 server01.tcforwarding.com systemd[1]: Starting The Apache HTTP Server...
Nov 02 14:04:02 server01.tcforwarding.com httpd[30065]: [Wed Nov 02 14:04:02.346089 2016] [alias:warn] [pid 30065] AH00671: The Scri...Alias.
Nov 02 14:04:02 server01.tcforwarding.com httpd[30065]: AH00548: NameVirtualHost has no effect and will be removed in the next relea...nf:356
Nov 02 14:04:02 server01.tcforwarding.com httpd: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Nov 02 14:04:02 server01.tcforwarding.com systemd: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 02 14:04:02 server01.tcforwarding.com kill: kill: cannot find process ""
Nov 02 14:04:03 server01.tcforwarding.com systemd httpd.service: control process exited, code=exited status=1
Nov 02 14:04:03 server01.tcforwarding.com systemd: Failed to start The Apache HTTP Server.
Nov 02 14:04:03 server01.tcforwarding.com systemd: Unit httpd.service entered failed state.
Nov 02 14:04:03 server01.tcforwarding.com systemd: httpd.service failed.

Esta é uma amostra do meu arquivo vhost

Alguémporfavorpodemeajudaradescobririsso?

executandosudonetstat-nap|grep:80retornos

[root@server01/]#sudonetstat-nap|grep:80tcp00192.168.0.22:56616104.16.13.8:80TIME_WAIT-tcp00192.168.0.22:43882151.101.193.69:80ESTABLISHED6833/firefoxtcp00192.168.0.22:37556151.101.129.69:80ESTABLISHED6833/firefoxtcp00192.168.0.22:37722151.101.65.69:80ESTABLISHED6833/firefoxtcp00192.168.0.22:47506151.101.1.69:80ESTABLISHED6833/firefoxtcp00192.168.0.22:5572254.225.161.140:80ESTABLISHED6833/firefoxtcp00192.168.0.22:40710107.14.33.34:80ESTABLISHED6833/firefoxtcp00192.168.0.22:43884151.101.193.69:80ESTABLISHED6833/firefoxtcp00192.168.0.22:3937450.16.185.14:80ESTABLISHED6833/firefoxtcp00192.168.0.22:57408104.16.12.8:80ESTABLISHED6833/firefoxtcp6002605:e000:9290:cf:572602607:f8b0:4007:80c::443ESTABLISHED6833/firefoxtcp6002605:e000:9290:cf:422802607:f8b0:4007:801:::80ESTABLISHED6833/firefoxtcp6002605:e000:9290:cf:359942607:f8b0:4007:80c::443ESTABLISHED6833/firefoxtcp6002605:e000:9290:cf:422102607:f8b0:4007:80b:::80ESTABLISHED6833/firefox

agoraexecutandoomesmocomandodepoisdeencerrarofirefox

[root@server01/]#sudonetstat-nap|grep:80tcp00192.168.0.22:39514151.101.129.69:80TIME_WAIT-tcp00192.168.0.22:39516151.101.129.69:80TIME_WAIT-tcp00192.168.0.22:5704254.243.224.230:80TIME_WAIT-tcp00192.168.0.22:59396104.16.12.8:80TIME_WAIT-tcp00192.168.0.22:39734151.101.65.69:80TIME_WAIT-tcp00192.168.0.22:58596104.16.13.8:80TIME_WAIT-tcp00192.168.0.22:39510151.101.129.69:80TIME_WAIT-tcp00192.168.0.22:3712496.6.122.178:80TIME_WAIT-tcp00192.168.0.22:39696151.101.65.69:80TIME_WAIT-tcp00192.168.0.22:5771054.225.161.140:80TIME_WAIT-tcp00192.168.0.22:4779064.95.32.61:80TIME_WAIT-tcp6002605:e000:9290:cf:337222607:f8b0:4007:80b::443TIME_WAIT-tcp6002605:e000:9290:cf:535362607:f8b0:4007:801::443TIME_WAIT-tcp6002605:e000:9290:cf:581962607:f8b0:4007:806:::80TIME_WAIT-tcp6002605:e000:9290:cf:518762607:f8b0:4007:800::443TIME_WAIT-

agoraexecutandoestecomandonovamentesystemctlstatushttpd.serviceaindaencontroomesmoerro

[root@server01/]#systemctlstatushttpd.service●httpd.service-TheApacheHTTPServerLoaded:loaded(/usr/lib/systemd/system/httpd.service;enabled;vendorpreset:disabled)Active:failed(Result:exit-code)sinceWed2016-11-0220:34:28PDT;9sagoDocs:man:httpd(8)man:apachectl(8)Process:17357ExecStop=/bin/kill-WINCH${MAINPID}(code=exited,status=1/FAILURE)Process:17343ExecStart=/usr/sbin/httpd$OPTIONS-DFOREGROUND(code=exited,status=1/FAILURE)MainPID:17343(code=exited,status=1/FAILURE)Nov0220:34:27server01.tcforwarding.comsystemd[1]:StartingTheApacheHTTPServer...Nov0220:34:28server01.tcforwarding.comhttpd[17343]:[WedNov0220:34:28.2027202016][alias:warn][pid17343]AH00671:TheScr...Alias.Nov0220:34:28server01.tcforwarding.comhttpd[17343]:AH00548:NameVirtualHosthasnoeffectandwillberemovedinthenextrele...nf:356Nov0220:34:28server01.tcforwarding.comhttpd[17343]:(98)Addressalreadyinuse:AH00072:make_sock:couldnotbindtoaddress[::]:80Nov0220:34:28server01.tcforwarding.comsystemd[1]:httpd.service:mainprocessexited,code=exited,status=1/FAILURENov0220:34:28server01.tcforwarding.comkill[17357]:kill:cannotfindprocess""
Nov 02 20:34:28 server01.tcforwarding.com systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 02 20:34:28 server01.tcforwarding.com systemd[1]: Failed to start The Apache HTTP Server.
Nov 02 20:34:28 server01.tcforwarding.com systemd[1]: Unit httpd.service entered failed state.
Nov 02 20:34:28 server01.tcforwarding.com systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

O problema ainda está me impedindo de iniciar

Comando de execução nmap 192.168.0.1 retorna

Starting Nmap 6.40 ( http://nmap.org ) at 2016-11-06 15:52 PST
Nmap scan report for server01.tcforwarding.com (192.168.0.1)
Host is up (0.000016s latency).
Not shown: 992 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
25/tcp   open  smtp
53/tcp   open  domain
110/tcp  open  pop3
143/tcp  open  imap
993/tcp  open  imaps
995/tcp  open  pop3s
3306/tcp open  mysql

Nmap done: 1 IP address (1 host up) scanned in 0.15 seconds

Por que a porta 80 ou a porta 443 não aparecem?

    
por Bryan Lopez 02.11.2016 / 22:31

3 respostas

2

Você já está executando algo na porta 80. Este comando irá identificá-lo para você

sudo netstat -nap | grep ':80 .*LISTEN'
    
por 02.11.2016 / 22:39
0

Eu diria que use o nmap para ver quais serviços estão sendo executados e em qual porta. Um resultado nmap parece algo assim ...

$ nmap 192.168.50.25
...
PORT     STATE SERVICE
22/tcp   open  ssh
25/tcp   open  smtp
80/tcp   open  http   <~ make sure service is http
443/tcp  open  https

Se algo diferente de http estiver usando a porta 80, você poderá alterar a configuração do apache e apontá-la para uma porta diferente ou alterar o serviço que está usando a porta 80 para uma porta diferente. Aqui está um guia para instalar o nmap

    
por 04.11.2016 / 00:16
0

primeiro você deve usar o comando: %código% você deve nos informar qual serviço está rodando, se a porta 80 for usada por outro serviço, você deve eliminá-lo.

se dessa forma não conseguir lidar com o problema, você pode conferir a permissão do httpd.conf, você deve verificar se existe o comando: netstat -natup |grep 80

porque podemos saber o erro no seu syslog listen [::]:80

em algum momento este problema é seguido pelo ipv6, então você deve adicionar o comando em seu conf (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

então você pode reiniciar o serviço httpd

    
por 04.11.2016 / 03:47