Manual installation

From refbase

(Difference between revisions)
Revision as of 11:28, 29 March 2007
WikiSysop (Talk | contribs)

← Previous diff
Current revision
WikiSysop (Talk | contribs)
separated install descriptions for shared hosts & deidicated servers
Line 1: Line 1:
This document will guide you thru a manual installation of the refbase package. Before you proceed, please make sure that you have: This document will guide you thru a manual installation of the refbase package. Before you proceed, please make sure that you have:
-* a running web server (like the [http://httpd.apache.org/ Apache] HTTP Server)+* checked that your server meets the [[Requirements|requirements]]
-* a working installation of [http://www.php.net/ PHP] (version 4.1.0 or greater) and [http://www.mysql.com/ MySQL]+* downloaded and unpacked the latest refbase [http://sourceforge.net/project/showfiles.php?group_id=64647 release package] or the refbase [[SVN_version|SVN version]]
-** the [http://www.xampp.org/ Apachefriends-Project] offers a complete solution for above mentioned services (Apache, PHP, MySQL), called XAMPP. The easy-to-use-package runs under different environments (Linux, Windows, MacOS) +
-* downloaded and unpacked [http://sourceforge.net/project/showfiles.php?group_id=64647&package_id=61898 refbase]+
* moved all files to your web directory * moved all files to your web directory
-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 [http://www.mysql.com/doc/en/index.html MySQL online help]. If you're trying to install refbase on a shared host, your Internet Service Provider (ISP) may provide you with a tool such as [http://www.phpmyadmin.net/ phpMyAdmin] to manage your MySQL database(s).+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):
-'''Important note''': refbase-0.9.0 [[Required_PHP-INI_Settings|requires]] the directives <code>file_uploads</code> and <code>session.use_cookies</code> to be set to '''<code>ON</code>''' (or '''<code>1</code>''', respectively) within your PHP configuration file ''php.ini''.+== 1 Installing refbase on a shared host ==
-In order to manually install the refbase package, we'll perform the following six steps:+'''Note''': We assume that your Internet Service Provider (ISP) has provided you with a tool such as [http://www.phpmyadmin.net/ phpMyAdmin] to manage your MySQL database(s) via a web interface.
-== Step 1: Create a new MySQL database ==+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 [[Installing refbase#Installation over an existing database|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/db.inc.php'' ===
 + 
 +Open the file ''initialize/db.inc.php'' 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 [[#2.5_Setup_your_own_admin_user|below]].
 + 
 +=== 1.4 Customize the refbase interface ===
 + 
 +Same as [[#2.6_Customize_the_refbase_interface|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 [http://dev.mysql.com/doc/ 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: Run the MySQL command line interpreter with admin permissions and create a new database by executing the following code:
Line 27: Line 53:
CREATE DATABASE literature DEFAULT CHARACTER SET utf8; CREATE DATABASE literature DEFAULT CHARACTER SET utf8;
-This adds a new database ''literature'' to your list of MySQL databases. Note that if you're installing refbase on a shared host, you may not have permission to add any additional databases. In that case you may want to skip this step and, instead, [[Installing refbase#Installation over an existing database|rename the refbase tables]] before installation in order to avoid any table naming conflicts.+This adds a new database ''literature'' to your list of MySQL databases.
-== Step 2: Edit the file ''initialize/db.inc.php'' ==+=== 2.2 Edit the file ''initialize/db.inc.php'' ===
-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. Note that if you're on a hosted service, special values for ''$username'', ''$password'' and ''$databaseName'' were probably assigned to you by your ISP. 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!)+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 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!
-== Step 3: Add a new MySQL user and set his permissions ==+=== 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 <code>GRANT</code> statement: 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 <code>GRANT</code> statement:
Line 39: Line 65:
GRANT SELECT,INSERT,UPDATE,DELETE ON ''MYSQL_DATABASE_NAME''.* TO ''MYSQL_USER_NAME''@''HOST_NAME'' IDENTIFIED BY '<em>MYSQL_PASSWORD</em>'; GRANT SELECT,INSERT,UPDATE,DELETE ON ''MYSQL_DATABASE_NAME''.* TO ''MYSQL_USER_NAME''@''HOST_NAME'' IDENTIFIED BY '<em>MYSQL_PASSWORD</em>';
-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'':+The ''italic'' items within the above statement must match the information you've provided in file ''initialize/db.inc.php'' (step 2.2). As an example, if you've entered the following in ''initialize/db.inc.php'':
$hostName = "localhost"; $hostName = "localhost";
Line 50: Line 76:
GRANT SELECT,INSERT,UPDATE,DELETE ON literature.* TO litwww@localhost IDENTIFIED BY '%l1t3ratur3?'; GRANT SELECT,INSERT,UPDATE,DELETE ON literature.* TO litwww@localhost IDENTIFIED BY '%l1t3ratur3?';
-This adds a new user ''litwww'' to the ''user'' &amp; ''db'' tables of the ''mysql'' database and allows him to use only the SQL statements <code>SELECT</code>, <code>INSERT</code>, <code>UPDATE</code> and <code>DELETE</code> with any table of the ''literature'' database. Please note that this step may not be possible (or in fact necessary) if you're installing refbase on a shared host which, by default, grants you only limited MySQL user privileges.+This adds a new user ''litwww'' to the ''user'' &amp; ''db'' tables of the ''mysql'' database and allows him to use only the SQL statements <code>SELECT</code>, <code>INSERT</code>, <code>UPDATE</code> and <code>DELETE</code> with any table of the ''literature'' database.
-== Step 4: Load the MySQL database structure from file ==+=== 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 <code>--database</code> option: 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 <code>--database</code> option:
Line 62: Line 88:
mysql -h localhost -u root -p --database=literature &lt; install.sql mysql -h localhost -u root -p --database=literature &lt; install.sql
-You'll be asked for the admin password. After the command has finished your installation of the refbase MySQL database is complete. Note that if you're on a hosted service, you'll probably have no permission to perform the above command. However, as an alternative, you can copy the entire contents of ''install.sql'' into the SQL command entry form provided by MySQL web administration tools such as phpMyAdmin. This will allow you to install the refbase database tables without the need to execute above command.+You'll be asked for the admin password. After the command has finished your installation of the refbase MySQL database is complete.
-== Step 5: Setup your own admin user ==+=== 2.5 Setup your own admin user ===
Now, open a web browser and access the ''index.php'' script by typing: Now, open a web browser and access the ''index.php'' script by typing:
Line 91: Line 117:
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) 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 = ''user@refbase.net'' 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.+Especially note that you won't be able to login using email address = ''user@refbase.net'' 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.
-== Step 6: Customize the refbase interface ==+=== 2.6 Customize the refbase interface ===
In order to properly configure your new database you'll need to edit the In order to properly configure your new database you'll need to edit the
-global configuration file: Open the file ''initialize/ini.inc.php'' &amp; edit all values of the contained variables to fit your needs. Please see the comments within the file for further guidance.+global configuration file: Open the file ''initialize/ini.inc.php'' &amp; 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 files ''style.css'' &amp; ''style_print.css'' and modify the contained CSS definitions to fit your taste.+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]].
[[Category:Installation]] [[Category:Installation]]

Current revision

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

Contents

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/db.inc.php

Open the file initialize/db.inc.php 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:

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 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:

CREATE DATABASE literature DEFAULT CHARACTER SET utf8;

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

2.2 Edit the file initialize/db.inc.php

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 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:

GRANT SELECT,INSERT,UPDATE,DELETE ON MYSQL_DATABASE_NAME.* TO MYSQL_USER_NAME@HOST_NAME 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.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.

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:

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.

2.5 Setup your own admin user

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:

LoginConfirmation.jpg

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)

Especially note that you won't be able to login using email address = user@refbase.net 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/ini.inc.php & 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.