mailman web interface via reverse proxy ; hostname is set properly on list pages, but not on base listinfo
Hello,
I have made the mailman web interface accessible via a reverse proxy on a publically-accessible web server. After reading through the documentation and list archives, i set the hostname variables in mm_cfg.py, and fixed the hostnames associated with the existing lists via the withlist tool. On each of the individual list pages (and list headers / footers / etc.) the hostnames are set properly ; in fact, this was very straightforward to do, and works perfectly.
However, on the base "listinfo" page the hostname appears to be set as the IP address of the mailman machine (not the reverse proxy), which has repercussions on the interface as a whole.
For example, via http://proxy.dom.ain/mailman/admin/list all of the links on the page point (properly) to http://proxy.dom.ain/mailman/admin/list/* as expected ; all except the final "Overview of all ,x.dom.ain mailing lists" link, which points to http://1.2.3.4/mailman/listinfo .
Likewise, on http://proxy/mailman/listinfo the header states "1.2.3.4 Mailing Lists", and makes references to "mailing lists on 1.2.3.4", and to contact "mailman@1.2.3.4" for problems.
How can these base hostnames be changed to reflect the values that are correct (as has been done on the individual lists), instead of the IP address of the machine that mailman is hosted on ?
I am running mailman-2.1.9-4.el5 and httpd-2.2.3-43.el5.centos on CentOS 5.5.
The relavent excerpt from mm_cfg.py :
#DEFAULT_URL_HOST = fqdn #DEFAULT_EMAIL_HOST = fqdn DEFAULT_URL_HOST = "proxy.dom.ain" DEFAULT_EMAIL_HOST = "mx.dom.ain" add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
Apache (on the mailman server) :
ScriptAlias /mailman/ /usr/lib/mailman/cgi-bin/ <Directory /usr/lib/mailman/cgi-bin/> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> RedirectMatch ^/mailman[/]*$ http://proxy.dom.ain/mailman/listinfo
Apache (on the proxy) :
# mailman <IfModule mod_proxy.c> RewriteRule ^\/mailman$ mailman\/ [R] ProxyPass /mailman/ http://1.2.3.4/mailman/ ProxyPassReverse /mailman/ http://1.2.3.4/mailman/ </IfModule>
Thank you for your kind consideration, and have a good day.
-- Daniel Maher <dma PLUS mailman AT witbe DOT net> "The Internet is completely over." -- Prince
Daniel Maher wrote:
For example, via http://proxy.dom.ain/mailman/admin/list all of the links on the page point (properly) to http://proxy.dom.ain/mailman/admin/list/* as expected ; all except the final "Overview of all ,x.dom.ain mailing lists" link, which points to http://1.2.3.4/mailman/listinfo .
Likewise, on http://proxy/mailman/listinfo the header states "1.2.3.4 Mailing Lists", and makes references to "mailing lists on 1.2.3.4", and to contact "mailman@1.2.3.4" for problems.
The host portion of those URLs comes from the get_domain() function in Mailman/Utils.py which gets it from the environment passed by Apache to the CGI. It uses HTTP_HOST if present or SERVER_NAME if no HTTP_HOST.
If you set VIRTUAL_HOST_OVERVIEW = No in mm_cfg.py, it will use DEFAULT_URL_HOST instead which is probably what you want.
I think you can also get Apache to provide the name you want with the ServerName and UseCanonicalName directives in httpd.conf, but setting VIRTUAL_HOST_OVERVIEW = No is probably preferable in your case.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 09/08/2010 05:42 PM, Mark Sapiro wrote:
Daniel Maher wrote:
For example, via http://proxy.dom.ain/mailman/admin/list all of the links on the page point (properly) to http://proxy.dom.ain/mailman/admin/list/* as expected ; all except the final "Overview of all ,x.dom.ain mailing lists" link, which points to http://1.2.3.4/mailman/listinfo .
Likewise, on http://proxy/mailman/listinfo the header states "1.2.3.4 Mailing Lists", and makes references to "mailing lists on 1.2.3.4", and to contact "mailman@1.2.3.4" for problems.
The host portion of those URLs comes from the get_domain() function in Mailman/Utils.py which gets it from the environment passed by Apache to the CGI. It uses HTTP_HOST if present or SERVER_NAME if no HTTP_HOST.
If you set VIRTUAL_HOST_OVERVIEW = No in mm_cfg.py, it will use DEFAULT_URL_HOST instead which is probably what you want.
I think you can also get Apache to provide the name you want with the ServerName and UseCanonicalName directives in httpd.conf, but setting VIRTUAL_HOST_OVERVIEW = No is probably preferable in your case.
Thank you for your excellent advice and explanation ; setting "VIRTUAL_HOST_OVERVIEW = no" did the trick.
For anybody in the future that might find this thread in the archives, i would also like to note that i had to set "DEFAULT_URL_PATTERN = 'https://%s/mailman/'" in order to make sure that the URLs got written with https instead of http (default).
For more info : http://wiki.list.org/display/DOC/4.27+Securing+Mailman's+web+GUI+by+using+Secure+HTTP-SSL
Cheers !
-- Daniel Maher <dma PLUS mailman AT witbe DOT net> "The Internet is completely over." -- Prince
On 09/08/10 03:31, Daniel Maher wrote:
However, on the base "listinfo" page the hostname appears to be set as the IP address of the mailman machine (not the reverse proxy), which has repercussions on the interface as a whole. ... How can these base hostnames be changed to reflect the values that are correct (as has been done on the individual lists), instead of the IP address of the machine that mailman is hosted on ?
If for some reason you can't get Mailman / Apache on the mailing list server to function properly there are some Apache tricks that you can use on the reverse proxy to likely correct the issue that you are having.
I have used mod_proxy_html a number of times to correct content as it's flowing through the reverse proxy.
Grant. . . .
participants (3)
-
Daniel Maher
-
Grant Taylor
-
Mark Sapiro