Centos – How to install Python and PostgreSQL on CentOS

centospostgresqlpython

I have a dedicated server running centOS.
I want to install python 2.6 and postgreSQL on it so python users can host their web apps on my server. (Apache)
Can anyone give me a detailed tutorial for that ?

And is Django or something similar necessary to run python with Apache ??

Best Answer

(I don't use either python or PostgreSQL, but perhaps this will point you in the right direction)

On CentOS, install mod_python with yum install mod_python (if you want it embedded in Apache). You will need to configure Apache, see HowtoForge: embedding python

install python with yum install python26 (if you want to go the CGI route, or run standalone scripts)

install PostgreSQL with yum install postgresql-server (will automatically install the client)

I believe Django is a framework - in which case it is not required. The users who want to use it will provide it as part of their code.

Hope this helps.

Edit: As per the comment below, it does appear that mod_wsgi is preferred over mod_python.

It can be installed via yum install mod_wsgi

If you need to compile mod_wsgi, there are instructions here. You can also find RPMs compiled against python 3.1.

If python is already on your system, run python --version to determine the version. If it is an older version, and you compile from source, this article provides a procedure at the start (for not overwriting the existing python).

If you don't have an up-to-date python in your yum repository, you can try EPEL, which has python26-2.6.5-6

Related Topic