安装:
apt-get install -y mysql-server apache2 libapache2-mod-python python-mysqldb python-django
下面这些暂时没装
xfsprogs python-imaging subversion php5 phpmyadmin
也可以源码安装:
setuptools-0.6c11.tar.gz
./setup.py install 安装setuptools后
再安装MySQL-python,Django-1.3.1
python setup.py install
MySQL-python-1.2.3.tar.gz
Django-1.3.1.tar.gz
配置:
cd /etc/apache2 vi httpd.conf添加<Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE myproject.settings PythonOption django.root /myproject PythonDebug On PythonPath "['/var/www'] + sys.path" </Location>
Alias /adm_media/ /usr/lib/pymodules/python2.7/django/contrib/admin/media/ <Location "/adm_media/"> SetHandler None </Location>
Alias /files/ /var/www/myproject/files/ <Location "/files/"> SetHandler None </Location>
重启apache2:
/etc/init.d/apache2 restart
参考:
http://codespatter.com/2008/10/15/setting-up-apache2-mod_python-mysql-and-django-on-debian-lenny-or-ubuntu-hardy-heron/
http://fosswire.com/post/2008/05/installing-mod_python-and-django-on-apache/