Welcome! Log In Create A New Profile

Advanced

Re: Bug in NginxHttpFcgiModule's fastcgi_split_path_info function?

Francis Daly
November 10, 2010 11:56AM
On Wed, Nov 10, 2010 at 11:03:01AM +0000, Mark Alan wrote:

Hi there,

> While using Ubuntu 10.10+Nginx 0.8.53+gnosek's fcgiwrap to serve a
> Mailman mailing list server
> http://www.gnu.org/software/mailman/index.html, that was installed as
> stated in http://wiki.nginx.org/Mailman, I keep getting the error:
>
> [error] FastCGI sent in stderr: "Cannot get script name, is
> DOCUMENT_ROOT and SCRIPT_NAME set and is the script executable?"

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.

> These attempts were successful:
> http://mail.example.com/ => shows standard Mailman Welcome page,
> browser bar shows: http://mail.example.com/mailman/listinfo

The configuration shows that "/" is (externally) rewritten to
/mailman/listinfo, which is why that appears in the browser bar.

The browser then makes a fresh request for /mailman/listinfo, which is
handled by your location /mailman/ {} block, where fastcgi_split_path_info
sets $fastcgi_script_name to "/mailman/listinfo", and $fastcgi_path_info to
"", and things work. Presumably the fastcgi server is able to process
the file /usr/lib/cgi-bin/mailman/listinfo.

> http://mail.example.com/listinfo => shows standard Mailman Welcome
> page, this time browser bar shows: http://mail.example.com/listinfo

Here, /listinfo is handled by the location / {} block, which does a
rewrite (internally) to /mailman/listinfo, which is handled the same as
in the previous case, and things work.

> http://mail.example.com/admin => shows standard Mailman Admin Links
> page, browser bar shows: http://mail.example.com/admin

Analogous to /listinfo, internal rewrite to /mailman/admin,
$fastcgi_script_name is "/mailman/admin", $fastcgi_path_info is "",
things work.

> http://mail.example.com/images/mailman/ => shows "403 Forbidden"
> page, as expected http://mail.example.com/pipermail/ => shows "Index
> of /pipermail/" page, as expected
> http://mail.example.com/mailman/private => shows "You must specify a
> list.", as expected

The first two have separate location blocks; the third is similar to
the redirected initial request above.

> All other attempts were unsuccessful, such as:
> Clicking in "the mailing list overview page" link
> http://mail.example.com/cgi-bin/mailman/listinfo or on the "List"
> "Mailman" link,

Same as /listinfo case, handled by the location / {} block, internal
rewrite to /mailman/cgi-bin/mailman/listinfo, $fastcgi_script_name is
"/mailman/cgi-bin", $fastcgi_path_info is "/mailman/listinfo", and
things don't work on the fastcgi server because it can't find the file
to process. There probably is no file /usr/lib/cgi-bin/mailman/cgi-bin.

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.

But it seems more sensible to just...

> My, default and unchanged, /etc/mailman/mm_cfg.py, that has:
> DEFAULT_URL_PATTERN = 'http://%s/cgi-bin/mailman/'
> PRIVATE_ARCHIVE_URL = '/cgi-bin/mailman/private'
> DEFAULT_EMAIL_HOST = 'mail.example.com'
> DEFAULT_URL_HOST = 'mail.example.com'

....remove the string "/cgi-bin" from two lines up there. (And you could
probably even remove the "/mailman" too.) Your nginx is not configured
to serve from the /cgi-bin urls, but is from the others.

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

The page http://wiki.nginx.org/Mailman suggests to configure mailman by
following a separate website. Possibly the information has gotten out
of sync.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Bug in NginxHttpFcgiModule's fastcgi_split_path_info function?

Mark Alan November 10, 2010 06:14AM

Re: Bug in NginxHttpFcgiModule's fastcgi_split_path_info function?

Francis Daly November 10, 2010 11:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready