Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Jul 6 '11 at 18:56

This question came from our site for professional and enthusiast programmers.

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. –  Jarrod Roberson Jul 6 '11 at 18:46
add comment

1 Answer 1

(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

share|improve this answer
1  
WSGI is way more modern and less buggy than mod_python –  Jarrod Roberson 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 –  Jarrod Roberson 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
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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