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 ??

  • 3
    off-topic (and answered already - numerous times) – KevinDTimm Jul 6 '11 at 18:30
  • 1
    rpmforge, and epel repositories are your friend as well as yum. – user35861 Jul 6 '11 at 18:46

(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

  • 1
    WSGI is way more modern and less buggy than mod_python – user35861 Jul 6 '11 at 19:34
  • Thanks for the pointer - as I don't use python, I have never heard of it. I added it to the answer for future reference. (Being a bit new to this site, I haven't yet decided if providing a not fully correct solution, which may be of use is worse than providing no solution at all - I went with the former, since there were no other answers). – cyberx86 Jul 7 '11 at 1:13
  • 1
    incorrect or bad advice will get down voted – user35861 Jul 7 '11 at 1:58
  • I expect as much, but find that offline an incomplete answer may point someone in the right direction and therefore may be better than no answer (provided it isn't stated as the absolute truth). (If there is a question outside my expertise, I'm not going to answer unless no one else has bothered.) If the answer is completely incorrect, I expect the downvote, good intentions or not. Besides, mistakes can teach quite a lot. (I'm not really here for the reputation, more to help people, learn a bit, and see what I know (servers are a hobby); the reputation is just a nice way of keeping score.) – cyberx86 Jul 7 '11 at 3:02
  • mod_python is in danger of becoming EOL, you may want o look at wsgi instead. – David Jul 7 '11 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.