Installing WordPress

Here’s a simple guide to getting a manual installation of WordPress up and running on a personal server.

1) Create a MySQL database for the installation

2) Download the latest version of WordPress at http://wordpress.org/download

3) Create a new folder on your desktop and unzip WordPress in it

4) Look for wp-config-sample.php and copy it to wp-config.php

5) Open wp-config.php and set the database access credentials as follows:

 	define(‘DB_HOST’, ‘127.0.0,1’)
 	define(‘DB_NAME’, ‘database_name’)
 	define(‘DB_USER’, ‘username’)
 	define(‘DB_PASSWORD’, ‘password’)

6) Next, scroll down and set the keys and salts to something unique, as shown here, then save the file:

define('AUTH_KEY', 'Put something unique here');
define('SECURE_AUTH_KEY', 'Put something unique here');
define('LOGGED_IN_KEY', 'Put something unique here');
define('NONCE_KEY', 'Put something unique here');
define('AUTH_SALT', 'Put something unique here');
define('SECURE_AUTH_SALT', 'Put something unique here');
define('LOGGED_IN_SALT', 'Put something unique here');
define('NONCE_SALT', 'Put something unique here');

7) Upload the entire contents of the folder to the hosting server

8) Make sure the host’s server is set to recognize the target domain, and that the domain points to the server

9) Go to yourdomain.com/wp-admin/install.php to customize and start using WordPress

Because this is being installed manually on a personal server (and not by a proprietary install script) the installation directory and files will be owned by the logged user. WordPress doesn’t like this when it comes to adding content or uploading images, or when installing plugins. To fix this permissions problem, make sure the logged user is included in the www-data group.

Fixing WordPress When Changing DNS

I ran into an issue with WordPress yesterday when I reset my router. In short, the reset changed my IP Address. I updated the pointers for my domains and all started working again – except for my WP sites, which I access by IP Address rather than domain name.

Basically, the first page’s content would download, but then the server would start looking for things at the old IP Address. Since it couldn’t make contact, loading eventually timed out.

It turns out that WP stores the domain name (even if it’s just an IP address) in the database and uses this as the default root when loading up files and modules.

The solution is to update the site’s option_value field for the first 2 rows (‘siteurl’, ‘home’) in the wp_options table with the new IP Address.