I can not open ports in CentOS 7

0

I have a problem, since I can not open ports in CentOS 7 . I try to open port 80 with the following instruction:

--firewall-cmd --zone=trusted --add-port=80/tcp --permanent

With this you confirm that the port is open, I restart the command to apply conf .

--firewall-cmd --reload

I apply a nmap localhost 80 and this does not appear in the list, and consequently I can not raise the service http

    
asked by Jesua 11.08.2018 в 23:47
source

2 answers

0

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.

    
answered by 05.09.2018 в 01:38
0

The solution for this was to remove the httpd package and reinstall it, a classic.

removal: sudo yum remove httpd installation: sudo yum install httpd

    
answered by 02.10.2018 в 23:07