Currently I have an Apache2 listening on Port 80. This is configured in /etc/apache2/listen.conf
In /etc/apache2/conf.d I have the normal configuration files and:
site1.conf, site2.conf and site3.conf files.
Each conf file is configured very similar :
Alias /site1 /home/user/www/site1/
AddHandler cgi-script cgi
<Directory "/home/user/www/site1/">
AllowOverride All
Options +ExecCGI
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
DirectoryIndex index.cgi
</Directory>
So going to my browser I can enter:
http://10.10.0.1/site1 and get site1, http://10.10.0.1/site2 and get site2 etc
This works fine internally.
I'd now like to allow site2 and site3 to be accessed externally.
If I open port 80 on my router and route it to 10.10.0.1 then all sites are available.
I've added 8080 & 8888 to /etc/listen.conf and edited site2.conf as :
<VirtualHost *:8080>
Alias /site2 /home/user/www/site2/
AddHandler cgi-script cgi
<Directory "/home/user/www/site2/">
AllowOverride All
Options +ExecCGI
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
DirectoryIndex index.cgi
</Directory>
</VirtualHost>
and site3 the same but setting the VirtualHost to *:8888
This works. I can access site2 only on 8080 and site3 only on 8888 BUT
I can also access site1 on port 8080 and port 8888
What I want is :
- site1 is only available from port 80
- site2 is only available from port 8080
- site3 is only available from port 8888
The router only has 8080 and 8888 open and routing.
Any idea how I can do this ?
Thanks