Do you know howto setup mailman+nginx+fcgiwrap+ubuntu/debian?, was: Bug in NginxHttpFcgiModule's fas

On Thu, 11 Nov 2010 05:35:46 +0300,[email protected] wrote:

Hi there,

Hi Francis,
I thank you for your attempt at trying to help me.

This problem reminds me of a similar one that was debated in this list
a few months ago regarding Nginx config to serve Drupal.
It was a mess (mostly because the Drupal way of doing things).
And then Igor S. committed ‘try_files’ to Nginx and
things just got more manageable.

At first glance, it looks to me as if nginx is doing exactly what you
told it to. I suspect that a small reconfiguration of mailman will work
for you.

Well, the truth is that Mailman works out of the box using Apache on
Ubuntu/Debian Linux, using a config file
named /etc/mailman/apache.conf, which includes these lines:
ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/
Alias /pipermail/ /var/lib/mailman/archives/public/
Alias /images/mailman/ /usr/share/images/mailman/

I have tried many changes to both my nginx config file and to mailman’s
mm_cfg.py.
And, for instance, it almost does the job by just using:
root /usr/lib/cgi-bin/mailman/;
location = / {
rewrite ^ /listinfo last;
}
location /cgi-bin/mailman/ {
rewrite ^ /$args;
}

But there are administrative areas that still do not work.

After an extensive search in the web, it seems that this same problem
surfaces from time to time and those who ask for help, either stop
using Nginx to serve Mailman, or just abandon the thread were they
asked for help in the first place.

It must be possible, as Nginx’s own mailing lists are
managed by Mailman (although under FreeBSD).
But, as of Nov.2011, I have not found a single site with clear
instructions on howto setup a fully working Mailman using Ubuntu/Debian

  • Nginx + fcgiwrap (or any other cgi wrapper).

To make things work for you, you could probably try a new “location
/cgi-bin/ {}” block which rewrites to the same url without the
“/cgi-bin” at the start.

I have already tried many combinations of that, but without
achieving a fully working setup.

…remove the string “/cgi-bin” from two lines up there. (And you could
probably even remove the “/mailman” too.)

Done that too, but also without success.

Your nginx is not configured to serve from the /cgi-bin urls, but is
from the others.

I agree, but having spent more than a few hours running in circles, I do
not know what else to change.
Sometimes Igor or Maxim just kick in and are able to sort it out.

(Note: I haven’t tested any of this.)

But at least you tried to help and did take the time to share your
ideas, and for that I thank you.

M.

On Thu, Nov 11, 2010 at 06:12:31PM +0000, Mark A. wrote:

And then Igor S. committed ‘try_files’ to Nginx and
Alias /pipermail/ /var/lib/mailman/archives/public/
rewrite ^ /$args;
managed by Mailman (although under FreeBSD).

Sometimes Igor or Maxim just kick in and are able to sort it out.

(Note: I haven’t tested any of this.)

But at least you tried to help and did take the time to share your
ideas, and for that I thank you.

Please look this:
http://nginx.org/pipermail/nginx/2010-October/023255.html


Igor S.
http://sysoev.ru/en/

On Thu, Nov 11, 2010 at 06:12:31PM +0000, Mark A. wrote:

On Thu, 11 Nov 2010 05:35:46 +0300,[email protected] wrote:

Hi there,

I thank you for your attempt at trying to help me.

You’re welcome.

We can keep trying, if you’re happy to.

Well, the truth is that Mailman works out of the box using Apache on
Ubuntu/Debian Linux, using a config file
named /etc/mailman/apache.conf, which includes these lines:
ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/
Alias /pipermail/ /var/lib/mailman/archives/public/
Alias /images/mailman/ /usr/share/images/mailman/

As far as I can see, the debian configuration is not the same as the
mailman-default configuration. So if you change the urls handled by the
web server, you must also change the urls generated by mailman.

In the previous mail, it looks like the mailman and web server
configurations were not synchronised.

I have tried many changes to both my nginx config file and to mailman’s
mm_cfg.py.

It looks like it would be best to decide what config you want, and then
work to that. The wiki page you referenced,
Mailman | NGINX,
suggests to install from packages, and then configure according to the
mailman web site. And then suggests an nginx configuration based on that
mailman configuration, not the original configuration. I think.

At each stage, make one change for one reason, and see that it works
as expected.

(I think it’s a slight shame that the wiki page doesn’t specify what
versions of software were used in that recipe; and there also seem to
be enough missing parts that it’s not really a recipe at all. “Configure
mailman”, “add some cgi processor”. But this is a good chance for
someone
who wants to set it up, to note exactly what they did, so that the
next
person with the same problem has a harder-to-misunderstand recipe.)

For example:

And, for instance, it almost does the job by just using:
root /usr/lib/cgi-bin/mailman/;
location = / {
rewrite ^ /listinfo last;
}
location /cgi-bin/mailman/ {
rewrite ^ /$args;
}

there, I’m not sure what urls you are expecting to have work. Ones that
start with “/mailman”, or “/cgi-bin/mailman”, or “/cgi-bin”, or all of
the above. mm_cfg.py matters here too.

But there are administrative areas that still do not work.

When you next have a looks-like-it-should-work configuration, and you
see
some oddities like this, please include the request made, the expected
result, and the actual result – that should make it easier for someone
to see what is happening.

After an extensive search in the web, it seems that this same problem
surfaces from time to time and those who ask for help, either stop
using Nginx to serve Mailman, or just abandon the thread were they
asked for help in the first place.

It must be possible, as Nginx’s own mailing lists are
managed by Mailman (although under FreeBSD).

I don’t see any mention of “fastcgi” or “fcgi” or “fcgiwrap” when
searching on the mailman wiki, http://wiki.lists.org/. Maybe mailman
doesn’t work under fastcgi at all? From the
Mailman | NGINX
page, it presumably did work for whoever wrote it.

But, as of Nov.2011, I have not found a single site with clear
instructions on howto setup a fully working Mailman using Ubuntu/Debian

  • Nginx + fcgiwrap (or any other cgi wrapper).

As per Igor’s mail, there was a thread here a few weeks ago where
someone was trying to proxy the cgi stuff to a cgi-enabled web server,
and the configuration used by the nginx server. I didn’t see a follow-up
saying either “that works for me”, or “still broken, here’s what I do,
what I see, and what I expect to see, please help more”

…remove the string “/cgi-bin” from two lines up there.

Done that too, but also without success.

That looks to me like the most likely to succeed.

nginx.conf exactly as it was sent the last time, and the 8 characters
“/cgi-bin” removed from two config lines in mm_cfg.py. What requests
do you make, and what responses do you see? (“curl -i” or “curl -v”
can be very handy in finding out exactly what is going on, as can the
nginx debug log.)

Your nginx is not configured to serve from the /cgi-bin urls, but is
from the others.

I agree, but having spent more than a few hours running in circles, I do
not know what else to change.

I know it can get frustrating running in circles.

If Igor’s “proxy cgi, don’t try to force it to be fastcgi” configuration
isn’t one you want to try, then I suggest to go back to the state when
you sent the first mail, and adjust mm_cfg.py.

Note: there is a recent mailman thread, ending at
http://www.mail-archive.com/[email protected]/msg57853.html,
which suggests that the mailman stuff was failing because the fastcgi
system in that setup was not defining PATH_INFO correctly.

After you’ve expunged the /cgi-bin urls, you may be able to see whether
that problem affects your fastcgi setup (I don’t see explicit version
numbers in that mailman thread).

Good luck with it,

f

Francis D. [email protected]

On Thu, 11 Nov 2010 21:22:08 +0300, Igor S. [email protected] wrote:

Please look this:
Mailman with nginx and thttpd

Problem solved. Thanks Igor.
As usually, your hint just pointed me in the right
direction.

I leave here the setup procedure:
“Howto setup mailman 2.1.13, using nginx 0.8.53, thttpd 2.25b-11, over
Ubuntu 10.10/debian”

install & configure the thttpd cgi server

sudo apt-get install thttpd

change /etc/default/thttpd to have ENABLED=yes

change /etc/thttpd/thttpd.conf to have:

port=8000
dir=/usr/lib/cgi-bin
nochroot
user=www-data
cgipat=/**
throttles=/etc/thttpd/throttle.conf
host=127.0.1.1
logfile=/var/log/thttpd.log
sudo /etc/init.d/thttpd restart # restart using new settings

install & configure mailman

sudo apt-get install mailman
sudo touch /usr/lib/cgi-bin/mailman/favicon.ico # fake a favicon

create the mailman admin mailing list

sudo newlist -l en -q mailman [email protected] SOMEPWD

must choose an MTA, even if it is MTA=None

sudo sed -i ‘s/.(MTA=None.)/\1/’ /etc/mailman/mm_cfg.py
#set mailman permissions
sudo chown www-data /var/lib/mailman/archives/private
sudo chmod o-x /var/lib/mailman/archives/private
sudo /usr/sbin/check_perms -f

start mailman

sudo /etc/init.d/mailman start

create a nginx cfg file

create a file /etc/nginx/sites-available/mailman

use location /cgi-bin/mailman/ instead of /cgi-bin/ , otherwise

“(any list…) Administrator Authentication” will not work.

server {
listen 80;
server_name mail.example.com;
access_log /var/log/nginx/mailman.access.log;
error_log /var/log/nginx/mailman.error.log;
root /usr/lib/cgi-bin/mailman;
location = /mailman/ {
proxy_pass http://127.0.1.1:8000/mailman/listinfo;
proxy_set_header Host $host;
}
location /mailman/ {
proxy_pass http://127.0.1.1:8000/mailman/;
proxy_set_header Host $host;
}
location = /cgi-bin/mailman/ {
proxy_pass http://127.0.1.1:8000/mailman/listinfo;
proxy_set_header Host $host;
}
location /cgi-bin/mailman/ {
proxy_pass http://127.0.1.1:8000/mailman/;
proxy_set_header Host $host;
}
location /images/mailman {
alias /var/lib/mailman/icons;
}
location /pipermail {
alias /var/lib/mailman/archives/public;
autoindex on;
}
}

sudo ln
-svf /etc/nginx/sites-available/mailman /etc/nginx/sites-enabled/
sudo /usr/sbin/nginx -s reload

Run mailman from: http://mail.example.com/mailman

M.

On Fri, 12 Nov 2010 16:03:00 +0000, Francis D. [email protected]
wrote:

We can keep trying, if you’re happy to.

Thank you for your good will.
Following a hint from Igor, I have solved the problem.

I am publishing the procedure under the name “Howto setup mailman +
nginx + thttpd cgi server + ubuntu 10.10 (debian)”, elsewhere in this
mailing list.

M.