Removing Plesk from Hostcentric Self Managed Hosting
rpm -qa | grep psa. This will show you all the RPM packages which have been taken over. Kind of a lot. qmail, the MTA has to go. As does the courier imapd and popd daemons. There's a bunch of stuff in /etc/xinetd.d/ that's Plesk-ified. If this isn't a production server it's safe to disable this for now.
I'm going to take this time, before you start hacking to emphasize DO NOT DO THIS ON A PRODUCTION SERVER! and of course the obligitory BACK UP YOUR DATA BEFORE PROCEEDING!. Like the Debian GNU/Linux login message, this mini-howto comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.. I hope I have made this clear enough...let's proceed.
If you have already picked around the Plesk GUI, you might have noticed some weirdnesses with how they define "domains" and "users". I still don't understand most of it but here's the gist. An "FTP User" is someone added to /etc/passwd with a shell of /bin/false and their web root is their home directory. A "Web User" is someone. I have no fucking idea. A "SSH User" Or remote login whatever, is someone who is also added to /etc/passwd with a shell of /bin/bash.
Outside of /usr/local/psa the second most dominated location is /etc/httpd. This is where all the Apache configs reside. While Plesk hasn't modified the Apache binary, they have ruled the config file structure and made it almost impossible to allow you to edit the file by hand. Double plus ungood. Another caveate, which was pretty amusing in retrospect (although not during the 8 fucking hours I spent figuring it out and fixing it) is that Plesk uses suexec for CGIs. RTFM if you don't know what it is. These Hostcentric servers haven't modified the Apache binary so it's using /var/www as it's suexec document root (the default). Amusingly enough, Plesk is using a different document root, making it impossible to execute certian types of CGI programs. It requires recompiling Apache to change this variable and it's doesn't stick across upgrades. Great! suexec is great if you have a huge shared hosting business but anyone spending $59.99 a month for a server isn't doing that. And if you are, you're retarded, you will lose. Moral of the story, don't use suexec.
There's really no simple way around the Apache config part. You have to open up the files in a text editor and delete all the <VirtualHost> definitions you didn't create yourself. The ones you did, you have to save and then modify for your new configuration. This took me tons of trial and error.
DNS is a tricky problem. Most people don't fully understand DNS or just don't have to think about it that much and don't care. Don't worry, I was one of them too and it took me a weekend to get it. Now I do and it's very simple. BIND is overly complicated. djbdns is not. Which one do you think Plesk uses? Why BIND, of course. This is actually kind of unexpected considering they are already using some DJB software, namely qmail. Whatever...If you are already publishing some domains from this box, you aren't fully screwed but it's going to be kind of difficult. You'll have to shut down your DNS server while you transition to djbdns. Fortunately, Mr. Bernstein provides good documentation on transitioning from BIND to djbdns. Read it, do it, it'll work. This is a simple one to get out of the way and it'll last for the life of the server. Make sure you remove named from the system's boot order so it doesn't turn itself on across reboots. Once you have a stable tinydns/dnscache system you can uninstall BIND.
The last part of Plesk terribleness is MySQL. Fortunately it didn't do anything that bad to MySQL except use it for lots of state information and some user databases. If you already depend on databases created by the GUI, dump them out of MySQL just to be safe.
Now you should have a very good idea of the depth of this project. The icing on the cake is that Hostcentric's agreement forbids you to update the OS. Fedora Core 1 is quite old. The whole point of open source software is the freedom to update. My better judgement tells me the lawyers who wrote this agreement have never used a computer for anything more than typing email and surfing pr0n on the web so I can safely ignore them. Our business and theirs do not overlap. No probs. The first concrete step to a Plesk free life is installing APT, the Advanced Packaging Tool, created by the wonderful Debian GNU/Linux project and updating your RPM database.
After installing APT, follow the instructions and choose a mirror close to you. Run apt-get update and make sure it runs without errors. Then run apt-get dist-upgrade and see how horribly out of date your OS is. Scary, isn't it? Please say no to all of these upgrades, since one of them might be a kernel upgrade and you'll have to reboot. What you can do now, it run /etc/init.d/psa stop, which will shut down Plesk, whatever that means. Now you are safe to refer to the output of that rpm -qa | grep psa command and remove and replace the programs. I chose postfix to replace qmail-psa. Everything else I just replaced with their Fedora supplied counterparts. Once all the *-psa packages are removed, run chkconfig --list and make sure the services you want are in the list and set to on for levels 2, 3, 4 and 5. If they are, run apt-get dist-upgrade and say yes. You might get some GPG verification errors, which I couldn't get around even though I imported the public key from the Fedora project. I had to edit /etc/apt/apt.conf to disable GPG checking to get the upgrade to complete without errors.
You probably have a new kernel which you should reboot into. This is a pretty critical step, so make sure your bootloader is properly configured. My server was using grub. Verify that /boot/grub/menu.lst is pointing to the current kernel and that the kernel exists at that location. Make sure the default is to boot into that kernel. If you are using lilo, the same should apply. I'm scared of lilo so I'll leave that as an exercise for the reader if you are using that bootloader.
The final step is rebooting. But wait! There's one last bit of sneakiness I got bit by. Run this ls -l /sbin/reboot. Depending on your system, you might notice that it's linked to /sbin/halt ! This means if you type reboot it'll actually shut down the system! Fuck! You can be safe and issue a shutdown -r now command to properly reboot. If something goes wrong and the system doesn't come back online, you'll have to submit a reboot request to Hostcentric. They were actually pretty good at doing this, with a turn around of about 20 to 30 minutes for me and in both cases their reboot worked where mine didn't.
When your new system is rebooted and running, make sure the services you want are running with netstat -ltunp and if they aren't, start them with the redhat-centric service whatever start. If it comes up, use chkconfig to add it to the boot order for runlevels 2, 3, 4 and 5. To be safe you might want to do one last reboot to make sure everything you need comes up automatically. If it does, congratulations! You have a brand new Plesk free Fedora server. Stay tuned for a howto for upgrading to Fedora Core 2.Critical Mass Radio Network mixer
apt-get install pd-externals.Installing Debian Sarge on a 4801 with a serial console
| July 2008 | ||||||
|---|---|---|---|---|---|---|
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||