V
V
vldud2018-06-03 16:38:11
CentOS
vldud, 2018-06-03 16:38:11

How to open port 80 in Centos 7?

Good afternoon. I have centos 7 with firewalld. In order to open port 80, I used the following commands:

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

firewall-cmd --list-all outputs the following:
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources:
  services: ssh dhcpv6-client http https
  ports: 80/tcp 443/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

but viewing open ports through nmap -sT still shows that port 80 is closed:
Host is up (0.0037s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
22/tcp open  ssh

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

What am I missing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-06-03
@vldud

what does netstat show ?
maybe no one is listening to the port?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question