Since we’re focusing on Apache with mod_python, we’ll need to have apache installed. You can follow this article specifically for detailed instructions or you can simply use the following command to install the necessary Apache components:
sudo aptitude install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
Note that if you follow the article you can safely skip the entire PHP section and simply use the Apache section unless you actually have a need to install PHP5. If you didn’t follow the article and just used the command above now might be a good time to visit your slice IP in your browser and ensure you get the default “It works!” page from apache.
If you do not get the “It works!” page, apache may not have installed correctly, you may have an existing apache install, or iptables may be blocking port 80. Check all of those things before continuing as you will need a working and accessible install of apache to continue much further.
Installing mod_python is actually dead simple:
sudo aptitude install libapache2-mod-python
That is seriously all there is to it! You will want to give apache a restart (mod_python won’t be enabled until you do).
sudo /etc/init.d/apache2 restart