Your port configuration is correct with the firewall-cmd
command, and for the nmap
command to show port 80 as open, you need to run an application that listens on that port, since nmap
only shows the status of ports that are open and listening.
I show you on a CentOS 7 server, the httpd (Apache) service is off, as you can see in the status, then I run the nmap localhost 80
command and you can see that port 80 does not appear in the list of ports open:
Then I turn on the service httpd
with the command sudo systemctl start httpd
, I'll show the status of the service with sudo systemctl status httpd
and it's already on, finally I run again nmap localhost 80
and you can see that the command already shows port 80 as active.
The use of nmap
shows the status of ports open and listening, that is the reason why port 80 does not show you as it does not have an application that listens in the port.
I hope you get the answer.