Metacat Apache Configuration
KNB Home Data People Informatics Biocomplexity Education Software

Table of Contents
Introduction
Unbuntu/Debian Configuration
Set Up Mod JK
Set Up Metacat Site
LSID Service Configuration
Reload Apache
Other O/S Configuration
Introduction

If you are going to run Tomcat behind the Apache web server, you have some additional setup to perform. One of the reasons for recommending the Ubuntu Linux O/S is its ease of setup. This becomes abundantly clear when configuring Apache. We will address Ubuntu/Debian configurations separately from all other configurations.

Unbuntu/Debian Configuration

If you are installing on an Ubuntu/Debian system, and you installed Apache using apt-get, the Metacat code will have helper files that can be dropped into directories to configure Apache. Depending on whether you are installing from binary distribution or source, these helper files will be in one of two locations:

We will refer to the directory with the helper scripts as <metacat_helper_dir>

We will refer to the directory where Apache is installed as <apache_install_dir>

Set Up Mod JK

Apache uses a module called Mod JK to talk to Tomcat applications. If you haven't done so already, you can install it by typing:

sudo apt-get install libapache2-mod-jk

The helper files that configure the interface between Apache and Tomcat are jk.conf and workers.properties. To install these files:

sudo cp <metacat_helper_dir>/jk.conf <apache_install_dir>/mods-available/
sudo cp <metacat_helper_dir>/workers.properties <apache_install_dir>

Disabling and re-enabling the Apache Mod JK module will pick up the new changes:

sudo a2dismod jk
sudo a2enmod jk
Set Up Metacat Site

Next, Apache needs to know about the Metacat site. The helper file named "knb" has rules that tell Apache which traffic to route to Metacat. Set up the knb (Metacat) site by dropping the knb file into the sites-available directory and running the a2ensite to enable the site:

sudo cp <metacat_helper_dir>/knb <apache_install_dir>/sites-available
sudo a2ensite knb
LSID Service Configuration

If you want to run an optional LSID server along with the Metacat server, set up and enable the authority service site configurations by typing:

sudo cp <metacat_helper_dir>/authority <apache_install_dir>/sites-available
sudo a2ensite authority
Reload Apache

Reload apache to bring in changes by typing:

sudo /etc/init.d/apache2 force-reload
Other O/S Configuration

If you are running on an O/S other than Ubuntu/Debian or you installed the Apache source or binary, you will need to manually edit the Apache configuration file.

We will refer to the directory where Apache is installed as <apache_install_dir>

Edit:

<apache_install_dir>/conf/httpd.conf
Mod JK Log Configuration

You should configure the log location and level for Mod JK. If you do not already have a section like this, you should add it.

<IfModule mod_jk.c>
  JkLogFile "/var/log/tomcat/mod_jk.log"
  JkLogLevel info
</IfModule>

You can set the log location to any place you like

Virtual Host Configuration

The following section configures apache to talk to route traffic to the Metacat application.

<VirtualHost XXX.XXX.XXX.XXX:80>
  DocumentRoot /var/www
  ServerName dev.nceas.ucsb.edu
  ErrorLog /var/log/httpd/error_log
  CustomLog /var/log/httpd/access_log common

  ScriptAlias /cgi-bin/ "/var/www/cgi-knb/"
  <Directory /var/www/cgi-knb/>
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
  </Directory>

  ScriptAlias /knb/cgi-bin/ "/var/www/webapps/knb/cgi-bin/"
  <Directory "/var/www/webapps/knb/cgi-bin/">
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
  </Directory>

  JkMount /knb ajp13
  JkMount /knb/* ajp13
  JkMount /knb/metacat ajp13
  JkUnMount /knb/cgi-bin/* ajp13
  JkMount /*.jsp ajp13
  JkMount /metacat ajp13
  JkMount /metacat/* ajp13
</VirtualHost>

Some notes:

workers.properties file

You will need to drop a file named "workers.proerpties" file into your Apache configuration directory, and edit the file to make sure all properties are correct. Metacat provides a base workers.properties file for you to use. Depending on whether you are installing from binary distribution or source, the workers.properties files will be in one of two locations:

Copy the workers.properties file into:

<apache_install_dir>/conf/

Edit the workers.properties file and make sure the following properties are set correctly:

LSID Service Configuration

If you want to run an optional LSID server along with the Metacat server, add the following lines to the VirtualHost section you configured above:

  JkMount /authority ajp13
  JkMount /authority/* ajp13
Reload Apache

Restart apache to bring in changes by typing:

sudo /etc/init.d/apache2 restart