hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Python on cesnos 5.2
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Python on cesnos 5.2

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 03-27-2009, 11:31 AM
antsaoo antsaoo is offline
New Member
 
Join Date: Mar 2009
Posts: 4

Python on cesnos 5.2


Hello i have been thinking of getting dedicated server and was wondering is it easy to install python on CentOS or is it already installed ? Maybe stupid question but better safe than sorry

Reply With Quote


Sponsored Links
  #2  
Old 03-27-2009, 11:46 AM
e-Sensibility e-Sensibility is offline
Uptime Aficionado
 
Join Date: Mar 2009
Location: /usr/bin/perl
Posts: 971
Don't know much about CentOS, but I'd imagine that it doesn't come with python. I would also venture to say that it should be pretty straight forward to compile python from source, or to do a binary installation via CentOS's package management system.

Reply With Quote
  #3  
Old 03-27-2009, 11:54 AM
mwatkins mwatkins is offline
Web Hosting Master
 
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
Python is easy to install from source. I don't know CentOS (Two thumbs up for FreeBSD and reluctantly support Debian here) but no doubt its "package" manager has an install available.

It may however be for a dated version.

If you aren't running a "control panel" then chances are you can install or upgrade to the latest mainstream Python (2.6). I would not advise installing Python 3.0 unless you know what you are doing as it intentionally breaks some links to the past (all for good reasons).

If your box has Python 2.5x on it, and you don't have any special requirements otherwise, just use that.

Compiling from source, if you feel so inclined:

./configure
make
sudo make install

(or sudo make fullinstall - again, know what you are doing)

__________________
“Even those who arrange and design shrubberies are under
considerable economic stress at this period in history.”

Reply With Quote
Sponsored Links
  #4  
Old 03-27-2009, 11:54 AM
transcend transcend is offline
Newbie
 
Join Date: Aug 2006
Posts: 12
Quote:
Originally Posted by antsaoo View Post
Hello i have been thinking of getting dedicated server and was wondering is it easy to install python on CentOS or is it already installed ? Maybe stupid question but better safe than sorry
Cent comes with python out of the box.

Reply With Quote
  #5  
Old 03-27-2009, 11:55 AM
RoseHosting RoseHosting is offline
Aspiring Evangelist
 
Join Date: Nov 2001
Posts: 389
You can check if the Python package is already installed with the 'rpm -qa | grep python' command.

If it isn't installed then try 'yum install python' to install it.

__________________
---=== RoseHosting.com Admin ===---
Linux Cloud Hosting - linuxcloudvps.com
Linux VPS Hosting Specials - rosehosting.com/vps-hosting-specials.html
High Quality Linux virtual servers with lots of Guaranteed RAM and HDD space, Impeccable Service.

Reply With Quote
  #6  
Old 03-27-2009, 11:56 AM
mwatkins mwatkins is offline
Web Hosting Master
 
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
Quote:
Originally Posted by transcend View Post
Cent comes with python out of the box.
Figured it would; many packages require Python for their install scripts, and most hosts have at least check box support for it.

To the OP, check what version is installed. You don't want anything older than 2.5.x.

python --version

__________________
“Even those who arrange and design shrubberies are under
considerable economic stress at this period in history.”

Reply With Quote
  #7  
Old 03-27-2009, 12:39 PM
Zoni Zoni is offline
Junior Guru Wannabe
 
Join Date: Mar 2009
Posts: 30
yum itself runs on Python, if I remember right... so I would think it does

Reply With Quote
  #8  
Old 03-27-2009, 03:13 PM
transcend transcend is offline
Newbie
 
Join Date: Aug 2006
Posts: 12
Quote:
Originally Posted by mwatkins View Post
Figured it would; many packages require Python for their install scripts, and most hosts have at least check box support for it.

To the OP, check what version is installed. You don't want anything older than 2.5.x.

python --version
Yum is actually a python script, as Webbify noted.

The stock version on Cent5 is 2.4.3, which is rather dated.

Once thing to note is that Cent/RHEL tend to be finicky about python and perl versions, and many of their administrative packages and scripts depend on them. If a newer version is required, I'd recommend installing a second copy to /usr/local (you should just be able to ./configure prefix=/usr/local && make && make install IIRC) to ensure that there is no impact to the base OS. You may also need to rebuild mod_python if you want to serve content that way (you can just grab the .src rpm and edit the paths to reflect the new python install, rpmbuild -bb, install rpm and you're done).

Hope this is helpful!

Reply With Quote
  #9  
Old 03-27-2009, 05:02 PM
mwatkins mwatkins is offline
Web Hosting Master
 
Join Date: Nov 2001
Location: Vancouver
Posts: 2,416
Quote:
Originally Posted by transcend View Post
If a newer version is required, I'd recommend installing a second copy to /usr/local (you should just be able to ./configure prefix=/usr/local && make && make install IIRC)
You shouldn't need to jump through those hoops. As any Python README will note, you have choices:

make install - generally clobbers an existing installation
make altinstall - will not clobber

The executable is what really matters. If centos in its wisdom requires Python 2.4.x for some reason, you don't want to override that. But I would not personally use 2.4 myself, preferring features and speed improvements available in more recent versions.

make altinstall will put Python where it should go for that platform, but it won't over-write the already installed "system" python executable but instead will deposit a python2.x executable.

It should be quite safe installing a newer major version of Python. For example if your OS has Python:

/usr/local/bin/python -- 2.4.3

It's libraries will typically be at:

/usr/local/lib/python2.4/

Thus if you make altinstall 2.5 or 2.6:

/usr/local/bin/python -- 2.4.3 (not affected)
/usr/local/bin/python2.6 -- the new executable

And libraries:
/usr/local/lib/python2.4/ -- 2.4.3 not affected
/usr/local/lib/python2.6/ -- the new libraries.

Living with multiple versions isn't that troublesome but you will have to think about it a bit. When installing your own apps you'll want to take care to use the newer Python, i.e.:

python2.6 setup.py install

That all said, unless you really need a feature in later versions, most machine's stock version will do, particularly for the newcomer or casual punter.

__________________
“Even those who arrange and design shrubberies are under
considerable economic stress at this period in history.”

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Softaculous Launches AMPPS Installer Version 1.5 Web Hosting News 2012-01-26 16:52:40
Internet Backbone Provider Hurricane Electric Upgrades Global Peering Bandwidth Web Hosting News 2011-11-16 18:14:57
Netcraft Survey Names Rackspace Most Reliable Web Hosting Site in October Web Hosting News 2011-11-02 19:13:38
Web Host A2 Hosting Launches QuickInstaller Tool for VPS Plans Web Hosting News 2011-08-19 20:00:53
Communications Software Firm 4PSA Launches Developer Resource Website Web Hosting News 2011-07-06 20:38:56


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?