Peter,

got vhosting with same named virtual server 'test.mysite.net' with different
ports working no problems
(going to the same AOLserver 'test')

also works when you have the same hostname 'test.mysite.net'
with different ports (80 and 8080) going to different AOLservers test and
test8080.

so in my config file (top 'global' section) I have:


# set up the different virtual servers
ns_section  ns/servers
ns_param        test                            "test server"
ns_param        test8080                        "test server on 8080"

ns_section  ns/modules
ns_param    nssock                  ${bindir}/nssock${ext}

ns_section  ns/module/nssock
ns_param    hostname                $hostname
ns_param    address                 $address
ns_param        port                            $httpport


(so far just as you suggested yesterday)

ns_section  ns/module/nssock/servers
ns_param        test                            test.mysite.net
ns_param        test8080                        test.mysite.net:8080

(pretty much as you suggested)


then in the bit in the loop (per server config)

if {$servername == "test8080"} {
ns_section  ns/server/$servername/module/nssock
ns_param    hostname                $hostname
ns_param    address                 $address
ns_param    port                    8080
;# Port for HTTP (typically 80)
ns_section  ns/server/${servername}/modules
ns_param    nssock   ${bindir}/nssock${ext}
}


If I now connect to test.mysite.net  I get my normal testsite index page

If I connect to test.mysite.net:8080 I get a directory listing (as I've not
added anything into the pageroot yet!)
Proves that different ports on the same name go to different virtual
servers.


HTH,



regards,

Tim Moss
SiteSpeed Ltd
Mobile:         0 77 9613 4891
Email:          [EMAIL PROTECTED]
Website:        http://www.site-speed.com

This email contains information from SiteSpeed Ltd, which may be privileged
or confidential. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this information
is prohibited. If you have received this electronic message in error, please
notify us immediately.



> -----Original Message-----
> From: AOLserver Discussion [mailto:[EMAIL PROTECTED]]On Behalf
> Of Peter M. Jansson
> Sent: 16 January 2003 02:02
> To: [EMAIL PROTECTED]
> Subject: Re: [AOLSERVER] AOLserver 4: Virtual server fix
>
>
> On Wednesday, January 15, 2003, at 06:56 PM, Tim Moss wrote:
>
> > OK, all patches applied and rebuilt.
> >
> > All seems to be working - thank you very much for your help Peter.
>
> Glad to help.
>
> > By the way here's my config file: (might be a neat way to avoid having a
> > huge config file)
>
> I do something similar, and I allow for sourcing an additional, optional
> file for each virtual (in my for loop, I test for existence of a file, and
> source it if it's there).
>

Reply via email to