[Mailman-Users] Internal 500 Error (Ubuntu jaunty / Mailman2.1.12/ Python 2.6.2)

Mark Sapiro mark at msapiro.net
Tue Jun 23 17:14:53 CEST 2009


Dev Guy wrote:

>On Tue, Jun 23, 2009 at 5:10 AM, Mark Sapiro <mark at msapiro.net> wrote:
>
>>
>> The OP and I had a conversation on the #mailman channel at freenode. We
>> determined that he could successfully run
>>
>> sudo -u www-data /bin/sh -c "PATH_INFO=;export
>> PATH_INFO;HTTP_HOST=www.example.com;export
>> HTTP_HOST;REQUEST_METHOD=GET;export REQUEST_METHOD;
>> /usr/local/mailman/cgi-bin/listinfo"
>>
>> (with appropriate changes to host and path) from the command line and
>> the listinfo CGI would produce appropriate output, so the problem is
>> apparently some issue with the way apache is (or isn't) invoking the
>> CGI. The OP says suEXEC is not involved, and I had no other ideas.
>>
>
>I spent some time with Apache guys and they said the way the script is being
>executed doesn't tell us everything and that I should simply run it without
>setting up environments, etc. When I do, I get the same result (500 internal
>error).


What are you trying to say here? It seems you are saying that if you run

sudo -u www-data /bin/sh -c "/usr/local/mailman/cgi-bin/listinfo"

or equivalent, you get a 500 server error, but that makes no sense as
Apache isn't even involved in that.


>I tried setting up ScriptLog to see what is going on, but since it's a
>binary, it doesn't produce any logs out of it. I ran 'ldd' on 'listinfo' and
>'admin', etc. to see if I'm missing any libraries, which I am not.
>
>I'm just stuck here.


Put the following script in your mailman/cgi-bin/ directory with name
'printenv' and mode 755 (rwxr-xr-x)

-------------------------cut here-------------------
#!/usr/bin/python

import os

def printenv():
    for n,v in os.environ.items():
        print '%s: %s<br>' % (n,v)

def generateFormDocument():
    print 'Content-type: text/html'
    print
    print '<HTML><HEAD><TITLE>Print Environment</TITLE></HEAD><BODY>'
    printenv()
    print ' </BODY> </HTML>'

if (__name__=='__main__'):
    generateFormDocument()
-------------------------cut here-------------------

and then visit your equivalent of
http://www.example.com/mailman/printenv (i.e. the same URL you'd use
to visit the admin or listinfo pages but with 'admin' or 'listinfo'
replaced with 'printenv'.

It should print the environment variables passed by Apache to the CGI.
What does happen?

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list