I just installed LAMP on my Ubuntu machine, and it works fine when I access it. I want to add a virtual host on another port, port 1337, that goes to the directory /var/www/flag-1/
. In order to do this, I take the following steps:
cd /etc/apache2/sites-available/
flag-1.conf
<VirtualHost *:1337> ServerAdmin webmaster@localhost DocumentRoot /var/www/flag-1/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
/etc/apache2/ports.conf
, after Listen 80
, added Listen 1337
a2ensite flag-1.conf
service apache2 restart
When I access the site with port 1337, it just loads indefinitely. The default port still works fine, and I don't have UFW enabled. No errors, nothing in access.log
or error.log
is outstanding.
Any help is appreciated. Thanks!
Figured it out -- I was using Google Cloud Platform and they blocked port 1337, I just had to manually allow TCP through it.
If you're wondering, the command was
gcloud compute firewall-rules create allow-port-1337 --allow tcp:1337 --description="Allow port 1337 to be accessed"