Skip to main content Start of main content

How to install Named on Rocky Linux 10

Apache HTTP Server (commonly known as httpd) is one of the most widely used web servers in the world. Rocky Linux 10, as a RHEL-compatible enterprise distribution, provides Apache directly from its official repositories, making installation simple and reliable.

This guide walks you through installing, starting, and configuring Apache on Rocky Linux 10.

How to install Named on Rocky Linux 10

Apache HTTP Server (commonly known as httpd) is one of the most widely used web servers in the world. Rocky Linux 10, as a RHEL-compatible enterprise distribution, provides Apache directly from its official repositories, making installation simple and reliable.

This guide walks you through installing, starting, and configuring Apache on Rocky Linux 10.


1. Prerequisites

Before you begin, ensure the following:

  • You have sudo or root access
  • Your system is up to date
  • You have an active internet connection

Update your system:

$ sudo dnf update -y

2. Install Apache (httpd)

Apache is available in the default Rocky Linux repositories. Install it using the dnf package manager:

$ sudo dnf install httpd -y

After installation, Apache files are located in the following directories:

  • Binary: /usr/sbin/httpd
  • Configuration: /etc/httpd/
  • Web Root: /var/www/html/

3. Start and Enable Apache

Start the Apache service:

$ sudo systemctl start httpd

Enable Apache to start at boot:

$ sudo systemctl enable httpd

Verify the service status:

$ sudo systemctl status httpd

If Apache is running correctly, the status will show active (running).


4. Configure the Firewall

If firewalld is enabled, you must allow HTTP (and optionally HTTPS) traffic through the firewall.

Check firewall status:

$ sudo systemctl status firewalld

Allow HTTP traffic:

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

Optional: Allow HTTPS traffic:

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

Reload firewall rules:

$ sudo firewall-cmd --reload

5. Test Apache Installation

Open a web browser and navigate to your server's IP address:

http://your_server_ip

Or test locally from the server:

curl http://localhost

You should see the default Rocky Linux Apache Test Page.


6. Apache Configuration Overview

The main Apache configuration file is:

/etc/httpd/conf/httpd.conf

Additional configuration directories:

/etc/httpd/conf.d/
/etc/httpd/conf.modules.d/

After making changes, reload or restart Apache:

$ sudo systemctl reload httpd

Or:

$ sudo systemctl restart httpd

7. Set Permissions for Web Content

By default, Apache serves content from:

/var/www/html

Create a test HTML file:

$ sudo nano /var/www/html/index.html

Example content:

<html>
  <head>
    <title>Apache on Rocky Linux 10</title>
  </head>
  <body>
    <h1>Apache is working!</h1>
  </body>
</html>

Set correct ownership and permissions:

$ sudo chown -R apache:apache /var/www/html
sudo chmod -R 755 /var/www/html

8. SELinux Considerations

If SELinux is enforcing, ensure proper file contexts:

$ sudo restorecon -Rv /var/www/html

Check SELinux mode:

getenforce

9. Check Apache Version

Verify the installed Apache version:

httpd -v

Conclusion

Apache on Rocky Linux 10 is secure, stable, and easy to deploy. With just a few commands, you can have a fully functional web server ready for production or development use.

From here, you can configure Virtual Hosts, enable SSL/TLS, or integrate PHP and databases depending on your needs.

Download Absolute Linux

RELEASE DATE: Tuesday, April 23, 2024

For Intel and AMD x86_64 systems

Absolute Linux Live ISOiso4.3 GiB

No files available for this version.

We take security seriously

Once you have downloaded an image, be sure to verify it for both security and integrity.

By calculating the image’s checksum on your own computer and comparing it to the original checksum, you can verify the image has not been tampered with or corrupted. Images are also gpg signed with Fedora keys to demonstrate their integrity.

  • Click the verify button to download the checksum file for your downloaded image.

  • Import Linuxrpms's GPG key(s)

                    curl -O https://linuxrpms.com/linuxrpms-gpg.pub
                  

    You can verify the details of the GPG key(s) here.

  • Verify the checksum file is valid

                    gpgv --keyring ./linuxrpms-gpg.pub absolutelinux-*-CHECKSUM
                  
  • Verify the checksum matches

                    sha256sum -c absolutelinux-*-CHECKSUM
                  

If the output states that the file is valid, then it's ready to use!

By clicking on and downloading Rocky Linux, you agree to comply with the US Export Control Policy.

Linuxrpms Logo