From Fedora Project Wiki
Description
This test case ensures that the httpd
(Apache HTTP Server) is installed correctly, starts properly, serves content, and can be managed through systemd.
Setup
- Install the
httpd
package if it is not already installed:sudo dnf install httpd
How to test
- Start the
httpd
service:sudo systemctl start httpd
- Enable the
httpd
service to start on boot:sudo systemctl enable httpd
- Verify that the
httpd
service is running:sudo systemctl status httpd
- Create a simple HTML file to serve:
printf '<html><body><h1>Hello, Fedora!</h1></body></html>\n' | sudo tee /var/www/html/index.html
- Open a web browser and navigate to
http://localhost/
to see the served content. - Check the Apache configuration file for errors:
sudo apachectl configtest
- Reload the
httpd
service to apply any configuration changes:sudo systemctl reload httpd
Expected Results
- The
httpd
package should install without errors. - The
httpd
service should start without errors and be enabled to start on boot. - The status command should indicate that
httpd
is active and running. - Navigating to
http://localhost/
should display "Hello, Fedora!" in the web browser. - The
apachectl configtest
command should return "Syntax OK". - The
httpd
service should reload without errors.
Optional
For additional testing:
- Configure a virtual host and verify it serves content correctly.
- Enable and test SSL support by generating a self-signed certificate.
- Test serving different types of files (e.g., images, scripts) and using different modules.