I use Apache server .
I have two different DocumentRoot and would like to setup two virtualhost , so that two different port can serve different DocumentRoot , I use the below URL but do not work , when I use this method , even I use connect 80 or 8080 , it also re-direct to port 80 , would advise if I use the wrong method ? very thanks
http://httpd.apache.org/docs/2.2/vhosts/examples.html
Code:
Server configuration
Listen 80
Listen 8080
NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080
<VirtualHost 172.20.30.40:80>
ServerName www.example.com
DocumentRoot /www/domain-80
</VirtualHost>
<VirtualHost 172.20.30.40:8080>
ServerName www.example.com
DocumentRoot /www/domain-8080
</VirtualHost>
<VirtualHost 172.20.30.40:80>
ServerName www.example.org
DocumentRoot /www/otherdomain-80
</VirtualHost>
<VirtualHost 172.20.30.40:8080>
ServerName www.example.org
DocumentRoot /www/otherdomain-8080
</VirtualHost>