Thursday, May 27, 2010

Fedora Does Not Work Without Yum And Python!

Remote Dedicated Sever OS Upgrade: Linux Fedora 7 to CentOS 5.3


Prepare for Linux OS upgrade, Back up Plesk


Pre-Update Preparation: backup all critical files locally. If you use plesk, you can use the site backup & server backup functions to back everything up. All the plesk backup files are stored in:



/var/lib/psa/dumps/

(the official link for information on plesk backups)
http://kb.parallels.com/en/6082

Old versions including plesk 8.0 and earlier will store your backups in numbered files
Newer versions including plesk 9.0 and later will store your backups under 'clients'
Full server backups appear to be stored in the root directory.



Getting Plesk to Recognize Your Backups


Warning for this with large backup files: Plesk wont let you restore anything until all the files are in place on your new server. So you may have to do a lot of uploading before you can finally restore things.



You'll notice some .xml and .tgz files among your backups. Here's something important: you may want to clean out /var/lib/psa/dumps/ before you run your backups. I had 17 gigs of backups, most of which are completely useless--partly because my server was several years old. This way, when you SSH into your server & download your files, you wont be grabbing many gigs worth of useless information. The XML files have dates and other key information stored about your configuration & backups. The .tgz files have data.



Fedora Core 7 to 8 Upgrade Issues


Today I upgraded my server from an older OS to a newer one (Linux Fedora 7 to CentOS 5.3). I was fighting with Fedora Core 7, and slowing working my way to Fedora Core 13 (you can't do it all at once, the versions are too far apart--I learned a long time ago, its always safer to go one version at a time with anything related to linux!). My server decided it was schizophrenic and was requiring multiple versions of python (2.4 and 2.5) at once. Yum was displaying dependency conflicts that could only be resolved if I had BOTH python 2.4 AND 2.5. There are ways of supporting multiple python installs at once, but its really ugly, and theres a chance you could over-write your primary python installation if you're not careful. I made the mistake of completely uninstalling YUM and PYTHON--because it seemed the only way to resolve thigns-- yes believe it, I did it.



Yum Uninstall Python: Warning!! Do NOT Press This Button!


If you know anything about Fedora, uninstalling YUM and PYTHON is like taking a rowboat out into the middle of the ocean, poking a hole in the bottom, and throwing away the paddles. Fedora CANNOT function without YUM and Python!! Well, there's a few minor exceptions-you can manually compile things, but without YUM & Python its easy to make mistakes. YUM install is critical and is probably the fastest and easiest way to resolve dependencies and get things up to date. I actually managed to find a tar.gz version of Python 2.5 and restore it to the server. (I had to unzip the tar file & manually compile it with .configure / make/ make file/ etc.



I was thinking of then re-installing YUM but then I decided it was better to throw in the towel. My server had been hacked over 5 years ago when I was a newbie server administrator. The hacker had actually come in through an operating system loophole-- a vulnerability that allowed them to log in without needing to know the root password. Since then I have kept my servers safe by blocking all IPs except ones absolutely necessary. There are 2 ways of doing this. 1-use iptables (no thanks) 2-use plesk to configure IPtables for you (easy)



Configuring Plesk Firewall (Easy IP tables Updating)


You can configure plesk firewall by going to modules > firewall > edit. if you don't see a firewall installed, you can go to home > updates > (chose your current version), find your option for a firewall & install it. if a firewall option is greyed out, you might have an issue with your plesk key. Did I mentioned that I was only able to put 1 single domain on my server without restoring my plesk key? With my plesk key, the limit is 30 domains (a major difference....)



MySQL User Issues Made Wordpress Look Like it Was Failing (Solved)


I had a wordpress installation on my plesk centos 5.3 server. Once I restored my sites from plesk, I found out NONE of them worked. Here's the issue: when you restore a website backup with plesk backup manager, plesk does NOT set up permissions for the users! So here's how you grant your old MYSQL users permission through plesk: simply remove each user, and add each user back (with the same password(s)). Plesk will automatically give each user permission to the respective database, with the respective domain & client. After that, everything worked perfectly. I should mention; I did make an update to vhost.conf, but I have no idea if it helped. I made the update because it appeared that the php 'includes' or 'require' functions were not working. It seemed PHP did not have permission to open files on my own server!



Editing vhost.conf to Fix open_basedir Issues



php_admin_value open_basedir "/var/www/vhosts/yourdomain.com/httpdocs:/php/includes"


Once you make the change & save your new vhosts.conf file, you'll need plesk to reconfigure things. The easiest way is to just rebuild all your sites:



Command to Make Plesk Recognize vhost.conf Changes


/usr/local/psa/admin/bin/websrvmng -a

Fedora Does NOT Work Without Yum or Python!


Anyway, I learned a very tough lesson today. Fedora does NOT work without yum & python. I mean, you could rebuild python from scratch, but if you yum uninstall python, you're going to break your server--and if you're connected remotely, you're screwing yourself! So be careful people. Don't forget--yum is dependant on python. Don't remove python unless you truly know what you are doing, otherwise, you're in for a world of pain. (You'll probably botch your install and need to start from scratch).



And as usual, have a craptastic day!

1 comment:

  1. I did some internet research, and it seems some 'obvious' dependency questions are not answered on the internet. Like the fact that YUM can't function on fedora without Python is not really covered anywhere that I saw. Maybe I google the wrong terms, or maybe this is considered so obvious that it's not worth talking about. Or maybe its a conspiracy of linux nerds to hide the truth!

    ReplyDelete