- 论坛徽章:
- 4
|
In preparing to upgrade this server to Centos 5.x, I did a test install of the Centos "Server" configuration using
VirtualBox
. The "Server" configuration comes with Apache 2.x, Python 2.4, and mod_python pre-loaded.
Installing Django
Here are the commands needed to install the latest version of Django:
$ yum install subversion
$ cd /var/www
$ mkdir django-src
$ cd django-src
$ svn co http://code.djangoproject.com/svn/django/trunk/
$ cd trunk
$ python setup.py install
Installing and Starting MySQL Server
Here are commands needed to install and start MySQL:
$ yum install mysql-server
$ /etc/rc.d/init.d/mysqld start
Installing Python MySQL Support
This is the trickiest part. Python talks to MySQL using software called
MySQLdb. The version available in Centos via Yum is 1.2.1-1 and isn't
compatible with the most recent Django codebase. Because of this you
must download and compile MySQLdb.
Before compiling MySQLdb, enter the command below to make sure you have the necessary tools:
$ yum install python-devel mysql-devel gcc
Next, download the source tarball from
SourceForge
then follow these steps:
$ mv ~
$ cd ~
$ tar zxvf
$ cd
$ python setup.py build
$ python setup.py install
When these steps are completed you should be good to go.
转自:http://mikecantelon.com/story/installing_django_on_centos_5
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/74256/showart_2143445.html |
|