I have a few Apache virtual hosts set up. I’d like to access them from the outside. I found an article, Port-based Apache virtual hosts, that explained that you can tell each to listen on a specific port:
Listen 10080
<VirtualHost *:80 *:10080>
DocumentRoot "/Users/.../public_html"
ServerName www.foo.com
<Directory "/Users/.../public_html">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Each would need a Listen <unique port> and I’d have to forward each port on my router. So the result would be:
http://<my ip address>:10080http://<my ip address>:10081http://<my ip address>:10082- etc…
Is there a better solution?
You are looking for “name based virtual hosts”.