Running mailman within a domain

Aleksandar Lazic al-nginx at none.at
Thu Jun 14 08:53:11 UTC 2012


Hi Patrick,

On 14-06-2012 00:43, Patrick Ben Koetter wrote:
> Greetings,
>
> this is my first take at nginx. I try to add /cgi-bin/mailman/... to 
> an
> existing server instance (mail.sys4.de). At the moment I can call 
> scripts
> directly e.g. <https://mail.sys4.de/cgi-bin/mailman/listinfo> works.
>
> What I fail to accieve is getting access to lists e.g.
> <https://mail.sys4.de/cgi-bin/mailman/listinfo/users>. The Browser 
> receives a
> 403 and the fast_cgi wrapper reports:
>
>   Cannot chdir to script directory 
> (/usr/lib/cgi-bin/mailman/listinfo)" while
>   reading response header from upstream
>
>
> What is it I am doing wrong?

I don't know too much about mailman, so I try to guess.

The

/usr/lib/cgi-bin/mailman

is the script which should be executed right?

The

/listinfo
&
/listinfo/users

should be the path info, right?

> This is my nginx configuration to include mailman into the website:
>
>         location /cgi-bin/mailman {
>                root /usr/lib/;

my suggestion:
-                fastcgi_split_path_info 
(^/cgi-bin/mailman/[^/]*)(.*)$;
+                fastcgi_split_path_info (^/cgi-bin/mailman)/(.*)$;
>                include /etc/nginx/fastcgi_params;
>                fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
>                fastcgi_param PATH_INFO $fastcgi_path_info;
>                fastcgi_param PATH_TRANSLATED
> $document_root$fastcgi_path_info;
>                fastcgi_intercept_errors off;
>                fastcgi_pass unix:/var/run/fcgiwrap.socket;
>         }
>         location /images/mailman {
>                alias /usr/share/images/mailman;
>         }
>         location /pipermail {
>                alias /var/lib/mailman/archives/public;
>                autoindex on;
>         }

output of pcretest

###
   re> |(^/cgi-bin/mailman)/(.*)$|
data> /cgi-bin/mailman/listinfo
  0: /cgi-bin/mailman/listinfo
  1: /cgi-bin/mailman
  2: listinfo
data> /cgi-bin/mailman/listinfo/users
  0: /cgi-bin/mailman/listinfo/users
  1: /cgi-bin/mailman
  2: listinfo/users
###

> /etc/nginx/fastcgi_params contains these settings:

[snipp]

> My error log gives this output:

[snipp]

> 2012/06/14 00:39:48 [debug] 27873#0: *13 http uri:
> "/cgi-bin/mailman/listinfo/users"

[snipp]

> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SCRIPT_FILENAME"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var:
> "/usr/lib/cgi-bin/mailman/listinfo/users"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "SCRIPT_FILENAME: /usr/lib/cgi-bin/mailman/listinfo/users"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SCRIPT_NAME"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var:
> "/cgi-bin/mailman/listinfo"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "SCRIPT_NAME:
> /cgi-bin/mailman/listinfo"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "REQUEST_URI"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var:
> "/cgi-bin/mailman/listinfo/users"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "REQUEST_URI:
> /cgi-bin/mailman/listinfo/users"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "DOCUMENT_URI"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var:
> "/cgi-bin/mailman/listinfo/users"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "DOCUMENT_URI: /cgi-bin/mailman/listinfo/users"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "DOCUMENT_ROOT"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "/usr/lib"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "DOCUMENT_ROOT: /usr/lib"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SERVER_PROTOCOL"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "HTTP/1.1"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "SERVER_PROTOCOL: HTTP/1.1"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy:
> "GATEWAY_INTERFACE"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: "CGI/1.1"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "GATEWAY_INTERFACE: CGI/1.1"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SERVER_SOFTWARE"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: "nginx/"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "1.1.19"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "SERVER_SOFTWARE: nginx/1.1.19"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "REMOTE_ADDR"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: 
> "178.27.33.0"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "REMOTE_ADDR:
> 178.27.33.0"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "REMOTE_PORT"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "35670"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "REMOTE_PORT: 
> 35670"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SERVER_ADDR"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: 
> "194.126.158.57"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "SERVER_ADDR:
> 194.126.158.57"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SERVER_PORT"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "443"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "SERVER_PORT: 
> 443"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SERVER_NAME"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: 
> "mail.sys4.de"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "SERVER_NAME:
> mail.sys4.de"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: "HTTPS"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "on"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "HTTPS: on"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "REDIRECT_STATUS"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: "200"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "REDIRECT_STATUS: 200"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "SCRIPT_FILENAME"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "/usr/lib"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var:
> "/cgi-bin/mailman/listinfo"



> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param:
> "SCRIPT_FILENAME: /usr/lib/cgi-bin/mailman/listinfo"



> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script copy: 
> "PATH_INFO"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 http script var: "/users"
> 2012/06/14 00:39:48 [debug] 27873#0: *13 fastcgi param: "PATH_INFO: 
> /users"

[snipp]

> Thanks
>
> p at rick

I'am sure you have read this but I post it here as reminder ;-)

http://www.nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info

Hth

Aleks



More information about the nginx mailing list