Solved

Pythonoption directive

Posted on 2006-11-27
3
156 Views
Last Modified: 2011-04-14
hi,
im trying to read thevalues from pythonoption directive in httpd.conf , and i have used this

options = req.get_options()

which python package needs to be import to use the above code?

I suppose its
from mod_python import apache

But in my machine, it cannt seem to find that package. How do i install the package. I m using debian linux


thanks


0
Comment
Question by:jyotishb
3 Comments
 
LVL 15

Accepted Solution

by:
mish33 earned 500 total points
ID: 18025564
That package is only available to python scripts running under apache (mod_python) hadler.

from mod_python import apache

def handler(req):

    req.content_type = "text/plain"
    options = req.get_options()
    for opt in options.iteritems():
        req.write("%s=%s" % opt)

    return apache.OK

See http://www.ics.uci.edu/~sources/apache/mod_python/tut-what-it-do.html

Also see http://www.ics.uci.edu/~sources/apache/mod_python/installation.html
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article will show the steps for installing Python on Ubuntu Operating System. I have created a virtual machine with Ubuntu Operating system 8.10 and this installing process also works with upgraded version of Ubuntu OS. For installing Py…
Flask is a microframework for Python based on Werkzeug and Jinja 2. This requires you to have a good understanding of Python 2.7. Lets install Flask! To install Flask you can use a python repository for libraries tool called pip. Download this f…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now