Sunday, August 28, 2011

Install Django+Mod_Python on Ubuntu 10.04

Install general dev tools
sudo apt-get install build-essential devscripts flex 
where flex is essential to compile mod_python.
Install Apache
sudo apt-get install apache2 apache2-threaded-dev
where apache2-threaded-dev is used to compile mod_python.
Install MySQL
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
where libmysqlclient-dev is used to install Python MySQL library. During the installation, you will be asked to set a password for root.
Install Python 2.6
sudo apt-get install python2.6 python2.6-doc python2.6-dev python-setuptools
where python2.6 maybe omitted if it already installed (It's installed with Ubuntu 10.04). After installed python-setuptools, you will be able to install python modules with easy_install.
Install mod_python
svn co
cd trunk
./configure --with-python=/usr/bin/python2.6
sudo make install
If ./configure fails, check if you missed anything above. To enable the mod_python in apache2, add following to /etc/apache2/httpd.conf
LoadModule python_module /usr/lib/apache2/modules/
Install memcached
sudo apt-get install memcached

No comments:

Post a Comment