Configuraion to run pyhton script on ubuntu 12.04

Jaiky jaiprakashsingh213 at gmail.com
Mon Jul 29 06:44:49 EDT 2013


Problem solved regarding cgi configuration on ubuntu 12.04 lts


Concept:-)
file used:-)
   /etc/apache2/httpd.conf  
   /etc/apache2/sites-available/default

############################################################################
steps done 1:-)

in /etc/apache2/httpd.conf 
added line 


#########for link localhost/python2/hello.py   
ScriptAlias /python2/ /var/www/python2/  

<Directory "/var/www/python2/">
    AllowOverride None
    Options +Indexes FollowSymLinks +ExecCGI   -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    #######fro runing of python script
    AddHandler cgi-script cgi pl mod_python .py
    PythonHandler mod_python.publisher | .py
    AddHandler mod_python .psp .psp_
    PythonHandler mod_python.psp | .psp .psp
    PythonDebug On
</Directory>

#########################################################################

step done 2:-)

added line 

#######fro runing of python script
    AddHandler cgi-script cgi pl mod_python .py
    PythonHandler mod_python.publisher | .py
    AddHandler mod_python .psp .psp_
    PythonHandler mod_python.psp | .psp .psp
    PythonDebug On

between 

        <Directory "/var/www/">
        -----------------
        ---------------
        HERE I ADDED Line
        -------------
        -----------------
        </Directory>


        <Directory "/usr/lib/cgi-bin">
        -----------------
        ---------------
        HERE I ADDED Line
        -------------
        -----------------
        </Directory>
         

############################################################################

Step Done 3:-)

added line  
in /etc/apache2/mods-available/mod_python.conf

######mod_python.conf i created


<IfModule mod_python.c>
        AddHandler mod_python .py .psp
        PythonHandler mod_python.publisher | .py
        PythonHandler mod_python.psp | .psp
</IfModule>









More information about the Python-list mailing list