Manual installation

From refbase

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

Please follow the steps that match your server setup (depending on whether you're installing refbase on a shared host or on a dedicated server):


1 Installing refbase on a shared host

Note: We assume that your Internet Service Provider (ISP) has provided you with a tool such as phpMyAdmin to manage your MySQL database(s) via a web interface.

In order to manually install the refbase package on a hosted service, perform the following four steps:

1.1 Create the refbase MySQL tables

Open your ISP's database management tool (such as phpMyAdmin or similar) and select one of your unused MySQL databases for refbase.

Note: If all of your MySQL databases are already in use, and you don't have permission to add any additional databases, you'll need to install the refbase tables within one of your existing MySQL databases. In that case you should rename the refbase tables before installation in order to avoid any table naming conflicts.

Now open the file install.sql in a text editor and copy its entire contents into the SQL command entry form provided by your ISP's database management tool. Press the form's submit button to install the refbase database tables in your selected MySQL database.

1.2 Edit the file initialize/

Open the file initialize/ in a text editor and edit the variables $username and $password to fit your needs. Your ISP has probably given you special values for $username, $password and $databaseName which you must enter here. For $databaseName, you should enter the database name that you've chosen in step 1.1. Please see the comments within the file for further guidance.

1.3 Setup your own admin user

Same as below.

1.4 Customize the refbase interface

Same as below.

2 Installing refbase on your own server

Note: You'll need to have some very 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 MySQL online help.

In order to manually install the refbase package on a server with full access to MySQL & the shell, perform the following six steps:

2.1 Create a new MySQL database

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


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:


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 character set of your choice. As an example, if you've decided to name your new database literature and use the Unicode character set (UTF8 encoding) for your database, your CREATE DATABASE statement would read:


This adds a new database literature to your list of MySQL databases.

2.2 Edit the file initialize/

Open the file initialize/ 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 2.1. 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!

2.3 Add a new MySQL user and set his permissions

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 admin permissions and use the following GRANT statement:


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

$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.

2.4 Load the MySQL database structure from file

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 admin permissions and include the --database option:


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/ Similarly, MYSQL_DATABASE_NAME must match the value of the $databaseName variable in initialize/ 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.

2.5 Setup your own admin user

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


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  =
password       =  start

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


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/ 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)

Especially note that you won't be able to login using email address = and password = start if you've already changed the value of the $adminLoginEmail variable before attempting to login for the first time. This variable must only be changed after you've created your own admin user.

2.6 Customize the refbase interface

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

If you want to change the appearance of the web interface, checkout the CSS and header/footer files and modify them to fit your taste. See also Integrating refbase into your web site.