Monday, June 7, 2010

How to assign 2 ports to the same website on the same server (OAS)

I recently have to assign 2 ports to same portal on the same OAS server.

Below is the example to do the same.

add the below entries according to ur requirement in httpd.conf

Listen 80
Listen 8080

NameVirtualHost 172.20.30.40:80
NameVirtualHost 172.20.30.40:8080


<VirtualHost 172.20.30.40:80>
ServerName www.example1.com
DocumentRoot /www/domain-80
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example1.com
DocumentRoot /www/domain-8080
</VirtualHost>

<VirtualHost 172.20.30.40:80>
ServerName www.example2.org
DocumentRoot /www/otherdomain-80
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example2.org
DocumentRoot /www/otherdomain-8080
</VirtualHost>

The above information have been collected from the below link
http://httpd.apache.org/docs/2.0/vhosts/examples.html

No comments: