Manual installation

From refbase

Revision as of 17:05, 26 November 2005; view current revision
←Older revision | Newer revision→

Contents

Manual installation of refbase

This document will guide you thru a manual installation of the refbase package. Before you proceed, please make sure that you have:

Additionally, you'll need to have some basic knowledge of MySQL, e.g., we assume that you know how to run the MySQL command line interpreter and how to execute MySQL commands. If you require help with this, please refer to the <a href="http://www.mysql.com/doc/en/index.html">MySQL online help</a>.

Important note: refbase 0.8.0 <a href="http://sourceforge.net/docman/display_doc.php?docid=19771&group_id=64647">requires</a> the directives magic_quotes_gpc, file_uploads and session.use_cookies to be set to ON (or 1, respectively) within your PHP configuration file php.ini. (Future versions of refbase will work regardless of the value of magic_quotes_gpc)

In order to manually install the refbase package, we'll perform the following six steps:

  1. <a href="#step1">Create a new MySQL database</a>
  2. <a href="#step2">Edit the file initialize/db.inc.php</a>
  3. <a href="#step3">Add a new MySQL user and set his permissions</a>
  4. <a href="#step4">Load the MySQL database structure from file</a>
  5. <a href="#step5">Setup your own admin user</a>
  6. <a href="#step6">Customize the refbase interface</a>

<a id="step1" name="step1">Step 1: Create a new MySQL database</a>

Run the MySQL command line interpreter with root permissions and create a new database by executing the following code:

CREATE DATABASE MYSQL_DATABASE_NAME;

If you've got MySQL 4.1.x (or greater) installed and you want to use another character set than the default one ('latin1', i.e. 'ISO-8859-1 West European') then use:

CREATE DATABASE MYSQL_DATABASE_NAME DEFAULT CHARACTER SET CHAR_SET;

In the above statements, replace MYSQL_DATABASE_NAME with a name that doesn't exist in your list of MySQL database names. In addition, replace CHAR_SET with the <a href="http://dev.mysql.com/doc/mysql/en/charset.html" title="info about character set support in MySQL">character set</a> of your choice. As an example, if you've decided to name your new database literature and use the <a href="http://dev.mysql.com/doc/mysql/en/charset-unicode.html" title="more on Unicode support in MySQL">Unicode</a> character set (UTF8 encoding) for your database, your CREATE DATABASE statement would read:

CREATE DATABASE literature DEFAULT CHARACTER SET utf8;

This adds a new database literature to your MySQL database.

<a id="step2" name="step2">Step 2: Edit the file initialize/db.inc.php</a>

Open the file initialize/db.inc.php in a text editor and edit the variables $username and $password to fit your needs. For $databaseName enter the database name you've chosen in step 1. Please see the comments within the file for further guidance. (Note that you may be able to use the refbase package without modifying these variables, but we highly recommend not to use the default values!)


<a id="step3" name="step3">Step 3: Add a new MySQL user and set his permissions</a>

To avoid any security risks we'll add a new MySQL user to the MySQL database. This user is granted only those permissions that are required to access the literature database. To add this MySQL user, run the MySQL command line interpreter with root permissions and use the following GRANT statement:

GRANT SELECT,INSERT,UPDATE,DELETE ON MYSQL_DATABASE_NAME.* TO MYSQL_USER_NAME@localhost IDENTIFIED BY 'MYSQL_PASSWORD';

The italic items within the above statement must match the information you've provided in file initialize/db.inc.php (step 2). As an example, if you've entered the following in initialize/db.inc.php:

	$hostName = "localhost";
	$databaseName = "literature";
	$username = "litwww";
	$password = "%l1t3ratur3?";

your GRANT statement would read:

GRANT SELECT,INSERT,UPDATE,DELETE ON literature.* TO litwww@localhost IDENTIFIED BY '%l1t3ratur3?';

This adds a new user litwww to the user & db tables of the mysql database and allows him to use only the SQL statements SELECT, INSERT, UPDATE and DELETE with any table of the literature database.


<a id="step4" name="step4">Step 4: Load the MySQL database structure from file</a>

The SQL dump file install.sql that comes with the refbase package contains everything you'll need to setup the refbase database tables. In addition it will provide some sample data. To import this file into your newly created MySQL database, run the MySQL command line interpreter with root permissions and include the --database option:

mysql -h HOST_NAME -u ADMIN_USER_NAME -p --database=MYSQL_DATABASE_NAME < PATH_TO_SQL_DUMP_FILE

Again, you must adjust the italic items within the above statement to suit your setup. HOST_NAME should be the same as $hostName in initialize/db.inc.php. Similarly, MYSQL_DATABASE_NAME must match the value of the $databaseName variable in initialize/db.inc.php. For ADMIN_USER_NAME enter the name of the administrative user that has full access to the MySQL admin database. Finally, PATH_TO_SQL_DUMP_FILE must contain a valid path specification to the SQL dump file install.sql. Example: With the refbase web directory as current working directory, root being the admin user and using the values from the steps above, your import statement would read:

mysql -h localhost -u root -p --database=literature < install.sql

You'll be asked for the admin password. After the command has finished your installation of the refbase MySQL database is complete.


<a id="step5" name="step5">Step 5: Setup your own admin user</a>

Now, open a web browser and access the index.php script by typing:

http://SERVER_ADDRESS/PATH_ON_SERVER/index.php

In the above URL, replace the string SERVER_ADDRESS by your server name and PATH_ON_SERVER by the actual path specification to your web directory.

This should bring up the main page of the refbase database. Login to the database by using:

	email address  =  user@refbase.net
	password       =  start

You should see a welcome message at the top right corner of the page confirming your successful login:

<img src="LoginConfirmation.jpg" alt="" width="249" height="114">

Note that cookies must be enabled within your web browser, otherwise the login feature won't work properly.

Click on Add User which should bring up an empty form. At a minimum, you have to specify the admin's first name & last name, his institutional abbreviation as well as his email address and password. Then click the Add User button. You'll be shown a receipt page with the account details you just entered.

Now open the file initialize/ini.inc.php in a text editor and change the value of the $adminLoginEmail variable to the email address you've specified for your new admin user.

Log out from the database, then login again using the email address and password of your newly created admin account.

You can now delete the initial user by choosing Manage Users and clicking the appropriate trash icon. (However, we recommend to keep this user until you've explored the example records that come with the database)


<a id="step6" name="step6">Step 6: Customize the refbase interface</a>

In order to properly configure your new database you'll need to edit the global configuration file: Open the file initialize/ini.inc.php & edit all values of the contained variables to fit your needs. Please see the comments within the file for further guidance.

If you want to change the appearance of the web interface, checkout the CSS files style.css & style_print.css and modify the contained CSS definitions to fit your taste.