Linux Tactic

How to Open Port 80 on Rocky Linux 9: Risks and Best Practices

Opening Port 80 on Rocky Linux 9: Configuring Your Firewall to Allow TCP Protocol for HTTP Service

The internet has radically transformed how we communicate, shop, and access information. It has revolutionized the way we conduct business, socialize, and learn.

One of the most essential components of the web is the Hypertext Transfer Protocol (HTTP) used to deliver web pages. HTTP operates through the Transmission Control Protocol (TCP) and utilizes Port 80 to transmit data between clients and servers.

In this article, we will discuss how to open Port 80 on Rocky Linux 9 to enable the HTTP service. We will also explore the security and privacy risks associated with this process.

Adding HTTP and HTTPS Services to Firewall

When a client sends an HTTP request to a server, it uses Port 80 by default. To allow this traffic through the firewall, you need to add HTTP and HTTPS services.

To do this, you can run the following commands:

sudo firewall-cmd –add-service=http –permanent

sudo firewall-cmd –add-service=https –permanent

These commands open up HTTP and HTTPS services permanently on your Rocky Linux 9 server. The ‘firewall-cmd’ is a tool that allows you to manage the firewall configuration on your system.

‘Add-service’ is used to add or remove predefined services from the firewall. The ‘–permanent’ flag ensures that the changes are saved and persist across reboots.

Reloading Firewall Services and Displaying Port Status

Once the HTTP and HTTPS services are added, you need to reload the firewall services for the changes to take effect with the following syntax.

sudo firewall-cmd –reload

To check whether the Port 80 is open or closed, you can use the netstat command. The netstat command displays network connections, routing tables, and network interface statistics.

Run this command to view the status of Port 80. sudo netstat -ntlp | grep 80

The output will show if Port 80 is listening or not.

If the port is not listening, you may have to troubleshoot your firewall settings.

Importance of Configuring Port 80 Correctly

Opening Port 80 can enable HTTP traffic, but it can also pose a security and privacy risk if not configured properly. Opening up a port for communication means inviting uninvited guests in.

You must ensure that the open port does not allow unauthorized access to your server. Security risks include exposing sensitive data, hosting malware, and allowing hackers to exploit vulnerabilities in your system.

An attacker can leverage an open Port 80 to launch Distributed Denial of Service (DDoS) attacks, which can take down websites or servers.

Risks of Opening Port 80

Opening Port 80 can also have privacy implications. If your server is not secured correctly and hackers gain access, they can access sensitive information.

This could include confidential data related to personal identification, banking or credit card information, or corporate secrets. An attacker could use it to modify data, plant malicious code, or steal sensitive data unwittingly from your system.

Commands to Remove Services and Close Port 80

You may have to remove the HTTP and HTTPS services and close Port 80 for various reasons, such as configurational changes or testing. You can do so by using the ‘remove-service’ command.

sudo firewall-cmd –remove-service=http –permanent

sudo firewall-cmd –remove-service=https –permanent

This command removes the HTTP and HTTPS services from the firewall configuration. To close Port 80, you can run the following command.

sudo firewall-cmd –remove-port=80/tcp –permanent

This command removes Port 80 from the firewall configuration. You can then use the ‘reload’ command to ensure that the changes take effect.


Setting up a firewall to allow network traffic can have a significant impact on your server’s performance, security, and privacy. In this article, we discussed how to open Port 80 on Rocky Linux 9 to allow HTTP traffic.

We covered how to add HTTP and HTTPS services to the firewall, reload firewall services, and display port status using the netstat command. However, we also emphasized the importance of configuring the open port correctly and mitigating the security and privacy risks.

Remember to follow best practices for cybersecurity, such as keeping your software up to date and applying the latest patches and updates. Finally, always monitor your server’s activity and employ various cybersecurity measures to ensure optimal performance.

In summary, opening and configuring Port 80 to allow HTTP traffic on Rocky Linux 9 can have significant benefits but also poses security and privacy risks. To open the port, add HTTP and HTTPS services to the firewall, reload the services, and check port status.

However, it is essential to configure the port correctly and mitigate security risks associated with unauthorized access, sensitive data exposure, and DDoS attacks. Therefore, ensure to follow best practices for cybersecurity, monitor your server’s activity and employ various cybersecurity measures.

Remember to close the port when no longer needed. The article’s main takeaway is that improper configuration of Port 80 can be costly, and it’s crucial to prioritize security and privacy for optimal performance.

Popular Posts