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.
Before you begin, ensure the following:
Update your system:
$ sudo dnf update -y
Apache is available in the default Rocky Linux repositories. Install it using the dnf package manager:
dnf
$ sudo dnf install httpd -y
After installation, Apache files are located in the following directories:
/usr/sbin/httpd
/etc/httpd/
/var/www/html/
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).
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
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.
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
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
If SELinux is enforcing, ensure proper file contexts:
$ sudo restorecon -Rv /var/www/html
Check SELinux mode:
getenforce
Verify the installed Apache version:
httpd -v
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.
RELEASE DATE: Tuesday, April 23, 2024Tuesday, March 26, 2024
For Intel and AMD x86_64 systems
Absolute Linux BETALive ISOiso4.3 GiB
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.