## Index → Cookbook

## Cookbook: Setting up Wordpress

Setting up Wordpress with Cherokee is really easy. This recipe describes the Wordpress 2.6.x installation, which is the latest release at the time of writing.

There are two ways of installing Wordpress: it can either be installed as a new virtual server or be installed inside a directory of some of the virtual servers that already exist.

### Setting up Wordpress as a new Virtual Server

The first step would be to go to the virtual server list page. Once in there, you’ll have to click the `Wizards` button:

Now, you will have to select the `CMS` category, and run the Wordpress wizard. At this stage the Wordpress wizard will ask you for some basic parameters about the installation. It will try to auto-fill as many entries of the form as possible. For instance, if it finds Wordpress installed in a standard location it will use that path as the default directory.

The new virtual server will be created after this form is submitted. The virtual server configuration will cover the vast majority of the cases. Most probably it will cover your needs, although you are free to modify it as you will.

### Setting up Wordpress inside a Directory

Wordpress can also be configured inside a directory. Let’s suppose we want to set up Wordpress inside the `/blog` directory of one of our virtual servers.

In this case, the first thing you will have to do is to enter the virtual server configuration you’d like to configure Wordpress in. Once in there, click the `Wizards` button:

As in the previous case, this wizard will ask some very basic information, including the public web directory where Wordpress will be set up and the local Wordpress source directory.

#### WARNING

Beware of the long time it gets Wordpress to get through the installation. It has been known to exceed the timeout that Cherokee uses as default, and while this will still sometimes allow for a complete installation, it will most probably cause a failure while delivering the last page of the process. Since this is the page that provides the random password needed to access the admin page of Wordpress, you installation will be useless.

If you encounter this problem, please increase your server’s `timeout` value, under the `Basic Behavior` paragraph of the `General` tab, and start over.

If you are going to attempt to make an installation as is, with no reconfiguration of Cherokee whatsoever, you can skip right to the section Setting up Wordpress.

### Setting up Wordpress

First download and uncompress the distributed Wordpress release into `/var/www/wordpress`, and create a database suitable for the installation.

Log in to MySQL:

    mysql -u root -p

And create the database for Wordpress. We will be using the name wp, the user wpuser and the password wppassword, but you should set up your own.

    CREATE DATABASE wp;
    GRANT ALL PRIVILEGES ON wp.* TO wpuser@localhost IDENTIFIED BY 'wppassword';
    GRANT ALL PRIVILEGES ON wp.* TO wpuser@localhost.localdomain IDENTIFIED BY 'wppassword';
    FLUSH PRIVILEGES;
    quit;

Then point your web browser to `http://localhost` and follow the instructions provided by the installer.

And the installation will be automatic. Just fill up the requested values and you will obtain the following results once your are through.

With that, you are done installing. Let’s log in and make the last adjustments.

Once we’re logged, we can configure the way `permalinks` are displayed. Just use the `Settings`→`Permalinks` menu, and adjust the way the links are to be rewritten.

Remember to set up the plugins that are of interest for you, such as the sitemap generator, in a fashion compatible with what you configured in Cherokee.

And voilà! You have a Wordpress installation working flawlessly with Cherokee.