virtual server listen socket

n SUN Webserver6.1, Listen socket(port) 80, 8080, and 8888 are

enabled. But after created some virtual servers, I would like to

dedicate port 8080 to one virtual server and port 8888 to another one.

But it seems that I cannot do this. Even in the server.xml file I saw

that port 8080 is only used by one virtual server, but this virtual

server still response to port 8888. Just wonder why? or say can I setup

that one virtue server is only response to one por and how?

Another question is: in the SUN Webserver 6.1 documentation, it says "

if you want to create a listen socket for IP-address-based virtual

servers, the IP address must be 0.0.0.0, ANY, any or INADDR_ANY,

meaning it listens on all IP address on that port."

Does that mean in an IP-based virutal server, cannot use a specific IP

when creating a listen socket? I am a bit confusing here. IP base

virtual server is that you need to specifiy an IP when creating listen

socket, isn't it?

Thanks for advice!

[1066 byte] By [tim_batiees] at [2007-11-26 8:46:07]
# 1

You can define virtuals in your server.xml file manually. You can have one virtual listening to one or many ports(LS) and you can have several virtuals listening to the same port. And you can assign IP address to virtual as well.

For example with YourServerIP listening to 4 ports you can do the following:

<LS id="ls1" ip="YourServerIP" port="8088" security="off" servername="YourServerName" defaultvs="YourDefaultVS"/>

<LS id="ls2" ip="YourServerIP" port="8089" security="off" servername="YourServerName" defaultvs="YourDefaultVS"/>

<LS id="ls3" ip="YourServerIP" port="8080" security="off" servername="YourServerName" defaultvs="VS3"/>

<LS id="ls4" ip="YourServerIP" port="80" security="off" servername="YourServerName" defaultvs="VS5"/>

...

<VSCLASS id="vsclass1" objectfile="obj.conf">

<VS id="YourDefaultVS" connections="ls1 ls2" mime="mime1" aclids="acl1" urlhosts="www.YourURL.com">

<PROPERTY name="docroot" value="/PathToYourDocumentRoot1"/>

<USERDB id="default"/>

</VS>

<VS id="VS3" connections="ls3" mime="mime1" aclids="acl1" urlhosts="www.AnotherURL.com">

<PROPERTY name="docroot" value="/PathToYourDocumentRoot2"/>

<USERDB id="default"/>

</VS>

<VS id="VS4" connections="ls4" mime="mime1" aclids="acl1" urlhosts="YourServerIP">

<PROPERTY name="docroot" value="/PathToYourDocumentRoot3"/>

<USERDB id="default"/>

</VS>

<VS id="VS5" connections="ls4" mime="mime1" aclids="acl1" urlhosts="www.YetAnotherURL.com YetAnotherURL.com">

<PROPERTY name="docroot" value="/PathToYourDocumentRoot4"/>

<USERDB id="default"/>

</VS>

<VS id="VS6" connections="ls4" mime="mime1" aclids="acl1" urlhosts="www.AsManyURLsAsNeddedSeparatedBySpace.com">

<PROPERTY name="docroot" value="/PathToYourDocumentRoot5"/>

<USERDB id="default"/>

</VS>

</VSCLASS>

Hope it helps.

Alexander aka ttalex

derjugin at 2007-7-6 22:31:15 > top of Java-index,Web & Directory Servers,Web Servers...