|
-
May 19th, 2005, 08:57 AM
#1
Installing extension for Apache
I know this is a bit OT, but I think you guys has the biggest possibility to solve it anyway, so let me try.
I have to install an "extension" to apache. The mod_python extension. But in one of the steps I have to edit the httpd.conf file. But I am not 100% sure where to put it.. ...some help?
In the instructions it says:
Edit your httpd.conf file and update the AddHandler parameter
On you local machine edit your c:\apache\Apache2\conf\httpd.conf file and add
LoadModule python_module libexec/mod_python.so
Code:
<Directory "c:/apache/Apache2/htdocs/test">
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
</Directory>
Where test is the directory you will add your application and mptest.py will be the python file initial app that runs.
Now, where do I put this, and should the blue part also go there? The only place I can find anything about AddHandler in my httpd.conf file is here. Is this the place, if so, does it matter where in that part?
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi
#
# For files that include their own HTTP headers:
#
#AddHandler send-as-is asis
#
# For server-parsed imagemap files:
#
#AddHandler imap-file map
#
# For type maps (negotiated resources):
# (This is enabled by default to allow the Apache "It Worked" page
# to be distributed in multiple languages.)
#
AddHandler type-map var
Thanks for my helping me with answering my n00bish question...
ØØ
Last edited by NoteMe; May 20th, 2005 at 04:36 AM.
-
May 19th, 2005, 10:13 AM
#2
Re: Installing extension for Apache
Solved it....Not sure if it actualy mattered, but I just wrote it somewhere, and it worked. At least after I found out that the mod_python module was in the Apache2/modules folder, rather then in the Apache2/libexec folder...
ØØ
-
May 20th, 2005, 03:11 AM
#3
Re: Installing extension for Apache
I think I cheered too much last night before I went home...
I only tested that the apache server was working, and that I was able to get into the Apache server page through my browser and http://localhost. But when I was testing my Python script, I noticed that it wasn't working too well... ...I get this error message:
Mod_python error: "PythonHandler mptest"
Traceback (most recent call last):
File "C:\PYTHON~1\Lib\site-packages\mod_python\apache.py", line 287, in HandlerDispatch
log=debug)
File "C:\PYTHON~1\Lib\site-packages\mod_python\apache.py", line 457, in import_module
module = imp.load_module(mname, f, p, d)
File "C:/Apache2/htdocs/python/\mptest.py", line 3
def handler(req):
^
SyntaxError: invalid syntax
I have higlighted a line that looks very weird.. ...but the actual error is on the first line, on the def word. The first word in my small script that looks like this:
Code:
from mod_python import apache
def handler(req):
req.write("Hello World!")
return apache.OK
Anyone got any idea about what can be wrong here?
ØØ
-
May 20th, 2005, 04:36 AM
#4
Re: Installing extension for Apache
OMG...I feel stupid now... ...It was my code that had the error, nothing about the instalation.
I had written:
Code:
from mod_python import apache
def handler(req):
req.write("Hello World!")
return apache.OK
And it was supposed to be:
Code:
from mod_python import apache
def handler(req):
req.write("Hello World!")
return apache.OK
ØØ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|