Port Based Apache Configuration
Port Based Apache Configuration
Add the following lines precisely below the line Listen 80:
Listen 8081
Listen 8080
First, create an index.html page for the website hosted on port 8080:
<html>
<title>GU Site</title>
<h1> Success! GU Website is running on Port 8080</h1>
</html>
Next, create an index.html page for the website hosted on port 8081:
<html>
<title>GU Site</title>
<h1> Success! GU Website is running on Port 8081</h1>
</html>
Save and close the file.
Next, change the ownership of both websites to www-data:
First, create an Apache virtual host configuration file for the website hosted on port
8080:
<Directory /var/www/html/8080>
Require all granted
AllowOverride None
</Directory>
<VirtualHost *:8080>
DocumentRoot /var/www/html/8080
ServerAdmin [email protected]
ErrorLog "/var/log/apache2/site8080_error_log"
CustomLog "/var/log/apache2/site8080_access_log" combined
</VirtualHost>
Next, create an Apache virtual host configuration file for the website hosted on port
8081:
<Directory /var/www/html/8081>
Require all granted
AllowOverride None
</Directory>
<VirtualHost *:8081>
DocumentRoot /var/www/html/8081
ServerAdmin [email protected]
ErrorLog "/var/log/apache2/site8081_error_log"
CustomLog "/var/log/apache2/site8081_access_log" combined
</VirtualHost>
Save and close the file. Then, enable the virtual host with the following command: