Booktype for Authors and Publishers

Setting Up The Database

Before you can install Booktype, you will need a database to be available. PostgreSQL is the recommended database management system. The following instructions were tested on Ubuntu Lucid 10.04, using sudo for root access to the server.

1. Open a terminal, then enter the following command to install PostgreSQL and the Python adaptor for it:

sudo apt-get install postgresql python-psycopg2

2. Create the PostgreSQL user booktype-user with the command:

sudo -u postgres createuser -SDRP booktype-user

Enter the password you wish to set in the database, as prompted. You will need to re-enter it for confirmation.

3. Create a database named booktype-db, setting booktype-user as the owner with the -O option. The encoding should be the international UTF-8 character set, as indicated with the -E option.

sudo -u postgres createdb -E utf8 -O booktype-user booktype-db

4. Allow connections to the database booktype-db for booktype-user by editing the PostgreSQL configuration file. The exact file name depends on the PostgreSQL version that you are using. For example, if the version was 8.4, the command to edit the file on Ubuntu would be:

sudo nano /etc/postgresql/8.4/main/pg_hba.conf  

At the end of the file is a section like this:

# TYPE  DATABASE    USER          CIDR-ADDRESS        METHOD

Add an extra line at the end of the section like so:

local   booktype-db booktype-user                     md5

Save the file with the keyboard shortcut Ctrl+O, and then quit nano with Ctrl+X.

5. Finally, restart PostgreSQL with the command:

sudo invoke-rc.d postgresql-8.4 restart

You are now ready to install Booktype. See the following chapters for details.