-2

I am configuring a web server on a remote virtual machine running Centos 7. I can access the machine via ssh, but once I installed and configured Apache for a simple test, I cannot access the remote web page.

I tried to ping the remote IP from my local machine (ubuntu). I got this message and nothing more happened:

PING <remote ip> (<remote ip>) 56(84) bytes of data.

If I remotely shut down the VM, I get

From <remote ip> icmp_seq=138 Destination Host Unreachable

When I stop the ping task, I get

3 packets transmitted, 0 received, 100% packet loss, time 2031ms

My iptables rules are the following:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
   45  3148 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:80
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Disabling SELinux does not work. What could be the problem?

UPDATE: I tried the following

  • firewall-cmd --add-service=http --zone=public --permanent

  • $ nmap -Pn -PS80 <remote ip> gives the following (however apache is not reachable)

    Starting Nmap 7.60 ( https://nmap.org ) at 2018-01-27 19:18 CET

    Nmap scan report for ip-

    Host is up (0.058s latency).

    Not shown: 999 filtered ports

    PORT STATE SERVICE

    22/tcp open ssh

closed as unclear what you're asking by Rui F Ribeiro, Michael Homer, cas, mdpc, maulinglawns Jan 29 '18 at 18:58

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    Is there a firewall running? – Thomas Jan 27 '18 at 14:16
  • 2
    Why would you expect disabling SELinux to make this work? – mattdm Jan 27 '18 at 14:23
  • Crystal ball error 0007 – Rui F Ribeiro Jan 27 '18 at 15:27
  • Instead of just downvoting the question, you could suggest a way to improve it... – firion Jan 27 '18 at 17:28
1

On a Centos 7 in a default configuration, after installing a new network service you must also configure the software firewall to allow it, or else it won't be reachable.

To allow HTTP immediately:

# firewall-cmd --add-service=http --zone=public

To make the setting permanent:

# firewall-cmd --add-service=http --zone=public --permanent

To make the settings both immediately effective and persistent over reboots, you must use the firewall-cmd command twice: once without the --permanent option and once with it.

Is that iptables output from your Ubuntu or from the Centos VM? The byte and package counts on TCP port 80 are still zeroes, indicating that no incoming HTTP connection attempts have even reached that system. If that was from Centos, that and your nmap output together confirm that there is definitely something between those two systems blocking the HTTP connection.

  • I did it but this did not fix the problem – firion Jan 27 '18 at 17:29
  • Edited my answer in light of your update. – telcoM Jan 27 '18 at 19:40
  • what other checks can I make? – firion Jan 28 '18 at 10:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.