You haven't mentioned about the AddHandler directive.

Not that it matters, the actual problem is probably more to do with
fact that you stuck the .py file in the CGI bin directory. I didn't
catch that before.

So, put the .py script in a different directory.

That or show me how the cgi-bin directory is configured.

In short, you need to stop script being run as CGI script.

Graham

2009/3/7 aj <[email protected]>:
>
> Hi Graham,
>
> Thanks for the suggestions.  I disabled mod_python as you recommended
> and restarted Apache.  I then found a pesky .htaccess file in a higher
> directory that had some mod_python handler directives, so I removed it
> too.  Now I'm back to square one:
>
> [Fri Mar 06 16:01:27 2009] [notice] SIGHUP received.  Attempting to
> restart
> [Fri Mar 06 16:01:28 2009] [warn] mod_wsgi: Compiled for Python/2.4.4.
> [Fri Mar 06 16:01:28 2009] [warn] mod_wsgi: Runtime using Python/
> 2.4.1.
> [Fri Mar 06 16:01:28 2009] [warn] mod_wsgi: Python module path '/usr/
> lib/python24.zip:/usr/lib/python2.4/:/usr/lib/python2.4/plat-linux2:/
> usr/lib/python2.4/lib-tk:/usr/lib/python2.4/lib-dynload'.
> [Fri Mar 06 16:01:28 2009] [notice] Apache/2.0.54 (Debian GNU/Linux)
> PHP/5.2.0-8+etch7~bpo.1 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_wsgi/2.1-
> BRANCH Python/2.4.1 configured -- resuming normal operations
>
> ==> /var/log/apache2/access.log <==
> 10.10.88.182 - - [06/Mar/2009:16:01:55 -0600] "GET /aj/cgi-bin/foobar/
> baz.py HTTP/1.1" 500 539 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1;
> en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6"
>
> ==> /var/log/apache2/error.log <==
> [Fri Mar 06 16:01:55 2009] [error] [client 10.10.88.182] (8)Exec
> format error: exec of '/var/www/aj/cgi-bin/foobar/baz.py' failed
> [Fri Mar 06 16:01:55 2009] [error] [client 10.10.88.182] Premature end
> of script headers: baz.py
>
>
> Thanks,
> -aj
>
> On Mar 6, 3:57 pm, Graham Dumpleton <[email protected]>
> wrote:
>> First off disable mod_python loading if you do not really need it as
>> it can interfere with mod_wsgi and causes crashes in some cases.
>>
>> Second, look through your Apache configuration for:
>>
>>   AddHandler cgi-script .py
>>
>> It looks like CGI is taking precedence and script isn't being handled
>> by mod_wsgi.
>>
>> Disable that AddHandler line for CGI.
>>
>> Graham
>>
>> 2009/3/7 aj <[email protected]>:
>>
>>
>>
>> > Hello,
>>
>> > I am trying to get a simple example to work with mod_wsgi and having
>> > issues.  It appears that the WSGIScriptAlias directive is being
>> > ignored by Apache on startup.  Here are the specifics:
>>
>> > # server configuration
>> > cat /etc/apache2/sites-enabled/000-default
>> > NameVirtualHost *:80
>> > <VirtualHost *:80>
>> >    ServerAdmin webmas...@localhost
>> >    DocumentRoot /var/www/
>>
>> >    WSGIScriptAlias /foobar /var/www/aj/cgi-bin/foobar/baz.py
>>
>> >    CustomLog /var/log/apache2/access.log combined
>> >    ErrorLog /var/log/apache2/error.log
>> >    LogLevel info
>>
>> > </VirtualHost>
>>
>> > # request, error log
>> > [Fri Mar 06 15:39:39 2009] [notice] SIGHUP received.  Attempting to
>> > restart
>> > [Fri Mar 06 15:39:39 2009] [notice] mod_python: Creating 8 session
>> > mutexes based on 20 max processes and 0 max threads.
>> > [Fri Mar 06 15:39:39 2009] [notice] mod_python: using mutex_directory /
>> > tmp
>> > [Fri Mar 06 15:39:40 2009] [warn] mod_wsgi: Compiled for Python/2.4.4.
>> > [Fri Mar 06 15:39:40 2009] [warn] mod_wsgi: Runtime using Python/
>> > 2.4.1.
>> > [Fri Mar 06 15:39:40 2009] [warn] mod_wsgi: Python module path '/usr/
>> > lib/python24.zip:/usr/lib/python2.4/:/usr/lib/python2.4/plat-linux2:/
>> > usr/lib/python2.4/lib-tk:/usr/lib/python2.4/lib-dynload'.
>> > [Fri Mar 06 15:39:40 2009] [notice] Apache/2.0.54 (Debian GNU/Linux)
>> > mod_python/3.3.1 Python/2.4.1 PHP/5.2.0-8+etch7~bpo.1 mod_ssl/2.0.54
>> > OpenSSL/0.9.7e mod_wsgi/2.1-BRANCH configured -- resuming normal
>> > operations
>>
>> > ==> /var/log/apache2/access.log <==
>> > 10.10.88.182 - - [06/Mar/2009:15:39:44 -0600] "GET /aj/cgi-bin/foobar/
>> > baz.py HTTP/1.1" 500 539 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1;
>> > en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6"
>>
>> > ==> /var/log/apache2/error.log <==
>> > [Fri Mar 06 15:39:44 2009] [error] [client 10.10.88.182] (8)Exec
>> > format error: exec of '/var/www/aj/cgi-bin/foobar/baz.py' failed
>> > [Fri Mar 06 15:39:44 2009] [error] [client 10.10.88.182] Premature end
>> > of script headers: baz.py
>>
>> > # contents of my test script
>> > mmdev0:/var/www/aj/cgi-bin/foobar# cat baz.py
>> > def application(environ, start_response):
>> >    status = '200 OK'
>> >    output = 'Hello World!'
>>
>> >    response_headers = [('Content-type', 'text/plain'), ('Content-
>> > Length', str(len(output)))]
>> >    start_response(status, response_headers)
>>
>> >    return [output]
>>
>> > # relevant packages
>> > mmdev0:/var/www/aj/cgi-bin/foobar# COLUMNS=120 dpkg -l|egrep "(apache2|
>> > python|wsgi)"|grep -v none
>> > ii  apache2                  2.0.54-5sarge2           next generation,
>> > scalable, extendable web server
>> > ii  apache2-common           2.0.54-5sarge2           next generation,
>> > scalable, extendable web server
>> > ii  apache2-mpm-prefork      2.0.54-5sarge2           traditional
>> > model for Apache2
>> > ii  apache2-threaded-dev     2.0.54-5sarge2           development
>> > headers for apache2
>> > ii  apache2-utils            2.0.54-5sarge2           utility programs
>> > for webservers
>> > ii  hw-mod-wsgi              0.1-7                    hostway
>> > packaging of mod_wsgi
>> > ii  hwcsi-hwm                1.22.7                   Hostway python
>> > library modules
>> > ii  libapache2-mod-perl2     1.999.21-1               Integration of
>> > perl with the Apache2 web server
>> > ii  libapache2-mod-php5      5.2.0-8+etch7~bpo.1      server-side,
>> > HTML-embedded scripting language (apache 2 module)
>> > ii  libapache2-mod-python    3.3.1-1hw1               Apache 2 module
>> > that embeds Python within the server
>> > ic  libapache2-mod-python2.3 3.1.3-hw3                An Apache 2
>> > module that embeds Python 2.3 within the server
>> > ii  python                   2.3.5-2                  An interactive
>> > high-level object-oriented language (default vers
>> > ii  python-gnuplot           1.7-5                    A Python
>> > interface to the gnuplot plotting program
>> > ii  python-numeric           23.8-1                   Numerical
>> > (matrix-oriented) Mathematics for Python
>> > ii  python-soappy            0.11.3-1                 SOAP Support for
>> > Python (SOAP.py)
>> > ii  python2.3                2.3.5-3sarge2hw0         An interactive
>> > high-level object-oriented language (version 2.3)
>> > ii  python2.3-crypto         2.0+dp1-2                cryptographic
>> > algorithms and protocols for Python
>> > ii  python2.3-dev            2.3.5-3sarge2hw0         Header files and
>> > a static library for Python (v2.3)
>> > ii  python2.3-ldap           2.0.4-1                  A LDAP interface
>> > module for Python 2.3
>> > ii  python2.3-mysqldb        1.2.1c2-1hw1             A Python
>> > interface to MySQL
>> > ii  python2.3-numeric        23.8-1                   Numerical
>> > (matrix-oriented) Mathematics for Python
>> > ii  python2.3-omniorb2       2.6-1                    omniORBpy2 -
>> > python 2.3
>> > ii  python2.3-omniorb2-omg   2.6-1                    omniORBpy2 -
>> > python 2.3 CORBA OMG standard files
>> > ii  python2.3-pyopenssl      0.6-2                    Python wrapper
>> > around the OpenSSL library
>> > ii  python2.3-xml            0.8.4-1                  XML tools for
>> > Python (2.3.x)
>> > ii  python2.4                2.4.1-2sarge1hw1         An interactive
>> > high-level object-oriented language (version 2.4)
>> > ii  python2.4-dev            2.4.1-2sarge1hw1         Header files and
>> > a static library for Python (v2.4)
>> > ii  python2.4-ldap           2.0.4                    A LDAP interface
>> > module for Python 2.4
>> > ii  python2.4-libxml2        2.6.16-7sarge1           Python 2.4
>> > bindings for the GNOME XML library
>> > ii  python2.4-mysqldb        1.2.1c2-1hw1             A Python
>> > interface to MySQL
>> > ii  python2.4-omniorb2       2.6-1                    omniORBpy2 -
>> > python 2.4
>> > ii  python2.4-omniorb2-omg   2.6-1                    omniORBpy2 -
>> > python 2.4 CORBA OMG standard files
>> > ii  python2.4-pydb2          1.1.2-hw12               IBM DB2 Python
>> > wrapper
>> > ii  python2.4-pyltxml        1.3                      Python interface
>> > for LT XML
>> > ii  python2.4-pyopenssl      0.6-2                    Python wrapper
>> > around the OpenSSL library
>> > ii  python2.4-xml            0.8.4-1                  XML tools for
>> > Python (2.4.x)
>>
>> > Thanks in advance for help!
>> > -aj
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to