Example Install Fez and Fedora 2.2 on Kubuntu linux 7.10 Gutsy Gibbon

From FezWiki

Jump to: navigation, search

WARNING: This page is in progress - Christiaan

NOTE: Fez 1.3 does not support Fedora 2.2 unless you hack the code.

Once this installation is ready I will export it is as a live Kubuntu CD for others to easily install a fully setup Fez and Fedora site including operating system.

This guide tries to do as much as possible in the adept package manager to make install as easy as possible for other installers to follow.

  1. Installed Kubuntu 7.10 Gutsy Gibbon (via VMWare Fusion on OSX)
  2. Downloaded:
    • Fez 1.3 (final) from the Fez SourceForge website (~2.5 MB)
    • Fedora 2.2 .jar installer file from the Fedora website (~71 MB)
    • Latest JDBC3 driver for PostgreSQL from http://jdbc.postgresql.org/download.html (~500KB) WARNING - the JDBC driver postgres version must match the version of postgres you have installed. EG with Kubuntu 7.10 the package manager installs PostgreSQL 8.2.4, so make sure you download the driver for 8.2, not 8.1 etc
    • JHOVE (latest version 1.1f) (~3.5 MB)
  3. Used Adept package manager to select and then install (All these Adept downloads below sum up to around 158MB):
    • build-essential
    • sun-java5-jdk (it selects all the other java related prerequisites automatically)
    • apache2
    • tomcat5.5 (optional, you can choose to make the fedora installer install its own tomcat - which is what this guide will do)
    • postgresql-8.2
    • pgadmin3 (for those that prefer a GUI for their DB)
    • mysql-server-5.0
    • imagemagick
    • graphviz
    • xpdf
    • msttcorefonts
    • vim-full (not neccessary but vim-full should really be preinstalled in ubuntu in my opinion)
    • (The PHP5 extensions)
      • php5
      • php5-dev
      • php5-mysql
      • php5-pgsql
      • php5-curl
      • php5-gd
      • php5-ldap
      • php5-cli
      • php5-tidy
      • libapache2-mod-php5
  4. Reset the password for the postgres user admin account (choose a password too):
su - postgres
psql postgres postgres 
postgres=# ALTER USER postgres WITH PASSWORD '*password*';

(Now you can use PgAdmin3 to GUI administer the database)

You must manually create the fedoraAdmin user for postgresql and manually create the postgres fedora database:

postgres=# CREATE ROLE "fedoraAdmin" LOGIN PASSWORD 'fedoraAdmin';
postgres=# CREATE DATABASE "fedora22" WITH ENCODING='UTF8' OWNER="fedoraAdmin";
postgres=# \q
  1. Setup the Fedora user and environment variables as per the official 2.2 installation instructions
    • You can set these variables system wide
    • First backup the existing profile
sudo cp -p /etc/bash.bashrc /etc/bash.bashrc_bak 
    • Add the variables to the global profile
kdesu kate /etc/bash.bashrc

Add these lines to the bottom of the file (the aliases are not neccesary but are nice): You can adjust the Xmx memory lower or higher to suit your system specs.

alias ll='ls --color=auto -alh'
alias vi='vim'
FEDORA_HOME=/usr/local/fedora
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
CLASSPATH=$JAVA_HOME/jre/lib
CATALINA_HOME=/var/lib/tomcat5.5
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStore=$FEDORA_HOME/server/truststore"
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStorePassword=tomcat"
JAVA_OPTS="$JAVA_OPTS -Xmx512m"
export FEDORA_HOME JAVA_HOME CLASSPATH CATALINA_HOME JAVA_OPTS
  1. Install the downloaded PostgreSQL JDBC driver
    • close your terminal shell and reopen it to refresh your new environment variables
    • copy the postgresql jdbc jar file installer to your java CLASSPATH directory
cp postgresql-xyz123-jdbc.jar $CLASSPATH
  1. Run the Fedora java installer
    • In the directory where you downloaded the fedora jar file installer run
sudo java -jar fedora-2.2-installer.jar
  1. type custom for the custom install (so we can choose postgresql as the db instead of mckoi)
  2. press enter for the default (/usr/local/fedora)
  3. choose and type in a fedora administrator password
  4. press enter to choose localhost, or put in the hostname of your server/pc if you like
  5. type true for always asking for authentication for API-A requests
  6. type true for SSL - or choose false if you don't want SSL (SSL is recommended)
  7. type included for a bundled Tomcat install, or choose existing if you want to install your own tomcat
  8. press enter for the default tomcat install directory (/usr/local/fedora/tomcat)
  9. press enter for the default tomcat port (8080)
  10. press enter for the default tomcat shutdown port (8005)
  11. type false to disable the XACML enforcement (fez does its own security)
  12. type postgresql as the fedora sql engine
  13. type /usr/lib/jvm/java-1.5.0-sun/jre/lib/postgresql-8.1-408.jdbc3.jar (example only - note that env vars won't work in this string eg $CLASSPATH) for the separately downloaded postgresql driver
  14. type fedoraAdmin or your chosen postgresql username you setup earlier in these instructions
  15. type in the postgresql password you setup earlier for this postgresql username (example showed fedoraAdmin)
  16. press enter for the default postgresql jdbc location url
  17. press enter for the default postgresql jdbc driver class
  18. type false to not install the fedora demos (or if you really want to you can type true..)
  19. Fedora will now install, however there is a bug in the Fedora 2.2 installer for PostgreSQL that incorrectly sets up your postgresql db connection settings in the Fedora fedora.fcfg file so you need to perform the following workaround
  20. Edit the fedora.fcfg config file (make a backup copy first if you want to be extra safe)
kdesu kate $FEDORA_HOME/server/config/fedora.fcfg

Delete the block starting with (NOTE THE CASE of the sql vs SQL text!!!):

<datastore id=localPostgresqlPool... >

Look for the block starting with:

<datastore id=localPostgreSQLPool... >

Edit the parameters for your correct database username, password and jdbc url and save the file.

Then rename the <datastore id=localPostgreSQLPool... > to <datastore id=localPostgresqlPool... >

  1. Time to start it up
cd $FEDORA_HOME/tomcat/bin
sudo ./startup.sh
  1. Install JHOVE
sudo cp jhove-1_1f.tar.gz /usr/local/src/
cd /usr/local/src
sudo tar xvzf jhove-1_1f.tar.gz
cd jhove

Edit the jhove executable:

kdesu kate /usr/local/src/jhove/jhove

Edit and change the JHOVE_HOME, JAVA_HOME variables to these:

JHOVE_HOME=/usr/local/src/jhove
JAVA_HOME=/usr      # Java JRE directory
JAVA=$JAVA_HOME/bin/java # Java interpreter

AND Change the last line to:

${JAVA} -classpath $CP Jhove -c ${JHOVE_HOME}/conf/jhove.conf $ARGS

You should now be able to go run the jhove executable from the shell and it should list its available modules.

Now install jhove to /usr/local/jhove:

sudo ln -s /usr/local/src/jhove /usr/local/jhove
  1. Now time to setup Fez. Give your own user account power to create databases etc
sudo mysql
mysql> grant all on *.* to yourusername@localhost identified by "yourchosenmysqlpassword" with grant option;
mysql> exit
  1. Edit your php.ini and increase the memory and max post size limits
kdesu kate /etc/php5/apache2/php.ini

Modify these variables to these values and save the file:

upload_max_filesize = 100M
memory_limit = 256M
post_max_size = 120M
  1. Edit your php.ini file for the PHP CLI (used for Fez background processes)
kdesu kate /etc/php5/cli/php.ini

Modify these variables to these values and save the file:

upload_max_filesize = 100M
memory_limit = 256M
post_max_size = 120M
  1. Uncompress your downloaded fez-1.3.tar.gz to your /var/www/ apache2 webserver directory:
sudo cp fez-1.3.tar.gz /var/www/
cd /var/www
sudo tar xvzf fez-1.3.tar.gz
sudo mv fez-1.3 fez
sudo chown -R www-data fez
  1. Run the Fez setup script. Open in your browser this link http://localhost/fez/setup/
  1. Fill in the details on the form and hit submit. Fez will install the database and setup the config.inc.php setup file at /var/www/fez/config.inc.php
  1. Edit the config.inc.php and point Fez to the Kubuntu location of some of the required 3rd party application executables.
kdesu kate /var/www/fez/config.inc.php

Change to the matching config variables for linux to these variables:

@define("APP_DOT_EXEC", "/usr/bin/dot");
@define("APP_PHP_EXEC", "/usr/bin/php");
  1. Start Fedora:
cd /usr/local/fedora/tomcat/bin
sudo ./startup.sh
  1. Fix Fez 1.3 to work with Fedora 2.2:
    1. Open /var/www/fez/include/class.fedora_api.php and /var/www/fez/include/class.sanity_checks.php and search for any occurence of mgmt and replace it with management. (should only be two or 3 occurences).
  1. Change MySQL's fulltext indexing to index two character length words:
kdesu kate /etc/mysql/my.cnf

Under [mysqld] Add the line:

ft_min_word_len=2

Now restart MySQL:

sudo /etc/init.d/mysql restart
  1. Open your browser to http://localhost/fez/setup/check_sanity.php. If everything installed ok all the tests should pass (green).
  1. Navigate in your browser to http://localhost/fez/. Click the login button and login as user admin with password admin.
  1. Now you can either start using fez (see the Tutorials), or continue setting up Fez in the Download Statistics setup and/or the Shibboleth service provider setup.
Powered by MediaWiki
GNU Free Documentation License 1.2