My buddy (Showtime) Shane promised he was going to install Wordpress and start a new blog this weekend. It’s now Monday morning with one day left in this President’s Day weekend and no blog yet. To help him out and anyone else that might be interested I am going to walk through the easiest way to install and then keep Wordpress up to date.
Before we begin installing Wordpress, you should setup your MySQL database. Your host should provide some way to create a database and then give you the database name, username, password and database host address. Keep this information handy, you’ll need it in a little bit.
Wordpress offers SVN access to it’s blog software and while the page claims to be for developers anyone can use the SVN server to get the code and keep their blog up to date. For this mini-tutorial I am going to describe, with little detail, how to install Wordpress using SVN. You will need to have access to the shell on your host, but most shared hosting servers nowadays provide SSH access. From your Windows computer you can install and use PuTTY to connect and from your Mac, just use the built-in Terminal app.
Once connected to your server, navigate to your web root directory for the domain you want to install the blog on. You will probably need to use a combination of ls and cd path/to/webroot to get to your webroot. You’ll probably see a file called index.html or something. You probably should delete it: rm index.html or move it: mv index.html index-save.html If you have made it this far, the hard times are now behind you.
The first thing to do when getting Wordpress from SVN is to figure out which version you want. I would always suggest the latest. To figure out which version are available from SVN:
svn list http://svn.automattic.com/wordpress/tags/
As of this writing, the 2.1 tag is the most recent which also happens the latest stable version. Getting this version from SVN would be exactly like downloading the .zip or .tar.gz and then uploading it to your server.
From inside your webroot, type the following command to get Wordpress 2.1:
svn co http://svn.automattic.com/wordpress/tags/2.1/
You then need to copy wp-config-sample.php to wp-config.php:
cp wp-config-sample.php wp-config.php
You now need to edit wp-config.php using vi, nano, pico or an FTP client to download the file to your local computer. Using the database connection info that you got at the beginning, fill out lines 3-6. On line 9 you can specify a prefix for your Wordpress tables. You don’t have to change this, ‘wp_’ is fine, but I generally like to change it to something that describes what the blog is going to be about, like ‘travis_’. The reason for this is because most shared hosts only allow you a limited number of databases and I usually put all my Wordpress blogs into the same database and just change the table prefix.
With wp-config.php all set up, save it back to the server and, in your web browser, go to the blog. Wordpress will say it needs to be setup, so click the links to proceed. It will give you a username and password to login to your new blog. And you’re all set.
The real reason for all the trouble of using the command line to install Wordpress isn’t because installation is much easier, it is because upgrading is incredibly easy. All you have to do is use svn list http://svn.automattic.com/wordpress/tags/ to get the newest tag and then switch to the new tag using (assuming 2.2 is the new tag):
svn switch http://svn.automattic.com/wordpress/tags/2.2
Then just go to http://your.domain/wp-admin/upgrade.php and click the upgrade link. That’s it, you’re updated to the newest version. If you don’t use SVN, you have to download the latest package, upload the certain files while not uploading others. It isn’t too hard, but using SVN is just too easy.
I realize this looks like a lot, but it really isn’t. The executive summary would looks something like this:
svn co http://svn.automattic.com/wordpress/tags/2.1/
- Edit wp-config.php with your correct database connection details.
Categories: Wordpress