Acabei de instalar o apache2 no Ubuntu (aws) usando o chef.
Apache2 no Ubuntu Server: 10.1.1.1
Cliente: 10.1.1.200
Eu também verifiquei que ambos tcp 22 (sshd) & amp; tcp 80 (apache2) está escutando
root@Ubuntu:/var/www# netstat -anp | egrep '22|80'
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1469/sshd
tcp6 0 0 :::80 :::* LISTEN 16950/apache2
tcp6 0 0 :::22 :::* LISTEN 1469/sshd
root@Ubuntu:/var/www#
Os processos também parecem bons
root@Ubuntu:/var/www# ps -ef | egrep 'apache2|sshd'
root 1469 1 0 Sep29 ? 00:00:00 /usr/sbin/sshd -D
root 16950 1 0 Sep29 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 16953 16950 0 Sep29 ? 00:00:02 /usr/sbin/apache2 -k start
www-data 16954 16950 0 Sep29 ? 00:00:02 /usr/sbin/apache2 -k start
root@Ubuntu:/var/www#
Serviço também sendo executado normalmente
root@Ubuntu:/var/www# service apache2 status
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Fri 2017-09-29 23:36:49 UTC; 2h 13min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 55
Memory: 6.5M
CPU: 4.637s
CGroup: /system.slice/apache2.service
├─16950 /usr/sbin/apache2 -k start
├─16953 /usr/sbin/apache2 -k start
└─16954 /usr/sbin/apache2 -k start
Sep 29 23:36:47 Ubuntu systemd[1]: Starting LSB: Apache2 web server...
Sep 29 23:36:47 Ubuntu apache2[16933]: * Starting Apache httpd web server apache2
Sep 29 23:36:48 Ubuntu apache2[16933]: AH00557: apache2: apr_sockaddr_info_get() failed for Ubuntu
Sep 29 23:36:48 Ubuntu apache2[16933]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the '
Sep 29 23:36:49 Ubuntu apache2[16933]: *
Sep 29 23:36:49 Ubuntu systemd[1]: Started LSB: Apache2 web server.
root@Ubuntu:/var/www#
No entanto, quando tento acessar o servidor remotamente via http://10.1.1.1
, nada acontece. Eu não tenho esse problema com o ssh no mesmo servidor.
Eu também executei o tcpdump ao tentar acessar o servidor da Web a partir do controle remoto, mas não vi nada
Teste do cliente
[root@Client]# curl 10.1.1.1:80
curl: (7) Failed connect to 10.1.1.1:80; Connection timed out
[root@Client]#
Mas nada visto no servidor
root@Ubuntu:/var/www# tcpdump -nni eth0 port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
root@Ubuntu:/var/www#
No entanto, quando eu tento a mesma coisa com o ssh, consigo acessá-lo remotamente e trafego visto no tcpdump como esperado.
[root@Client]# curl 10.1.1.1:22
SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
curl: (56) Recv failure: Connection reset by peer
[root@Client]#
tcpdump no ssh
root@Ubuntu:/var/www# tcpdump -nni eth0 port 22 and host 10.1.1.200
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
02:03:04.320761 IP 10.1.1.200.35890 > 10.1.1.1.22: Flags [S], seq 1658944714, win 26883, options [mss 8961,sackOK,TS val 52461068 ecr 0,nop,wscale 7], length 0
02:03:04.320923 IP 10.1.1.1.22 > 10.1.1.200.35890: Flags [S.], seq 2270168630, ack 1658944715, win 26847, options [mss 8961,sackOK,TS val 13211819 ecr 52461068,nop,wscale 7], length 0
02:03:04.321264 IP 10.1.1.200.35890 > 10.1.1.1.22: Flags [.], ack 1, win 211, options [nop,nop,TS val 52461069 ecr 13211819], length 0
02:03:04.321287 IP 10.1.1.200.35890 > 10.1.1.1.22: Flags [P.], seq 1:80, ack 1, win 211, options [nop,nop,TS val 52461069 ecr 13211819], length 79
02:03:04.321293 IP 10.1.1.1.22 > 10.1.1.200.35890: Flags [.], ack 80, win 210, options [nop,nop,TS val 13211819 ecr 52461069], length 0
02:03:04.326160 IP 10.1.1.1.22 > 10.1.1.200.35890: Flags [P.], seq 1:42, ack 80, win 210, options [nop,nop,TS val 13211821 ecr 52461069], length 41
02:03:04.326683 IP 10.1.1.1.22 > 10.1.1.200.35890: Flags [R.], seq 42, ack 80, win 210, options [nop,nop,TS val 13211821 ecr 52461069], length 0
02:03:04.326899 IP 10.1.1.200.35890 > 10.1.1.1.22: Flags [.], ack 42, win 211, options [nop,nop,TS val 52461075 ecr 13211821], length 0
02:03:04.326911 IP 10.1.1.1.22 > 10.1.1.200.35890: Flags [R], seq 2270168672, win 0, length 0
^C
9 packets captured
9 packets received by filter
0 packets dropped by kernel
root@Ubuntu:/var/www#
Atualização: saída do iptables
Além disso, esta caixa está instalada no aws
root@Ubuntu:~# iptables -vL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
root@Ubuntu:~#