Steps to Install and Configure Apache on CentOS Stream 10
Step 1 : Ensure your system packages are up to date. Run the following command:
Step 2 : Install the httpd
package, which is the Apache HTTP Server:
Step 3 : Allow HTTP and HTTPS traffic through the firewall:
Step 4 : Reload the firewall to apply the new rules:
Step 5 : Start Apache and enable it to automatically start on boot:
Step 6 : Verify that Apache is running:
Step 7 : Create a directory for the example.com
website and an index.html
file:
Step 8 : Create a Virtual Host Configuration for example.com
- Create a configuration file for the example.com
virtual host:
- Add the following content to the file:
- Save and close the file.
Step 9 : Check for syntax errors in the Apache configuration:
Step 10 : Restart Apache to apply the changes:
Step 11 : Visit http://example.com
in your web browser. You should see the message Welcome to example.com!
.
Congratulations! You have successfully installed and configured Apache on CentOS Stream 10. Your server is now ready to host websites.