Paul's Programming Notes     Archive     Feed     Github

Adding Virtualhost In Apache For Port

Say we wanted to route the <your-domain>.com:8072/misc to /var/www/misc...

Add the following to /etc/apache2/ports.conf:
NameVirtualHost *:8072
Listen 8072

Add a file that describes your site to /etc/apache2/sites-available with this:
<VirtualHost *:8072>
   ServerName <your-domain>.com
   DocumentRoot /var/www/misc/
</VirtualHost>

Run this command: sudo a2ensite misc

And restart apache: sudo service apache2 restart