Forum OpenACS Development: ns_returnredirect and virtual hosts: (minor) problems with bootstrap code

I have an apache-aolserver virtual hosting set-up, where apache is the "traffic cop" listening at port 80, directing traffic to multiple aolserver instances that run on unprivileged ports (8800, etc). Apache and aolserver are in one machine that sits behind a firewall. The firewall allows only port 80 requests, so requests from outside the firewall must pass through apache.

I'm having problems with the last step of the OpenACS4 installation, which I think has something to do with the way ns_returnredirect works. I am in packages/acs-bootstrap-installer/installer/site-info-2.tcl. On pressing the "Next->" button it does an ns_returnredirect of the following form

ns_returnredirect "/?done_p=1"
Correct me if I'm wrong, but the ns_returnredirect procedure redirects the browser to the aolserver instance, not the URL that apache is proxying. Thus when I do the installation from a remote machine (outside the firewall), the installation will seem to "hang" because my browser is trying to connect directly to the aolserver instance, not apache. But the firewall only allows port 80 (the port that apache listens on) to go through.

Ok, this may be a low priority bug (I can always install behind the firewall, which is probably a good idea anyway). It just seems to me a case where redirects without full URL's suck.

Well, unfortunately aD didn't follow their own advice in this case :)

I don't have any way to easily test and verify a fix to this, so do you want to take a stab at patching it and verifying that you're getting through the firewall afterwards?

The problem is not with ns_returnredirect. You need to add the location parameter to your config file. I think ns_returnredirect actually does construct a full url and I never understood aD's fix.

ns_section "ns/server/${servername}/module/nssock"
ns_param  port      8000              ;# Actualprivate port 
ns_param  hostname  ;# Internet Hostname
ns_param  address       ;# Actual private ip
ns_param  location ;#Protocol://Hostname

Slightly more info on running AOLserver behind a proxy can be found in my tclvhr module at

One more note on ns_returnredirect. I have a series of examples that you can use to prove to yourself that AOLserver constructs a full url from a relative url. They are located at under "Scripting Examples". I took great pains to create a new ns_returnredirect that did return relative urls, because at the time I did not know about the location parameter. Relative urls work perfectly through a proxy, which of course means that the reason yours is not working, is because AOLserver _is_ returning complete urls!

Thanks, Tom. Putting the proper "location" parameter in the aolserver config file did the trick -- the install was successful from a remote location, outside the firewall (now I think I understand what the location parameter is for). Doing virtual hosting with aolserver is really tricky, huh?
"really tricky" or "poorly documented"? :)

Tom, thanks a lot.  This needs to go into our OpenACS install documentation.

Calling Roberto ... calling Roberto ...

Added to my TODO list. I need to get moving with orgazinizing a
documentation team pretty quick. I hope I am not stuck doing docs by
myself forever 😊
I'll certainly do my best to muck up docs associated with my OpenACS 4  work.  Mostly what I think we need from you are some tech things (docbooks) and administrative things.

The administrative things can't be much worse than those I'm dealing with, so consider yourself either in good company or in the slum considering whether or not you think this project's moving along OK :)