Apache & Python 500 Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian

    #1

    Apache & Python 500 Error

    Hello,

    i have an apache 1.3 server with python on debian. Python works fine but
    the scripts wont´t work.

    This easy script i want to do on apache:

    #!/usr/bin/python
    import os
    os.getcwd()

    in apache config i have done this:

    <Directory /var/www/python>
    AddHandler python-program .py
    PythonHandler python
    Order allow,deny
    Allow from all
    #PythonDebug On
    </Directory>

    the script is in this directory /var/www/python

    but i get an 500 error everytime, with "every" script - why that - i´m
    newbie - sorry for that :)

    greetings from germany to newsgroup
    christian
  • Fuzzyman

    #2
    Re: Apache &amp; Python 500 Error

    What does the error log report ?

    It is *possible* that you are getting an error 500 because your are
    not emitting valid headers.

    Try this instead :

    #!/usr/bin/python

    print 'Content-Type: text/plain\r'
    print '\r'
    import os
    print os.getcwd()
    Regards,


    Fuzzy
    http://www.voidspace.org.uk/python/index.shtml

    Comment

    • Jeremy Bowers

      #3
      Re: Apache &amp; Python 500 Error

      On Wed, 02 Feb 2005 10:28:46 +0100, Christian wrote:
      [color=blue]
      > Hello,
      >
      > i have an apache 1.3 server with python on debian. Python works fine but
      > the scripts wont´t work.[/color]

      I know what your problem is.

      But first, check your apache error log. Then you will know what your error
      is, too.

      If you can't fix it after you try to fix the error in the log, or you
      don't understand the log entry, post your program and all relevant log
      entries. You did good posting your Apache configuration, but we also need
      the log entries.

      That said, fuzzyman is right, but keep this in mind for future help
      requests.

      Comment

      Working...