To install and configure Apache on CentOS Stream 9, follow these steps.
Step 1 : Ensure your system has the latest package information by running:
Step 2 : Install the Apache web server using the following command:
Step 3 : Adjust Firewall:
Step 4 : Reload the firewall to apply the changes:
Step 5 : Start the Apache service and enable it to start at boot:
Step 6 : Verify the status of the Apache service to ensure it is active:
Step 7 : Create Example Directory and Index
- Create a directory for your example website and add an index file:
Step 8 : Create Apache Configuration for Example.com
- Create a configuration file for your example.com site:
- Add the following configuration (replace example.com with your domain):
- Save the file and exit the text editor.
Step 9 : Test Configuration
Step 10 : If the test is successful, restart Apache to apply the changes:
Step 11 : Visit the Test Website
Open a web browser and navigate to your domain (e.g., http://example.com) to test your Apache setup.
Congratulations! You have successfully installed and configured Apache on CentOS Stream 9.