From Fedora Project Wiki

No edit summary
No edit summary
Line 8: Line 8:
# Verify that the `httpd` service is running: `sudo systemctl status httpd`
# Verify that the `httpd` service is running: `sudo systemctl status httpd`
# Create a simple HTML file to serve:
# Create a simple HTML file to serve:
<code>echo "<html><body><h1>Hello, Fedora!</h1></body></html>" | sudo tee /var/www/html/index.html </code>
<code><nowiki>echo "<html><body><h1>Hello, Fedora!</h1></body></html>" | sudo tee /var/www/html/index.html</nowiki></code>
# Open a web browser and navigate to `http://localhost/` to see the served content.
# Open a web browser and navigate to `http://localhost/` to see the served content.
# Check the Apache configuration file for errors: `sudo apachectl configtest`
# Check the Apache configuration file for errors: `sudo apachectl configtest`

Revision as of 08:19, 29 August 2024

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

  1. Install the httpd package if it is not already installed: sudo dnf install httpd

How to test

  1. Start the httpd service: sudo systemctl start httpd
  2. Enable the httpd service to start on boot: sudo systemctl enable httpd
  3. Verify that the httpd service is running: sudo systemctl status httpd
  4. Create a simple HTML file to serve:

echo "<html><body><h1>Hello, Fedora!</h1></body></html>" | sudo tee /var/www/html/index.html

  1. Open a web browser and navigate to http://localhost/ to see the served content.
  2. Check the Apache configuration file for errors: sudo apachectl configtest
  3. Reload the httpd service to apply any configuration changes: sudo systemctl reload httpd

Expected Results

  1. The httpd package should install without errors.
  2. The httpd service should start without errors and be enabled to start on boot.
  3. The status command should indicate that httpd is active and running.
  4. Navigating to http://localhost/ should display "Hello, Fedora!" in the web browser.
  5. The apachectl configtest command should return "Syntax OK".
  6. The httpd service should reload without errors.

Optional

For additional testing:

  1. Configure a virtual host and verify it serves content correctly.
  2. Enable and test SSL support by generating a self-signed certificate.
  3. Test serving different types of files (e.g., images, scripts) and using different modules.