Forum OpenACS Q&A: How to configure AOLServer behind a proxy

How to configure AOLServer behind a proxy

If you have a installation of OpenACS that is behind a proxy you will soon realize some stuff will break:

  • Installation of modules from OpenACS repository
  • News Agregator
  • Any application using ns_httpopen, ns_sock...

In order to fix this you have to change two files:

  • config.tcl
  • [AOLSERVER]/modules/tcl/http.tcl

Changing your server configuration

Go to the section ns/parameters and add these lines under the section:

ns_param   proxy              your-cache.server
ns_param   proxy_port         xxxx

Changing the proc ns_httpopen

In the file [AOLSERVER]/modules/tcl/http.tcl go to the line

set fds [ns_sockopen -nonblock $host $port]
And change it to
    set proxy [ns_config ns/parameters proxy $host]
    set proxy_port [ns_config ns/parameters proxy_port $port]
    set fds [ns_sockopen -nonblock $proxy $proxy_port]
    set uri http://$host$uri

Now if you restart your server it will work just fine.

Thanks to Stefan Vogel for the fix [1].

[1] http://www.mail-archive.com/aolserver@listserv.aol.com/msg06933.html