from external host, i cant access to my apache web server that running on vmware [centos 7 64bit]

13,860

Based on the netstat output above, Apache isn't listening on an IPv4 address, but only the IPv6 ones.

There's directions here on how to setup Apache to listen on both IPv4 and IPv6.

It might be as simple as adding a Listen 80 directive to httpd.conf and restarting httpd.

Share:
13,860

Related videos on Youtube

guguwork
Author by

guguwork

Updated on September 18, 2022

Comments

  • guguwork
    guguwork over 1 year

    after i switched off iptables and firewalls, it doesn't work

    root ~ # service iptables status

    Redirecting to /bin/systemctl status iptables.service

    iptables.service - IPv4 firewall with iptables

    Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)

    Active: inactive (dead)


    service firewalld status

    Redirecting to /bin/systemctl status firewalld.service

    firewalld.service - firewalld - dynamic firewall daemon

    Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)

    Active: inactive (dead)


    apache seems to receive syn packet from external host(windows 7 64bit) but i cant access(it works fine on local)

    tcpdump -i ens33 -n src host 58.123.21.250 and port 80

    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode

    listening on ens33, link-type EN10MB (Ethernet), capture size 65535 bytes

    21:47:25.112649 IP 58.123.21.250.51270 > 58.123.170.183.http: Flags [S], seq 3082818409, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0

    21:47:28.112473 IP 58.123.21.250.51270 > 58.123.170.183.http: Flags [S], seq 3082818409, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0

    21:47:34.124897 IP 58.123.21.250.51270 > 58.123.170.183.http: Flags [S], seq 3082818409, win 8192, options [mss 1460,nop,nop,sackOK], length 0

    21:47:43.580902 IP 58.123.21.250.51267 > 190.93.247.183.http: Flags [P.], seq 26863706:26864354, ack 3431357454, win 16324, length 648

    21:47:43.811453 IP 58.123.21.250.51267 > 190.93.247.183.http: Flags [.], ack 405, win 16223, length 0 ^C

    5 packets captured

    11 packets received by filter

    0 packets dropped by kernel

    how can i solve this problem? please help me thanks.

    -------------------------- here's my output of netstat -lnp and iptables -L

    root ~ # netstat -lnp

    Active Internet connections (only servers)

    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2409/master

    tcp 0 0 0.0.0.0:41792 0.0.0.0:* LISTEN 1874/rpc.statd

    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1845/rpcbind

    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1496/sshd

    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3044/cupsd

    tcp6 0 0 ::1:25 :::* LISTEN 2409/master

    tcp6 0 0 :::49065 :::* LISTEN 1874/rpc.statd

    tcp6 0 0 :::111 :::* LISTEN 1845/rpcbind

    tcp6 0 0 :::80 :::* LISTEN 1399/httpd

    tcp6 0 0 :::22 :::* LISTEN 1496/sshd

    tcp6 0 0 ::1:631 :::* LISTEN 3044/cupsd

    udp 2176 0 0.0.0.0:68 0.0.0.0:* 2331/dhclient

    udp 0 0 0.0.0.0:50255 0.0.0.0:* 2331/dhclient

    udp 0 0 0.0.0.0:111 0.0.0.0:* 1845/rpcbind

    udp 0 0 0.0.0.0:123 0.0.0.0:* 735/chronyd

    udp 0 0 0.0.0.0:48774 0.0.0.0:* 709/avahi-daemon: r

    udp 0 0 0.0.0.0:53928 0.0.0.0:* 1874/rpc.statd

    udp 0 0 0.0.0.0:723 0.0.0.0:* 1845/rpcbind

    udp 0 0 0.0.0.0:5353 0.0.0.0:* 709/avahi-daemon: r

    udp 0 0 127.0.0.1:778 0.0.0.0:* 1874/rpc.statd

    udp 0 0 127.0.0.1:323 0.0.0.0:* 735/chronyd

    udp6 0 0 :::46135 :::* 1874/rpc.statd

    udp6 0 0 :::111 :::* 1845/rpcbind

    udp6 0 0 :::4729 :::* 2331/dhclient

    udp6 0 0 :::123 :::* 735/chronyd

    udp6 0 0 :::723 :::* 1845/rpcbind

    udp6 0 0 ::1:323 :::* 735/chronyd

    raw6 0 0 :::58 :::* 7 905/NetworkManager


    root ~ # iptables -L

    Chain INPUT (policy ACCEPT)

    target prot opt source destination

    Chain FORWARD (policy ACCEPT)

    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)

    target prot opt source destination

    • GregL
      GregL about 9 years
      What's the output of netstat -lnp? What about iptables -L?
    • guguwork
      guguwork about 9 years
      i added the output of netstat -lnp and iptables -L please check up thanks.
    • guguwork
      guguwork about 9 years
      why this got -2 votes? please help me