Class 9 Lab 1 ‐ Personal HTTP Server - Justin-Boyd/Ethical-Hacking-Class GitHub Wiki
Task 1: Basic Apache Configuration
Step 1
Step 2
- Start the Apache service and verify that it is active.
Step 3
- Change the Apache port configuration file to listen on port 9191. Now restart the Apache service.
- Open Terminal
- service apache2 start
- service apache2 status
- Q to quit
- nano /etc/apache2/ports.conf
- Find Listen 80 and change 80 to 9191
- CTRL + X and then Y
- service apache2 restart
Step 4
- Browse to the website (127.0.0.1:9191) and verify that it is active.
Task 2: Enable HTTP Headers
Step 1
- Via the browser inspector, locate the content type header and examine it.
- Right click and selected inspect element
- Go to the Network tab
- Refresh page
- Click on the first GET request
- Check the response headers to detect the “Content-Type” attribute that describes the content of the page.
Step 2
- In the terminal, enable HTTP headers for the HTTP service
- a2enmod headers
- systemctl restart apache2
Task 3: Create a Custom Header
Step 1
- Open the Apache security.conf file, and add a header at the bottom using: Header set Custom-Header: “Hello”. Then save and inspect the changes.
- nano /etc/apache2/conf-available/security.conf
- Scroll to the bottom and add: Header set Custom-Header: “Hello”
- CTRL + X and then Y
- service apache2 restart
Step 2
- Make a request to the localhost to examine the change in the header.
- Refresh the webpage
- Inspect the first GET request
- Review the new field "Custom-Header"