Configure an HTTP server
Redina is a RHEL Engineer at Google:
- Her RHEL Server: Redina_RHEL_Server_012
- Her username: redina.mesclina
- Her certifications: LFCS, RHCSA
- Her professional preference: NEVER execute commands as the root user
- Her task: Configure an HTTP server
Regina has just been promoted to the position of Director of GNU/Linux Training at Google. Her first assignment: get at least 98% of a new class of 74 LFCS-candidate hires to pass the LFCS exam on their first or second try. Redina needs to teach them all of the LFCS objectives. Today, she is going to focus on this objective: Configure an HTTP server.
Please generate and explain a list of commands that Redina can run on her RHEL server to adequately teach her 74 students how to configure an HTTP server at a professional level.
To adequately teach her 74 students how to configure an HTTP server at a professional level, Redina can use the following list of commands on her RHEL server:
- Install Apache HTTP Server:
- sudo dnf install httpd
- Start the Apache service:
- sudo systemctl start httpd
- This command will start the Apache service.
- Enable the Apache service to start on boot:
- sudo systemctl enable httpd
- This command will configure the Apache service to start automatically when the server boots up.
- Configure firewall rules to allow HTTP traffic:
- sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
- sudo firewall-cmd --permanent --add-service=http
Set up a basic HTML page as the default webpage: Create a new file named
index.html
in the default web directory (/var/www/html/
) with the desired content.Set the correct ownership and permissions for the web files:
- sudo chown -R apache:apache /var/www/html/
sudo chmod -R 755 /var/www/html/ - These commands will ensure that the Apache user has appropriate ownership and permissions to serve the web files.
- sudo chown -R apache:apache /var/www/html/
- Test the configuration and access the default webpage: Open a web browser on the RHEL server or any other machine on the network and enter the server's IP address or hostname. If everything is configured correctly, the default webpage should be displayed.
Redina can use these commands as part of her teaching material, explaining each command's purpose and significance. She can demonstrate the commands on her RHEL server and guide the students to practice and verify the configuration on their own systems. Additionally, Redina can provide further explanations on Apache configuration files and advanced HTTP server configuration topics to enhance the students' understanding.