Fedora 2.1.1 setup

The Fedora package goal is describing exact steps needed to install the Fedora repository in a way suitable for use in our DOMS project.

Introduction

The basis for our metadata storage in the DOMS system, is a Fedora repository. The Fedora repository needs not be on the same machine as the rest of the DOMS system, but can be communicated with through different web services through HTTP/SOAP, HTTP REST-based, or OAI harvesting.

Requirements

For a full-scale Fedora installation, furthermore you need the following:

Installation instructions

Installing MySQL

If you do not yet have MySQL installed, you need to do this, set the password, and start it up.

For Fedora Core Linux 3 or above, or Redhat Enterprise Linux 4 or above, you should be able to install MySQL, and make it start up at system boot, with the following commands:

sudo yum install mysql-server

Continue with:

sudo /sbin/chkconfig mysqld on
sudo /sbin/service mysqld start

which enables start of MySQL server on startup.

Now you should set the root password:

/usr/bin/mysql -u root
mysql> set password for root@localhost=password('new-password');
mysql> set password for root@<<$HOSTNAME>>=password('new-password');

(Remember to replace <<$HOSTNAME>> with your host name)

Installing MySQL on Windows

A starting point: http://dev.mysql.com/doc/refman/5.0/en/windows-installation.html

Go to http://dev.mysql.com/downloads/mysql/5.0.html#downloads and select the "Windows (x86) ZIP/Setup.EXE" package.

Installing Fedora

These are instructions for installing the Fedora 2.1.1 repository in ~/fedora-2.1.1, with settings as expected by the DOMS installation.

Step 1: Unpack the distribution

The file DOMS/Fedora/fedora-2.1.1-server.tar.gz can be found in our CVS repository. Unpack this in your home directory:

cd ~
tar -xzvf fedora-2.1.1-server.tar.gz

Step 2: Set up your environment variables

Edit the file ~/.bash_profile

Make sure the following environment variables are set (make sure JAVA_HOME points right for your system):

export JAVA_HOME=/usr/java/jdk1.5.0_07
export FEDORA_HOME=~/fedora-2.1.1/
export CATALINA_HOME=~/fedora-2.1.1/jakarta-tomcat-5.0.28/
export PATH=$JAVA_HOME/bin:$FEDORA_HOME/server/bin:$PATH

Log out and log in again to make the change take effect or perform a source ~/.bash_profile in all open terms.

Environment variables under Windows

Navigate to Control Panel | System | Advanced | Environment | System.

JAVA_HOME C:\java\jdk1.5.0_07
FEDORA_HOME C:\fedora-2.1.1
PATH <previous path>;C:\java\jdk1.5.0_07;C:\fedora-2.1.1

Step 3: Set up the MySQL database

The Fedora installation contains a script that handles initialising the database with the expected tables. Run the script with the following command (remember to replace <<YOUR_DATABASE_ROOT_PASSWORD>> with the root password for MySQL):

mysql-config /usr root <<YOUR_DATABASE_ROOT_PASSWORD>> fedora fedora fedora mysql41_flag

If you do not have root access to MySQL, please ask your friendly it-department to run the script for you.

Note: The above command assumes the mysql command is installed as /usr/bin/mysql. If it isn't, replace /usr with the basedir of your MySQL installation (that is excluding bin)

Note 2: Same procedure under Windows, where /usr should be replaced with the path to the MySQL installation. Use double quotes, if the path contains spaces.

Step 4: Setup configuration files

First, run a small script bundled with fedora, that does some basic security setup of the embedded tomcat:

fedora-setup no-ssl-authenticate-apim

Then copy in the custom fedora configuration file from our CVS repository to replace the existing fedora.fcfg

cp <<$CVSROOT>>/Fedora/config/fedora.fcfg ~/fedora-2.1.1/server/config

This sets up fedora with the following properties:

Here is a diff -u of the changes:

--- fedora.fcfg 2007-01-11 14:43:20.000000000 +0100
+++ fedora.fcfg.new     2007-01-11 14:43:28.000000000 +0100
@@ -7 +7 @@
-  <param name="adminEmailList" value="bob@example.org sally@example.org">
+  <param name="adminEmailList" value="kfc@statsbiblioteket.dk">
@@ -19 +19 @@
-  <param name="fedoraServerPort" value="8080">
+  <param name="fedoraServerPort" value="7900">
@@ -23 +23 @@
-  <param name="fedoraShutdownPort" value="8005">
+  <param name="fedoraShutdownPort" value="7905">
@@ -27 +27 @@
-  <param name="fedoraRedirectPort" value="8443">
+  <param name="fedoraRedirectPort" value="7903">
@@ -143 +143 @@
-    <param name="ENFORCE-MODE" value="enforce-policies"/>
+    <param name="ENFORCE-MODE" value="permit-all-requests"/>
@@ -196 +196 @@
-    <param name="retainPIDs" value="demo test changeme fedora-bdef             fedora-bmech       tutorial"/>
+    <param name="retainPIDs" value="*"/>
@@ -340 +340 @@
-    <param name="level" value="0"/>
+    <param name="level" value="1"/>
@@ -480,3 +480,3 @@
-    <param name="dbUsername" value="fedoraAdmin"/>
-    <param name="dbPassword" value="fedoraAdmin"/>
-    <param name="jdbcURL" value="jdbc:mysql://localhost/fedora21?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true"/>
+    <param name="dbUsername" value="fedora"/>
+    <param name="dbPassword" value="fedora"/>
+    <param name="jdbcURL" value="jdbc:mysql://localhost/fedora?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true"/>
@@ -640 +640 @@
-    <param name="poolInitialSize" value="3"/>
+    <param name="poolInitialSize" value="20"/>

For a large scale installation, or an installation accessible from outside localhost, you will need to edit the fedora.fcfg file further. See the Fedora documentation for details.

Step 5: Start the server

fedora-start

Step 6: Test the server is running

Visit the URL

http://localhost:7900/fedora/search

Try searching for *

There should be no results, but no errors either.

Step 7: Setup OAI provider

See SettingUpOAI

Resetting Fedora

To reset a Fedora repository to an empty repository, do the following.

fedora-stop
rm -r ~/fedora-2.1.1/data/objects
fedora-rebuild

choose 1,1

fedora-rebuild

choose 2,1

If you are using the oai provider service, you should also clear the proai cache

mysqldump -uproai -pproai --add-drop-table --no-data proai|grep ^DROP|mysql -uproai -pproai proai

then, finally

fedora-start

Your Fedora repository has now been emptied.

Fedora (last edited 2010-03-17 13:09:23 by localhost)