Saturday, August 26, 2017

Enable both .py and .psp in Apache2

  1. Install the mod_python module for Apache2
  2. Open the default file at /etc/apache2/sites-available/
    (Note that you will need super-user privileges for editing this)
       gedit /etc/apache2/sites-available/default
  3. Go to the section
    
       Options Indexes FollowSymLinks MultiViews
       AllowOverride None
       Order allow,deny
       allow from all   #Uncomment this directive is you want to see apache2's
       #default start page (in /apache2-default) when you go to /
       #RedirectMatch ^/$ /apache2-default/
    
  4. Append this to the end of section
       AddHandler mod_python .py .psp
       PythonHandler mod_python.publisher|.py
       PythonHandler mod_python.psp|.psp
       PythonDebug On
    To read more about Apache directives, visit http://httpd.apache.org/docs/1.3/mod/mod_mime.html
  5. Restart Apache2:
    /etc/init.d/apache2 resart
  6. That’s all folks!
    Now you can play with .py and .psp