FAQ
Hello,

I am new to Python and am trying to setup Apache to serve Python using
mod_python. I'm using a Windows XP box. here is a list of steps i
followed for the installation:

1. Installed Apache 2.2.6
2. Installed Python 2.5.1
3. Installed mod_python 3.3.1

I then included the line
LoadModule python_module modules/mod_python.so in httpd.conf

I had this one line python file (print "Hello") in htdocs of Apache. i
then started Apache and it merely echoed my code print and all.

i did some reading and thought something might be wrong with my
sys.path. This is what it reads:
'C:\\WINDOWS\\system32\\python25.zip', 'C:\\Python25\\DLLs', 'C:\
\Python25\\Lib', 'C:\\Python25\\Lib\\plat-win', 'C:\\Python25\\Lib\
\lib-tk', 'C:\\Python25', 'C:\\Python25\\Lib\\site-packages'

Somebody had said this problem could be because of the .zip file at
the beginning of the path but I haven't been able to get rid of it or
solve my problem in any other way. My Apache error file has the
entries:

[Mon Jan 07 04:11:11 2008] [error] python_init: Python executable
found 'C:\\Program Files\\Apache Software Foundation\\Apache2.2\\bin\
\httpd.exe'.
[Mon Jan 07 04:11:11 2008] [error] python_init: Python path being used
'C:\\WINDOWS\\system32\\python25.zip;C:\\Python25\\Lib;C:\\Python25\
\DLLs;C:\\Python25\\Lib\\lib-tk;;C:\\Program Files\\Apache Software
Foundation\\Apache2.2\\bin'.
[Mon Jan 07 04:11:11 2008] [notice] mod_python: Creating 8 session
mutexes based on 0 max processes and 250 max threads.


Could someone please tell me what I'm doing wrong?

Search Discussions

  • Tim Roberts at Jan 8, 2008 at 6:31 am

    Gowri wrote:
    I am new to Python and am trying to setup Apache to serve Python using
    mod_python. I'm using a Windows XP box. here is a list of steps i
    followed for the installation:

    1. Installed Apache 2.2.6
    2. Installed Python 2.5.1
    3. Installed mod_python 3.3.1

    I then included the line
    LoadModule python_module modules/mod_python.so in httpd.conf

    I had this one line python file (print "Hello") in htdocs of Apache.
    Did you put it in a file called "hello.py"? Did you create an AddHandler
    for .py files? Did you create a PythonHandler referring to hello.py?
    --
    Tim Roberts, timr at probo.com
    Providenza & Boekelheide, Inc.
  • Graham Dumpleton at Jan 8, 2008 at 11:08 pm

    On Jan 8, 5:31?pm, Tim Roberts wrote:
    Gowri wrote:
    I am new to Python and am trying to setup Apache to serve Python using
    mod_python. I'm using a Windows XP box. here is a list of steps i
    followed for the installation:
    1. Installed Apache 2.2.6
    2. Installed Python 2.5.1
    3. Installedmod_python3.3.1
    I then included the line
    LoadModule python_module modules/mod_python.so in httpd.conf
    I had this one line python file (print "Hello") in htdocs of Apache.
    Did you put it in a file called "hello.py"? ?Did you create an AddHandler
    for .py files? ?Did you create a PythonHandler referring to hello.py?
    And did you (OP) read the mod_python documentation enough to know that
    'print "Hello" is in no way going to work with mod_python. You cannot
    just throw an arbitrary bit of Python code in a file using 'print'
    statements and it will somehow magically work. You need to write your
    code to the mod_python APIs.

    Graham

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJan 7, '08 at 10:38a
activeJan 8, '08 at 11:08p
posts3
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase