From ArchWiki
Revision as of 14:41, 1 October 2011 by T67t67 (talk | contribs) (added icons)
Jump to: navigation, search

Installing Mailman is pretty easy, but getting the web stuff to work was a little tricky.

# pacman -S mailman fcgiwrap nginx

We need to wrap mailman with fcgiwrap in order to get nginx to understand what's going on. After this installs, run this to set up your first list:

# /usr/lib/mailman/bin/newlist mailman

This will create a new mailing list, 'mailman.' This is required for mailman to start. To get mailman running, do this:

# /etc/rc.d/mailman start

You should see a message that it worked. Now that you've got mailman running, we need to get it hooked up through fcgi. Start fcgiwrap by doing this:

 # /etc/rc.d/fcgiwrap start

This will start fcgiwrap on localhost:9001. If you'd like to change the configuration, it's in /etc/conf.d/fcgiwrap.

Open up the nginx config file:

 # vim /etc/nginx/conf/nginx.conf

and add a section like this:

 server {
       root /usr/lib/mailman/cgi-bin;

       location = / {
               rewrite ^ /mailman/listinfo permanent;

       location / {
               rewrite ^ /mailman$uri;

       location ~ ^/mailman(/[^/]*)(/.*)?$ {
               fastcgi_split_path_info (^/mailman/[^/]*)(.*)$;
               include conf/fastcgi_params;
               fastcgi_param GATEWAY_INTERFACE CGI/1.1;
               fastcgi_param SCRIPT_FILENAME $document_root$1;
               fastcgi_param PATH_INFO $fastcgi_path_info;
               fastcgi_param PATH_TRANSLATED $document_root$2;

       location /icons {
               alias /usr/lib/mailman/icons/;
               autoindex on;
       location /pipermail {
               alias /var/lib/mailman/archives/public;
               autoindex on;

Then start up nginx:

# /etc/rc.d/nginx start

And you should be able to visit, and it should all work!