Reconfiguring Mailman Default URLs

Asked by cmnorton

I need to know how to change mailman's default admin directory to
something else. I'll provide some background.

I have a default mailman installation.

My mm_cfg.py looks like this:

##################################################
# Put YOUR site-specific settings below this line.

DEFAULT_URL_PATTERN = 'http://%s/mailman/'
PUBLIC_ARCHIVE_URL = 'http://%s/pipermail/%(listname)s'
#PUBLIC_ARCHIVE_URL = 'http://%(hostname)s:8581/pipermail/%(listname)s'

DEFAULT_URL_HOST = 'arlserver.town.arlington.ma.us'
DEFAULT_EMAIL_HOST = 'town.arlington.ma.us'
VIRTUAL_HOSTS.clear()
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
#add_virtualhost('webapps.Arlington1.local:8581',DEFAULT_EMAIL_HOST)

I am reaching the mailman server through an apache server that
re-routes URLs

Here is part of the apache config file that routes to my mailman server:

   ProxyPass /admin http://webapps:8581/mailman/admin
    ProxyPassReverse /admin/ http://webapps:8581/mailman/admin

webapps is the name of the mailman server, and it's apache is listing on
port 8581

My problem is I need to have the link be more than /admin. It could be
mmadmin, or zadmin, or list_server_admin. We're doing serious URL
re-writing, so our Power School student admin system can be accessed
through a secure link, and both it and mailman have a default admin
directory. When I go to click on Power School's home "button", I go to
my mailman server.

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Mailman Edit question
Assignee:
No assignee Edit question
Solved by:
Mark Sapiro
Solved:
Last query:
Last reply:
Revision history for this message
Best Mark Sapiro (msapiro) said :
#1

Here's what you'd need to do.

Change the name of Mailman's admin CGI wrapper from $prefix/cgi-bin/admin to say $prefix/cgi-bin/mmadmin.
Change the name of Mailman's $prefix/Mailman/Cgi/admin.py to $prefix/Mailman/Cgi/mmadmin.py.

Those two renames are all you need to be able to access the admin interface with a URL with mmadmin instead of admin, but then you also need to change the name in all the links that Mailman generates. This requires changing 'admin to 'mmadmin' in at least the following 22 places (The line numbers are from the current head of the 2.1 branch and may not be exact).

./bin/change_pw:186: adminurl = mlist.GetScriptURL('admin', absolute=1)
./bin/newlist:237: 'admin_url' : mlist.GetScriptURL('admin', absolute=1),
./Mailman/Cgi/admin.py:241: advertised.append((mlist.GetScriptURL('admin'),
./Mailman/Cgi/admin.py:354: url = '%s/%s/%s' % (mlist.GetScriptURL('admin'), category, subcat)
./Mailman/Cgi/admin.py:356: url = '%s/%s' % (mlist.GetScriptURL('admin'), category)
./Mailman/Cgi/admin.py:370: adminurl = mlist.GetScriptURL('admin')
./Mailman/Cgi/admin.py:385: adminurl = mlist.GetScriptURL('admin')
./Mailman/Cgi/admin.py:817: link = Link(mlist.GetScriptURL('admin') + varhelp,
./Mailman/Cgi/admin.py:832: adminurl = mlist.GetScriptURL('admin', absolute=1)
./Mailman/Cgi/admin.py:1216: adminurl = mlist.GetScriptURL('admin', absolute=1)
./Mailman/Cgi/create.py:68: Link(Utils.ScriptURL('admin'),
./Mailman/Cgi/create.py:248: 'admin_url' : mlist.GetScriptURL('admin', absolute=1),
./Mailman/Cgi/create.py:261: admin_url = mlist.GetScriptURL('admin', absolute=1)
./Mailman/Cgi/edithtml.py:141: link = Link(mlist.GetScriptURL('admin'),
./Mailman/Cgi/listinfo.py:126: Link(Utils.ScriptURL('admin'),
./Mailman/Cgi/rmlist.py:182: Link(Utils.ScriptURL('admin'),
./Mailman/Cgi/rmlist.py:236: mlist.GetScriptURL('admin'),
./Mailman/Gui/Privacy.py:100: admin = mlist.GetScriptURL('admin')
./Mailman/Gui/Privacy.py:160: adminurl = mlist.GetScriptURL('admin', absolute=1)
./Mailman/Handlers/Moderate.py:175: mlist.GetScriptURL('admin', absolute=1)
./Mailman/HTMLFormatter.py:55: Link(self.GetScriptURL('admin'),
./Mailman/Queue/BounceRunner.py:339: adminurl = mlist.GetScriptURL('admin', absolute=1) + '/bounce'

Revision history for this message
Mark Sapiro (msapiro) said :
#2

Above I said

Change the name of Mailman's admin CGI wrapper from $prefix/cgi-bin/admin to say $prefix/cgi-bin/mmadmin.
Change the name of Mailman's $prefix/Mailman/Cgi/admin.py to $prefix/Mailman/Cgi/mmadmin.py.

This is wrong (I made a mistake in testing). You do need to change the name of Mailman's admin CGI wrapper from $prefix/cgi-bin/admin to say $prefix/cgi-bin/mmadmin, but you must not change the name of Mailman's $prefix/Mailman/Cgi/admin.py to $prefix/Mailman/Cgi/mmadmin.py. This is because the name 'admin' used to import the script from Mailman/Cgi/ is compiled into the $prefix/cgi-bin/admin wrapper so whatever its name is, it will still wind up invoking the $prefix/Mailman/Cgi/admin.py script.

Revision history for this message
cmnorton (octopusgrabbus) said :
#3

Many thanks for the correction and answers. I'll go try this out Monday.

 Charles M Norton
Database Programmer/Systems Integrator

----- Original Message ----
From: Mark Sapiro <email address hidden>
To: <email address hidden>
Sent: Fri, June 4, 2010 12:52:00 PM
Subject: Re: [Question #113482]: Reconfiguring Mailman Default URLs

Your question #113482 on GNU Mailman changed:
https://answers.launchpad.net/mailman/+question/113482

Mark Sapiro posted a new comment:
Above I said

Change the name of Mailman's admin CGI wrapper from $prefix/cgi-bin/admin to say $prefix/cgi-bin/mmadmin.
Change the name of Mailman's $prefix/Mailman/Cgi/admin.py to $prefix/Mailman/Cgi/mmadmin.py.

This is wrong (I made a mistake in testing). You do need to change the
name of Mailman's admin CGI wrapper from $prefix/cgi-bin/admin to say
$prefix/cgi-bin/mmadmin, but you must not change the name of Mailman's
$prefix/Mailman/Cgi/admin.py to $prefix/Mailman/Cgi/mmadmin.py. This is
because the name 'admin' used to import the script from Mailman/Cgi/ is
compiled into the $prefix/cgi-bin/admin wrapper so whatever its name is,
it will still wind up invoking the $prefix/Mailman/Cgi/admin.py script.

--
You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
cmnorton (octopusgrabbus) said :
#4

I changed all the references in Mailman/Cgi/ you mentioned; did not change the name of admin.py; and did change the name of admin to lsadmin (used instead of 'm'). I cannot see my lists.

Revision history for this message
Mark Sapiro (msapiro) said :
#5

Did you change your proxy mapping too? I don't really understand proxying, but I think this would need to be

   ProxyPass /lsadmin http://webapps:8581/mailman/lsadmin
    ProxyPassReverse /lsadmin/ http://webapps:8581/mailman/lsadmin

Revision history for this message
cmnorton (octopusgrabbus) said :
#6

I did make these changes. I've got some more testing to do.

Revision history for this message
cmnorton (octopusgrabbus) said :
#7

Yes, I did change the proxy mapping, and I've got more testing to do.

 Charles M Norton
Database Programmer/Systems Integrator

----- Original Message ----
From: Mark Sapiro <email address hidden>
To: <email address hidden>
Sent: Mon, June 7, 2010 11:07:10 AM
Subject: Re: [Question #113482]: Reconfiguring Mailman Default URLs

Your question #113482 on GNU Mailman changed:
https://answers.launchpad.net/mailman/+question/113482

    Status: Open => Needs information

Mark Sapiro requested for more information:
Did you change your proxy mapping too? I don't really understand
proxying, but I think this would need to be

   ProxyPass /lsadmin http://webapps:8581/mailman/lsadmin
    ProxyPassReverse /lsadmin/ http://webapps:8581/mailman/lsadmin

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/mailman/+question/113482

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
Mark Sapiro (msapiro) said :
#8

Can you successfully go to http://webapps:8581/mailman/lsadmin?

Revision history for this message
cmnorton (octopusgrabbus) said :
#9

yes

 Charles M Norton
Database Programmer/Systems Integrator

----- Original Message ----
From: Mark Sapiro <email address hidden>
To: <email address hidden>
Sent: Mon, June 7, 2010 12:55:27 PM
Subject: Re: [Question #113482]: Reconfiguring Mailman Default URLs

Your question #113482 on GNU Mailman changed:
https://answers.launchpad.net/mailman/+question/113482

    Status: Open => Needs information

Mark Sapiro requested for more information:
Can you successfully go to http://webapps:8581/mailman/lsadmin?

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.launchpad.net/mailman/+question/113482

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
Mark Sapiro (msapiro) said :
#10

I think I misunderstood the problem. If I go to <http://arlserver.town.arlington.ma.us/mailman/lsadmin> I see the "webapps mailing lists - Admin Links" page with "There currently are no publicly-advertised Mailman mailing lists on webapps". Is this the issue (that there are no lists displayed)?

If so, I suspect that this never worked in the "proxy" environment. The reason is the request is coming to the webapps machine with 'webapps' as the HTTP_HOST, but the lists all have the arlserver.town.arlington.ma.us domain as their web host.

The easiest way around this is to set

VIRTUAL_HOST_OVERVIEW = Off

in mm_cfg.py. See the FAQ at <http://wiki.list.org/x/lYA9>. Note that you have the same issue on the listinfo overview and the fix is the same.

Revision history for this message
cmnorton (octopusgrabbus) said :
#11

Thanks. For now, this is solved. I'll test with the arlserver link, and, if I need to, ask another question.

Revision history for this message
cmnorton (octopusgrabbus) said :
#12

Thanks Mark Sapiro, that solved my question.