📝 Tutorial: How to Set Up NGINX Web Server on Rocky Linux 9

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Dear Guest, You are a regular member, and you cannot download files here. To be able to download all files here, you must become a “Lovely Member.” How to become a Lovely Member? Click this link: 💖 How to Become a “Lovely Member” on Our Forum Alternatively, you can upgrade your account to VIP using this link: Upgrade
  • Thread Author
1747672500154.webp


🧾 Introduction
Setting up a reliable web server is essential for hosting websites, applications, or community forums. NGINX, known for its high performance and low resource consumption, is one of the most popular web servers. In this tutorial, we'll walk through the process of installing and configuring NGINX on Rocky Linux 9, a community-driven enterprise OS compatible with RHEL. Whether you're hosting a personal site or building a high-traffic community like hrace009.com, this guide provides a solid foundation to get started with NGINX quickly and securely.

⚙️ NGINX Setup on Rocky Linux 9

🔹 Step 1: Update Your System​

Open a terminal and update your system packages:
Bash:
sudo dnf update -y

🔹 Step 2: Install NGINX​

Install NGINX using DNF, the default package manager:
Bash:
sudo dnf install nginx -y

🔹 Step 3: Enable and Start NGINX​

Enable NGINX to start on boot, then start the service:
Bash:
sudo systemctl enable nginx
sudo systemctl start nginx

🔹 Step 4: Adjust Firewall Rules​

Allow HTTP and HTTPS traffic through the firewall:
Bash:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

🔹 Step 5: Test NGINX​

Verify the installation by opening your browser and visiting your server's IP address. You should see the default NGINX welcome page:
NGINX:
http://your_server_ip/

🔹 Step 6: Configure Your Website​

Replace the default NGINX config with your own. Example:
Bash:
sudo nano /etc/nginx/conf.d/hrace009.conf
Sample minimal config:
NGINX:
server {
    listen 80;
    server_name yourdomain.com;

    root /var/www/hrace009;
    index index.html index.htm;

    location / {
        try_files $uri $uri/ =404;
    }
}
Create your site directory:
Bash:
sudo mkdir -p /var/www/hrace009
sudo nano /var/www/hrace009/index.html
Add basic HTML for testing:
HTML:
<h1>Welcome to hrace009.com!</h1>
Set permissions:
Bash:
sudo chown -R nginx:nginx /var/www/hrace009

🔹 Step 7: Restart NGINX​

After configuring your site, restart NGINX:
Bash:
sudo systemctl restart nginx

✅ Conclusion​

You now have a fully functional NGINX web server running on Rocky Linux 9. From here, you can add PHP, SSL, or deploy content management systems. For community platforms like hrace009.com, this setup is the first step toward building a strong and fast digital presence.
 
Back
Top