Forum OpenACS Q&A: Virtual Hosting using nsvhr/nsunix

Posted by Gaizka Villate on

I would like to host a couple of different servers running on the same IP address, using the nsvhr/nsunix modules od AOLServer. I've read some different threads about it (like and thanks to Jerry Asher (good job, by the way) and his document Multiple ACS installations with one static IP, I think I understand how it works.

I have suceed in making it work with nsvhr/nssock combination, but not with nsvhr/nsunix.

I've used aolserver-src-3.1ad8 with Jerry Asher's patch.

The relevant part of the nsd.tcl files is:

# server1 is listening on port 80, just acting as a proxy to server2
ns_section "ns/server/server1/module/nsvhr"
     ns_param Timeout      29
     ns_param Method       GET
     ns_param Method       POST
ns_section "ns/server/server1/module/nsvhr/maps"
     ns_param "server2"      "unix://server2"

ns_section "ns/server/server1/module/nssock"
     ns_param   port         80
     ns_param   hostname     "server1"

# server 2 is listening on port 8000
ns_section "ns/server/server2/module/nssock"
        ns_param   port         8000
        ns_param   hostname     server2

ns_section "ns/server/server2/module/nsunix"
     ns_param hostname "server2"
     ns_param port      "8000"
     ns_param socketfile "server2"

The problem arises when i start the servers. Server1 runs O.K. (i check it musing it act as a proxy, but this time with nsvhr/nssock). In the log appears:

Notice: nsvhr: redirecting: host: server2 ->
So the proxy part looks O.K.

The client log gives the next error when loaded:

Error: nsunix: failed to start listening: No such file or directory
So i guess the problem is with the file acting as a socket being created. I've checked that the directory ${aolserver_install_dir}/modules/nsunix exists.

When both servers are running, if i try to access server2 through the proxy (by using http://server2), the following line appears in server1's log file:

Error: nsvhr: could not connect to unix:modules/nsunix/server2:
Connection refused

My question is: what am i doing wrong? Shouldn't this socket appear in that directory after running the server?

I don't know what else to try. Any suggestion will be apreciated.

Thanks in advance!

Posted by Tilmann Singer on
Try to leave the socketfile and port parameters of the server2 configuration out and start the server, then grep for nsunix in the server log - at least in my case it generated a file in modules/nsunix. In the log entry it was something like this: "nsunix accepting """ which translated to a file named in modules/unix. Dont know what you are supposed to write in the proxy hosts's configuration though.

Also check that your webserver user has write access to that directory.