Project

General

Profile

1
<!-- 
2
  *   '$RCSfile$'
3
  *     Purpose: web page describing the installation of Metacat
4
  *   Copyright: 2008 Regents of the University of California and the
5
  *               National Center for Ecological Analysis and Synthesis
6
  *     Authors: Chad Berkley
7
  *
8
  *    '$Author: daigle $'
9
  *    '$Date: 2008-11-24 11:57:40 -0800 (Mon, 24 Nov 2008) $'
10
  *    '$Revision: 4621 $'
11
  *
12
  *
13
  -->
14
  
15
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.0//EN">
16
<html>
17

    
18
<head>
19
  <title>Metacat Apache Configuration</title>
20
  <link rel="stylesheet" type="text/css" href="./common.css">
21
  <link rel="stylesheet" type="text/css" href="./default.css">
22
</head>
23

    
24
<body>
25

    
26
<table class="tabledefault" width="100%">
27
<tr><td rowspan="2"><img src="./images/KNBLogo.gif"></td>
28
<td colspan="7">
29
<div class="title">Metacat Apache Configuration</div>
30
</td>
31
</tr>
32
<tr>
33
  <td><a href="/" class="toollink"> KNB Home </a></td>
34
  <td><a href="/data.html" class="toollink"> Data </a></td>
35
  <td><a href="/people.html" class="toollink"> People </a></td>
36
  <td><a href="/informatics" class="toollink"> Informatics </a></td>
37
  <td><a href="/biodiversity" class="toollink"> Biocomplexity </a></td>
38
  <td><a href="/education" class="toollink"> Education </a></td>
39
  <td><a href="/software" class="toollink"> Software </a></td>
40
</tr>
41
</table>
42
<hr>
43

    
44
<div class="header1">Table of Contents</div>
45
  <div class="toc">
46
    <div class="toc1"><a href="#Intro">Introduction</a></div>
47
    <div class="toc1"><a href="#UbuntuConfig">Unbuntu/Debian Configuration</a></div>
48
      <div class="toc2"><a href="#ModJK">Set Up Mod JK</a></div>
49
      <div class="toc2"><a href="#SetUpKnb">Set Up Metacat Site</a></div>
50
      <div class="toc2"><a href="#LsidConfig">LSID Service Configuration</a></div>
51
      <div class="toc2"><a href="#UbuntuReloadApache">Reload Apache</a></div>
52
    <div class="toc1"><a href="#OtherConfig">Other O/S Configuration</a></div>
53
  </div> 
54

    
55
<a name="Intro"></a><div class="header1">Introduction</div>
56
  <p>If you are going to run Tomcat behind the Apache web server, you have some additional
57
  setup to perform.  One of the reasons for recommending the Ubuntu Linux O/S is its 
58
  ease of setup.  This becomes abundantly clear when configuring Apache.  We will
59
  address Ubuntu/Debian configurations separately from all other configurations.</p>
60
  
61
<a name="UbuntuConfig"></a><div class="header1">Unbuntu/Debian Configuration</div>  
62
   <p>If you are installing on an Ubuntu/Debian system, and you installed Apache using 
63
   apt-get, the Metacat code will have helper files that can be dropped into directories 
64
   to configure Apache.  Depending on whether you are installing from binary distribution 
65
   or source, these helper files will be in one of two locations:
66
   
67
   <ul>
68
   <li>Installing From Binary Distribution - the helper files will be located in the 
69
   directory where you extracted the distribution.</li>
70
   <li>Installing From Source - regardless if it's a source distribution or source that 
71
   you checked out from the SVN repository, the helper files will be located in:
72
     <div class="code">&lt;metacat_code_dir&gt;/src/scripts</div></li>
73
   </ul>
74
   <p>We will refer to the directory with the helper scripts as &lt;metacat_helper_dir&gt;</p>
75
   <p>We will refer to the directory where Apache is installed as &lt;apache_install_dir&gt;</p>
76
   
77
   <a name="ModJK"></a><div class="header2">Set Up Mod JK</div>
78
	<p>Apache uses a module called Mod JK to talk to Tomcat applications.  If you haven't done so 
79
	already, you can install it by typing:</p>	
80
	  <div class="code">sudo apt-get install libapache2-mod-jk</div>
81
	<p>The helper files that configure the interface between Apache and Tomcat are jk.conf and workers.properties.
82
	To install these files:</p>
83
      <div class="code">sudo cp &lt;metacat_helper_dir&gt;/jk.conf &lt;apache_install_dir&gt;/mods-available/</div>
84
      <div class="code">sudo cp &lt;metacat_helper_dir&gt;/workers.properties &lt;apache_install_dir&gt;</div>
85
    <p>Disabling and re-enabling the Apache Mod JK module will pick up the new changes:</p>
86
      <div class="code">sudo a2dismod jk</div>
87
      <div class="code">sudo a2enmod jk</div>
88
    
89
   <a name="SetUpKnb"></a><div class="header2">Set Up Metacat Site</div>   
90
    <p>Next, Apache needs to know about the Metacat site.  The helper file named "knb" has rules that
91
    tell Apache which traffic to route to Metacat.  Set up the knb (Metacat) site by dropping the 
92
    knb file into the sites-available directory and running the a2ensite to enable the site:</p>
93
      <div class="code">sudo cp &lt;metacat_helper_dir&gt;/knb &lt;apache_install_dir&gt;/sites-available</div>
94
      <div class="code">sudo a2ensite knb</div>
95
      
96
    <a name="LsidConfig"></a><div class="header2">LSID Service Configuration</div>   
97
    <p>If you want to run an optional LSID server along with the Metacat server, set up and enable the authority service site 
98
      configurations by typing:</p>
99
      <div class="code">sudo cp &lt;metacat_helper_dir&gt;/authority &lt;apache_install_dir&gt;/sites-available</div>
100
      <div class="code">sudo a2ensite authority</div>
101
      
102
    <a name="UbuntuReloadApache"></a><div class="header2">Reload Apache</div>
103
    <p>Reload apache to bring in changes by typing:</p>
104
      <div class="code">sudo /etc/init.d/apache2 force-reload</div>
105
  
106
<a name="OtherConfig"></a><div class="header1">Other O/S Configuration</div>
107
  <p>If you are running on an O/S other than Ubuntu/Debian or you installed the
108
  Apache source or binary, you will need to manually edit the Apache configuration
109
  file.</p> 
110
     
111
  <p>We will refer to the directory where Apache is installed as &lt;apache_install_dir&gt;</p>
112
  
113
  <p>Edit:</p>
114
    <div class="code">&lt;apache_install_dir&gt;/conf/httpd.conf</div>
115
   
116
  <a name="ModJkLog"></a><div class="header2">Mod JK Log Configuration</div>
117
    <p> You should configure the log location and level for Mod JK.  If you do not
118
    already have a section like this, you should add it.</p>  
119
    
120
    <div class="code">
121
    &lt;IfModule mod_jk.c&gt;<br>
122
       &nbsp;&nbsp;JkLogFile "/var/log/tomcat/mod_jk.log"<br>
123
       &nbsp;&nbsp;JkLogLevel info<br>
124
    &lt;/IfModule&gt;
125
    </div>
126
    
127
    <p>You can set the log location to any place you like</p>
128

    
129
  <a name="VirtualHost"></a><div class="header2">Virtual Host Configuration</div>  
130
  <p>The following section configures apache to talk to route traffic to the Metacat
131
  application.</p>
132
    <div class="code">
133
    &lt;VirtualHost XXX.XXX.XXX.XXX:80&gt;<br>
134
      &nbsp;&nbsp;DocumentRoot /var/www<br>
135
      &nbsp;&nbsp;ServerName dev.nceas.ucsb.edu<br>
136
      &nbsp;&nbsp;ErrorLog /var/log/httpd/error_log<br>
137
      &nbsp;&nbsp;CustomLog /var/log/httpd/access_log common<br>
138
    <br>
139
      &nbsp;&nbsp;ScriptAlias /cgi-bin/ "/var/www/cgi-knb/"<br>
140
      &nbsp;&nbsp;&lt;Directory /var/www/cgi-knb/&gt;<br>
141
        &nbsp;&nbsp;&nbsp;&nbsp;AllowOverride None<br>
142
        &nbsp;&nbsp;&nbsp;&nbsp;Options ExecCGI<br>
143
        &nbsp;&nbsp;&nbsp;&nbsp;Order allow,deny<br>
144
        &nbsp;&nbsp;&nbsp;&nbsp;Allow from all<br>
145
      &nbsp;&nbsp;&lt;/Directory&gt;<br>
146
    <br>
147
      &nbsp;&nbsp;ScriptAlias /knb/cgi-bin/ "/var/www/webapps/knb/cgi-bin/"<br>
148
      &nbsp;&nbsp;&lt;Directory "/var/www/webapps/knb/cgi-bin/"&gt;<br>
149
        &nbsp;&nbsp;&nbsp;&nbsp;AllowOverride None<br>
150
        &nbsp;&nbsp;&nbsp;&nbsp;Options ExecCGI<br>
151
        &nbsp;&nbsp;&nbsp;&nbsp;Order allow,deny<br>
152
        &nbsp;&nbsp;&nbsp;&nbsp;Allow from all<br>
153
      &nbsp;&nbsp;&lt;/Directory&gt;<br>
154
    <br>
155
      &nbsp;&nbsp;JkMount /knb ajp13<br>
156
      &nbsp;&nbsp;JkMount /knb/* ajp13<br>
157
      &nbsp;&nbsp;JkMount /knb/metacat ajp13<br>
158
      &nbsp;&nbsp;JkUnMount /knb/cgi-bin/* ajp13<br>
159
      &nbsp;&nbsp;JkMount /*.jsp ajp13<br>
160
      &nbsp;&nbsp;JkMount /metacat ajp13<br>
161
      &nbsp;&nbsp;JkMount /metacat/* ajp13<br>
162
    &lt;/VirtualHost&gt;<br>
163
    </div>
164
    
165
    <p>Some notes:</p>
166
    <ul>
167
    <li>ServerName - should be set to the dns name where you will serve Metacat.</li>
168
    <li> ScriptAlias /knb/cgi-bin/ - this directive and the following Directory section
169
    should both point to the cgi-bin directory inside your Metacat installation.</li>
170
    </ul>
171
    
172

    
173
  <a name="WorkersProperties"></a><div class="header2">workers.properties file</div> 
174
   <p>You will need to drop a file named "workers.proerpties" file into your Apache 
175
   configuration directory, and edit the file to make sure all properties are correct.
176
   Metacat provides a base workers.properties file for you to use.  Depending on 
177
   whether you are installing from binary distribution or source, the workers.properties
178
   files will be in one of two locations:
179
   
180
   <ul>
181
   <li>Installing From Binary Distribution - the file will be located in the 
182
   directory where you extracted the distribution.</li>
183
   <li>Installing From Source - regardless if it's a source distribution or source that 
184
   you checked out from the SVN repository, the file will be located in:
185
     <div class="code">&lt;metacat_code_dir&gt;/src/scripts/workers.properties</div></li>
186
   </ul>   
187
   
188
   <p>Copy the workers.properties file into:</p>
189
     &lt;apache_install_dir&gt;/conf/
190
     
191
   <p>Edit the workers.properties file and make sure the following properties are
192
   set correctly:</p>
193
   <ul>
194
   <li>workers.tomcat_home - should be set to the Tomcat install directory on your system.</li>
195
   <li>workers.java_home  - should be set to the Java install directory on your system.</li>
196
   </ul> 
197
   
198
  <a name="LsidConfig"></a><div class="header2">LSID Service Configuration</div>   
199
    <p>If you want to run an optional LSID server along with the Metacat server, add the following lines to the
200
    VirtualHost section you configured above:</p>
201
      <div class="code">
202
        &nbsp;&nbsp;JkMount /authority ajp13<br>
203
        &nbsp;&nbsp;JkMount /authority/* ajp13<br>
204
      </div>
205
      
206
    <a name="UbuntuReloadApache"></a><div class="header2">Reload Apache</div>
207
    <p>Restart apache to bring in changes by typing:</p>
208
      <div class="code">sudo /etc/init.d/apache2 restart</div>
209
      
210
    <br>    
211
</body>
212
</html>
(22-22/61)