= 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 == * Java 1.5 * A MySQL database For a full-scale Fedora installation, furthermore you need the following: * Decent processor power (e.g. a Xeon 3GHz dual-CPU machine) * at least 4GB RAM, preferably more. * 400GB+ fast harddisks * 64 bit operating system * 64 bit Java 1.5 * A filesystem that can handle 10 million+ small files. * Tip: Turn off updating of the lastAccessed timestamp on the file system. This speeds up harddisk access for Fedora. * Tip: Consider putting the MySQL database on a separate harddisk for faster access/update time, about 1/10th of the space should be allocated for this. == 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. * Unpack & execute the installer. * Select "Typical". * Skip the part with the MySQL.com Sign Up. * Choose the setup option at the end of the installation (default). Use the choices below in the wizard. Only deviations from the standard selections are described. * Detailed Configuration. * Developer Machine. * Non-Transactional Database Only. * Manual Setting for concurrent connections: 100 (the default maximum for Fedora). * Turn off "Enable Strict Mode". * Best Support For Multilingualism. * Include Bin Directory in Windows PATH. * Write a root password. '''Remember it!'''. === 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 ;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 <> with the root password for MySQL): {{{ mysql-config /usr root <> 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: * Using MySQL on localhost initialised as above. * Starting the server on localhost port 7900, and using ports in the range 7901-7909 for various purposes. * Using the directory ~/fedora-2.1.1/data for data 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 @@ - + @@ -19 +19 @@ - + @@ -23 +23 @@ - + @@ -27 +27 @@ - + @@ -143 +143 @@ - + @@ -196 +196 @@ - + @@ -340 +340 @@ - + @@ -480,3 +480,3 @@ - - - + + + @@ -640 +640 @@ - + }}} For a large scale installation, or an installation accessible from outside localhost, you will need to edit the fedora.fcfg file further. See [[http://www.fedora.info/download/2.1.1/userdocs/distribution/installation.html#d0e365|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.