Apache and Python and Ubuntu

grahamd at dscpl.com.au grahamd at dscpl.com.au
Wed Mar 29 17:48:07 EST 2006


msuem... at jjhill.org wrote:
> I've create an Ubuntu Linux box, which comes pre-installed with Python
> (I've added the libapache2-mod-python throught the app manager).  I've
> created  .cgi and .py simple programs in the www root of apache.
>
> The problem is the programs just dump the contents to the browser in
> plain text.  Or, in the case of the .py files, I am prompted to
> download the .py file.  How can I get apache to recognize that it
> should execute the .cgi script?
>
> Is there any special thing I need to do to apache to get it to know
> that the python interpreter should be used for all .cgi files?

You do not need mod_python if you want to use Python in traditional
CGI scripts. Simply follow the Apache instructions for setting up
CGI scripts and ignore mod_python all together.

If you really did want to use mod_python, consider reading:

  http://www.dscpl.com.au/articles/modpython-001.html

It provides more detailed instructions on getting a first test handler
running.

Graham




More information about the Python-list mailing list