8 Oct 06:24
Python - Apache2 doubt
From: Sivaram Kannan <siva.devel@...>
Subject: Python - Apache2 doubt
Newsgroups: gmane.org.user-groups.linux.ilugc
Date: 2008-10-08 04:27:18 GMT
Subject: Python - Apache2 doubt
Newsgroups: gmane.org.user-groups.linux.ilugc
Date: 2008-10-08 04:27:18 GMT
Hi all,
I have a doubt in accessing python through Apache. I have the
following configuration in my apache2/site-default/default file.
<Directory /var/www/python>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler first
PythonDebug on
</Directory>
My /var/www/first.py file looks like this.
def handler(req):
req.content_type = "text/plain"
req.write("Hello World!")
return apache.OK
def get_time():
html = """
<html><head>
<title>get_time function</title>
</head>
<body>
<h1>get_time function</h1>
(Continue reading)
RSS Feed