Forum OpenACS Q&A: nsunix/nsvhr again

Collapse
Posted by Antonio Laterza on
I followed (without patching) the configuration Method One: nsvhr/nsunix in Method One:nsvhr/nsunix in www.hollyjerry.org:16080 ...
I'm using aolserver_3.2_ad12, using OpenACS www.ewayweb.net:80, ciao:8080 and master:8001 (every site has its own configuration file)
When I attempt to start the master (ex: ./bin/nsd -kt master.tcl) I get the message:
Fatal: nsmain: no server specified: specify '-s' parameter or
specify ns/servers in config file

due to the section:($server is master)
ns_section "ns/servers" 
        ns_param   $server     $servername 
        ns_param   ewayweb-dev "ewayweb-dev"
        ns_param   ciao        "ciao ciao" 

I added the section
ns_section "ns/server/${server}/module/nsunix" 
ns_param   hostname     $hostname 
ns_param   socketfile   "${hostname}.nsunix"
in both ciao.tcl and ewayweb.tcl configuration files.
Maybe I'm missing something in configurations.. or I need to patch ?
Somebody knows if there is explicit howto or documentation for aolserver_3.2_ad12?
Collapse
Posted by Jamie Ross on
try starting it with ./bin/nsd -s master -kt master.tcl  .. that should fix it
Collapse
Posted by Antonio Laterza on
Great!! Thanks Jamie... it was only one of my last two days problem 😊
Now...
first: for master I don't installed openacs (I think it's rigth(?))
second: I configured ciao, www.ewayweb.net and master in my client's /etc/hosts to same address (192.168.198.7)
Then master:8001, ciao:8080 and www.ewayweb.net:80 each one serve me its home page.
I thougth that
if I request ciao:8001 then I'd have the same page of ciao:8080
so
if I request www.ewayweb.net:8001 then I'd have the same page of www.ewayweb.net:80
In fact I have the page master:8001
What's wrong.
tahnks.
Collapse
Posted by Dave Bauer on
Master should run on port 80, each virtual host gets it's own port. All requests should be made to port 80. The master server forwards them to the correct unix socket.
Collapse
Posted by Jonathan Ellis on
did ad merge in Jerry's nsunix patches, then?
Collapse
Posted by Jerry Asher on
No they haven't and for good reasons too, but uh, that means that Antonio will certainly not be able to get nsvhr/nsunix working.

Antonio, you will need to patch your version of aolserver, or use the nsvhr/nssock methods of virtual hosting.

Collapse
Posted by Antonio Laterza on
Is aolserver3_rc2_vhr.tar the rigth patch even for olserver_3.2_ad12?
Collapse
Posted by Jerry Asher on
You want aolserver3_2-vhr.patch, but visit http://downloads.hollyjerry.org:16080 for more details.

Truly, nsvhr/nssock works without patching, and it's a very good first step in virtual hosting.

Collapse
Posted by Antonio Laterza on
Using nsvhr/nssock methot and indipendent file for each server involved, what's the rigth configuration for master? for session:
ns_section "ns/server/${server}/modules" 
ns_param   nssock          ${bindir}/nssock.so 
ns_param   nslog            ${bindir}/nslog.so 
ns_param   nsperm          ${bindir}/nsperm.so 
ns_param   nscgi           ${bindir}/nscgi.so 
ns_param   nsvhr        ${bindir}/nsvhr.so
If I have to use the nssock module then I have to confgure the session, otherwise by default the master run on 127.0.0.1:80, so:
# 
# Socket driver module (HTTP)  -- nssock 
# 
  ns_section "ns/server/${server}/module/nssock" 
  ns_param   port         $httpport 
  ns_param   hostname     $hostname 
  ns_param   address      $address
The log's master says:
...
Notice: nsvhr: redirecting: host: ciao -> tcp://ciao:8080
Notice: nsvhr: redirecting: host: ciao:8080 -> tcp://ciao:8080
...
If I ask for ciao:8080 it's ok, but when I ask for ciao then the response come from master (where I disabled the pageroot):

The requested URL was not found on this server.
AOLserver/3.2+ad12 on http://master

Collapse
Posted by Jerry Asher on
Antonio,

It appears you want to nsvhr two servers, requiring you to run three AOLserver instances.  Can you describe how you are starting each server, and can you post the ns/server/master/modules/nsvhr/maps section of your config.tcl?

Thanks,

Collapse
11: detail nsunix/nsvhr again (response to 1)
Posted by Antonio Laterza on
yes, I run thre servers: master, ciao, www.ewayweb.net
The "ciao" and "www.ewayweb.net" configuration files are two that differs in name and port (8001 and 8080) only and they are configures as they work indipendently whithout any modification (no nsvhr module)
in ciao.tcl
httport=8080, hostname=ciao
in dev-ewayweb.tcl
httport=8001, hostname=www.ewayweb.net
 ns_section "ns/server/${server}/module/nssock" 
          ns_param   port         $httpport 
          ns_param   hostname     $hostname  
          ns_param   address      $address
The master.tcl file is:
ns_log notice "nsd.tcl: starting to read config file..."

set httpport               80
set hostname               master
set address 192.168.198.7
set server		   "master" 
set servername             "master master" 
set homedir                 [file dirname [ns_info config]] 
set bindir                  [file dirname [ns_info nsd]] 

ns_section "ns/parameters" 
        ns_param   home         $homedir 
        ns_param   debug        false 
        ns_param   MailHost     localhost 
        ns_param   ServerLog    ${homedir}/log/${server}.log 
        ns_param   LogRoll      on

ns_section "ns/mimetypes" 
        ns_param   default         "*/*"     ;# MIME type for unknown extension 
        ns_param   noextension     "*/*"     ;# MIME type for missing extension 
        #ns_param   ".xls"         "application/vnd.ms-excel''

ns_section "ns/servers" 
        ns_param   $server     $servername 
        ns_param   ewayweb-dev "ewayweb-dev"
        ns_param   ciao        "ciao ciao" 

# 
# Server parameters 
# 
ns_section "ns/server/${server}"
ns_param   enabletclpages       Off 

# 
# Socket driver module (HTTP)  -- nssock 
# 
ns_section "ns/server/${server}/module/nssock" 
ns_param   port         $httpport 
ns_param   hostname     $hostname 
ns_param   address      $address


ns_section "ns/server/${server}/module/nsvhr/maps"
ns_param "www.ewayweb.net:8001"       "http://www.ewayweb.net:8001"
ns_param "www.ewayweb.net"       "http://www.ewayweb.net:8001"
ns_param "gloucester"            "http://www.ewayweb.net:8001"
ns_param "gloucester:8001"            "http://www.ewayweb.net:8001"
ns_param "ciao"                  "http://ciao:8080"
ns_param "ciao:8080"                  "http://ciao:8080"

# 
# Modules to load 
# 
ns_section "ns/server/${server}/modules" 
ns_param   nssock          ${bindir}/nssock.so 
ns_param   nslog            ${bindir}/nslog.so 
ns_param   nsperm          ${bindir}/nsperm.so 
ns_param   nscgi           ${bindir}/nscgi.so 
ns_param   nsvhr        ${bindir}/nsvhr.so

ns_log notice "nsd.tcl: finished reading config file."

Collapse
12: nsunix/nsvhr again (response to 1)
Posted by Antonio Laterza on
Sorry, (I don't know if it's relevant) than start the services:
as root user:
/home/aol32/bin/nsd -u nsadmin -g web -i -t /home/aol32/dev-ewayweb.tcl
/home/aol32/bin/nsd -u nsadmin -g web -i -s master -t /home/aol32/master.tcl
and from nsadmin user:
./bin/nsd -s ciao -kt ciao.tcl
Collapse
Posted by Jerry Asher on
How is www.ewayweb.net working?  Is this a problem you are having with all of your nsvhr sites, or just with ciao?

Is ciao to be addressable internet wide, or only from your LAN?  (What is it's full domain name, and is there some reason it is listed in the map as ciao, and not say, as ciao.ewayweb.net?)

Have you disabled adp and fastpath in the master?

When I connect to your site via telnet to port 80 and request GET / but give a HOST: field of CIAO, I get a 302 redirect to 8001.  When I request a HOST: field of VIRUS, I get a 302 redirect to 8001.  Both of those are wrong.  CIAO should give me your CIAO homepage, and VIRUS should give me a 404.

Also I note I can't connect to your 8080 port.  Is there a firewall in the way?  (Can you open that?)

Perhaps you should post (or give a link to) your config files.

Collapse
14: nsunix/nsvhr again (response to 1)
Posted by Antonio Laterza on
Hi Jerry, the problem is the same for www.ewayweb.net
I redirect with xinetd on local 192.168.198.7:80
Now I modified master, to show the index page, where I linked the three configuration files: ciao.tcl, dev-ewayweb.tcl and master.tcl
Thanks
Collapse
Posted by Antonio Laterza on
Is there in some place the three configuration example files for virtual hosting with nssock/nshvr?
For example, I have www.zzz.aaa.com on port 8001, www.xxx.aaa.com on port 8080 and master yyy.aaa.com on port 80, how should I configure
  • zzz.tcl (site on port 8001)
  • xxx.tcl (site on port 8080)
  • yyy.tcl (the master on port 80)
Thanks
Collapse
16: nssock/nsvhr error (response to 1)
Posted by Robert Schlaff on
Hi guys. Everyone seems to be really happy with nssock but I seem to have run into a problem with it. Whenever I try to POST binary files to the webserver (like with the photodb module) I get an error. You can see for yourself at http://schlaff.com/files . First I started getting 408 timeout messages from the master process so I increased the timeout from 29 to 59. Then I got:

Warning: nsvhr: timeout while redirecting to host schlaff.com

Finally, I got all this stuff to work by bypassing the nsvhr totally for these uploads by connecting directly to the right port (8000) -- so http://schlaff.com:8000/files seems to work fine and I'm able to upload files. Does anyone know why this might be happening or might be able to suggest a fix?