I was watching a guy install WordPress a few days ago, and I couldn’t believe what I saw. He downloaded the zip file from WordPress.org, unzipped it, and uploaded all the files to his Web server by FTP. Sure, it works, but why do it that way when you can go SO much quicker? Let’s talk about SSH. While this stuff is pretty technical, once you’ve got a grip on it, you have some real power on your hands.
Prerequisites:
How to Install WordPress quickly with SSH:
cd public_html
or something similar. You need to know which directory you are in. Are you in a directory that is accessed by http://example.com or by http://example.com/some_directory? Where you are now is where WordPress will be located.
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
mv wordpress/* .
rm -rf wordpress
So, wget downloads the latest release of WordPress to your server, tar unzips it, move takes it out of the wordpress sub-directory into the current directory and rm removes the empty sub-directory.
This works for upgrading to new versions as well. When updating, I personally like to remove the wp-content directory before overwriting the files because I don’t want the new files to mess with my plugins or themes.
Use caution with SSH as you are entering commands directly into your Web host’s server. They probably won’t let you run dangerous stuff and mess up their machine, but you could mess up your stuff. For instance, rm -rf * would wipe out everything in the directory you’re in. If you’re in public_html, you’ve just wiped your entire site. Read up before proceeding, but I wanted you to know that there is an easier way to install WordPress and other Web apps.
By the way, if you’re using a host that doesn’t give you shell access, you can sometimes still accomplish this by creating a simple Perl script. I make a Perl script that runs system(); calls if I need to do this. You get to figure that one out on your own.
Hey, that’s still the old-fashioned way! If you’ve got SSH and a decent host (i.e. one that has the svn Subversion client installed), just run:
svn checkout http://svn.automattic.com/wordpress/tags/2.5.1/ .
(for example, or use /branches/2.5/) inside the (empty) directory you want to be your WordPress root. Run through the web install and enter your database and blog information and you’re done. Best of all, you can switch to a new version with the svn switch command at any time, also a one-liner!
There are a few more tricks than that but the whole deal’s on the WordPress Codex. After your 2nd, 3rd, or 10th WordPress install (or upgrade!) you’ll be, well…really happy you’re using Subversion!