Wordpress installation and configuration

The educational technology and digital learning wiki
Jump to navigation Jump to search

Introduction

Wordpress (WP) is quote “a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time. More simply, WordPress is what you use when you want to work with your blogging software, not fight it.” (retrieved on Jan 19 2010).

This is a short installation and configuration manual. Please, also read the fine official Installing Wordpress. The only reason I created this article, was to to have a shorter piece I could use with a projector in a web applications class and give out as handout - Daniel K. Schneider 16:31, 19 January 2010 (UTC).

Installation

Installation includes four fairly easy steps:

  1. Create a MySQL database (or find information regarding the database you may use)
  2. Download the software package and unpack it to a web server directory
  3. Modify a PHP configuration file
  4. Launch the web installer (and answer 2 questions)

Creating a database

WP needs a MySQL database. The installation procedure will create many tables that normally should sit in their own database. You may find yourself in different web hosting situations.

(1) If you have a cheap or free provider or if you have a student account, you only may have access to a single database of the database system. This means that WP will have to co-exist with other applications in the same database. That is usually not a big problem, since most applications add a prefix to each table. By default, WP will add a 'wp_' prefix to each table.

(2) If you want to install WP with a "normal" shared webhosting provider, then you likely may use several databases. Consult the admin interface. Usually there is a tool that allows you to manage databases, e.g. add users and tune permission.

(3) If you have your own MySQL server, then you should install WP in its own database that you'll have to create, i.e.

  • Create a database user (that WP will then use to connect to the database)
  • Create a database that database user can access and fill up with table (and later, data)

In both cases you must create and/or remember:

  • The name of the database
  • The name of the database user
  • The password of the database user

In this tutorial, we shall now cover one variant of situation (3):

Creating a database and database user with phpMyAdmin

PhpMyAdmin is a popular database management system that is installed with most providers and that you also should install on servers you own. With this web-based administration, you can create a new database and user in different orders. The most easiest way is to use the following procedure:

(1) Click on the Privileges tab on the top horizontal menu

(2) Click on Add User at the bottom

  • Then choose a user name, e.g. 'blog'
  • Then select host=local or type localhost
  • Enter the password twice (and remember it)
  • Important: Tick Create database with same name and grant all privileges (this will create a new database)
  • Crucial: Never grant any global privileges on a production server. Each database should have its own life (and hacking attacks).
PhpMyAdmin 3.1.2 User and Database creation

If you do it right, you'll have

  • database name = blog
  • database user name = blog
  • password = rumpelstilskin

Remark: Do not confound the mysql user and password with the wordpress administrator user and password that you will have to create later. The mysql user will be used by the PHP scripts of the WP software.

Wordpress installation

Download and put code in place
  1. Download the WordPress package from http://wordpress.org/download/
  2. Create a directory somewhere and call it junk
  3. Dezip the package within the junk directory. You will see a directory called wordpress
  4. If you wish to have a URL on your server like http://xxxx/blog, then rename the wordpress directory to blog for example.
  5. Then, transfer this directory to the web server tree, e.g. via FTP to a provider, to a local "www" directory or somewhere on your local area network. If you happen to use a WAMP system, the directory might typicall be something like c:\....\www, e.g. c:\servers\mowes\www or c:\wamp\www
Edit the configuration file

(1) Rename the wp-config-sample.php file to wp-config.php. Make sure to get this right !

(2) Edit this file (wp-config.php) in a text editor. Do not use Word or Notepad ! Change information below, i.e. adapt to the database and database user names that you just defined above.

Base information:

/** MySQL database username */
define('DB_USER', 'blog');

/** MySQL database password */
define('DB_PASSWORD', 'blog');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

Change some security related parameters (you may skip this step if you test drive WP on a local server on your PC). In order to make cracking more difficult your wordpress will add extra characters to user's cookies, making it harder to crack encrypted passwords. You only need to do this once and you don't need to type these passwords ever. So use the online generator to generate this salt. Good examples would be:

define('AUTH_KEY',        ':dr+%/5V4sAUG-gg%aS*v;&xGhd%{YKC^Z7KKGh j>k[.Nf$y7iGKdJ3c*[Kr5Bg');
define('SECURE_AUTH_KEY', 'TufWOuA _.t>#+hA?^|3RfGTm>@*+S=8\"\4+\"}]<m#+}V)p:Qi?jXLq,<h\\`39m_(');
define('LOGGED_IN_KEY',   'S~AACm4h1;T^\"qW3_8Zv!Ji=y|)~5i63JI |Al[(<YS<2V^$T])=8Xh2a:b:}U_E');
define('NONCE_KEY',       'k1+EOc-&w?hG8j84>6L9v\"6C89NH?ui{*3\\(t09mumL/fFP_!K$JCEkLuy ={x{0');

Watch out:

  • Both arguments of the define must be enclosed in quotes ' .... ' and each one must finish with semi-colon. Also, do not use unquoted quotes inside the security keys, else php will be confused. If you don't understand what this means, just use the generator and copy/paste.
define ('constant', 'value'); 
  • For programmers who don't know PHP: define is an instruction that just defines a named constant at runtime.
  • If you only own a single database and already have a wordpress installed, you also need to change the prefix towards the end of the configuration file. Else two different WP installations will use the same tables (very messy!)

So double check what you did and then save the file.

Run the installer script

(1) Access wp-admin/install.php from your webbrowser. E.g. on your local test server the URL might be something like:

http://localhost/blog/

You actually will be redirected to the following page:

 http://localhost/blog/wp-admin/install.php

Remark: If you can't see the page or get an error message, please fix the syntax mistakes you just made before in the configuration file. I you can't find the mistake by yourself, look at the server log. E.g. open file c:\...\apache2\logs\error.log. Else, ask a local expert to help.

(2) The script will then ask you to provide a name for the blog and an email address (the email address can bogus for a test system)

  • Make absolutly sure to copy/paste the generated password to a safe place !!

(3) Log in

  • Change immediately the password to a complicated one that you can remember well.

.... enjoy :)

Configuration

Read:

If you log in as admin, you will automatically see the dashboard, i.e. what is often called the backend.

Wordpress dashboard 2.9.1

From the official Administration Panel article, retrieved 17:55, 19 January 2010 (UTC), we reproduce: “Each Panel, referred to as SubPanel, that is accessed via the main navigation menu, is presented in the boxes below. The links in those boxes will lead you to sections of this article describing those SubPanels. From those sections, you can navigate to articles detailing more information about each SubPanel” Links will lead to the codex.wordpress web site therefore middle-click or right-click->Open in New Tab or Window if you like ....).

Dashboard

Posts

Media

Links

Pages

Comments

Appearance

Plugins

Users

Tools

Settings

Maybe start with the following:

  • Add an article (Add New)
  • Change the theme
  • Remove some links and add other ones
  • Create two users, each beloging to a different category.
  • Install plugins. This is really easy with Wordpress (just try)