Installing Nomad as a sub directory of your web server

In case your web server has other jobs to do besides run nomad, you can install it as a component of your web server and leave your web root directory hierarchy untouched.

Here is what we'll be doing in this section:

  1. create directory for nomad and unpack software
  2. modify access.conf by adding options for the Nomad script directory
  3. modify srm.conf by adding the location of the Nomad script directory
  4. modify srm.conf by adding aliases to the Nomad directories
  5. re-start the webserver

When you unpack the Nomad software it will create the directory httpd. This directory contains sub-directories which resemble the normal root directory structure of your web server. In particular it contains the directories for Nomad web pages (httpd/html/nomad), and Nomad scripts (httpd/cgi-bin). You simply have to configure your web server files to point to these two locations as outlined below.

Since Nomad will be accummulating some large image files, it is wise to place it in a location with lots of disk space. In this example we'll use a common place for custom software on UNIX systems, the /usr/local directory. In particular if we were to create a directory for Nomad there (/usr/local/nomad) and unpack the software there, the final path would be: /usr/local/nomad/httpd.

To create the directory and unpack nomad issue the following comands:

mkdir /usr/local/nomad    (you may want to chown this dir to a regular user)
mv nomad.tar.gz /usr/local/nomad/
cd /usr/local/nomad
tar -xzvf nomad.tar.gz

There are two files for your web server that you need to configure (assuming the Apache web server common on most Linux systems), called access.conf and srm.conf. Just looking them over you'd probably be able to figure out what to change, but here are the particulars:

Modify access.conf by adding script options

In the file access.conf (usually located in /etc/httpd/conf/) you have to tell the server where you'd like to allow execution of cgi scripts. In this case the scripts are located in the cgi-bin directory within the httpd directory as noted above. So the full pathway to insert is /usr/local/nomad/httpd/cgi-bin. Duplicate the code in the config file and add your directory (many directories can be configured to serve scripts). Comments are allowed if prefaced by "#".

<Directory /home/httpd/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>
#add nomad directory
<Directory /usr/local/nomad/httpd/cgi-bin>
AllowOverride None
Options ExecCGI
</Directory>

Modify srm.conf

The next file to modify is called srm.conf, and it is located in the same place as access.conf. This is where you specify how you want to call Nomad in the URL (the alias) and the actual location as it exists on your computer. Because of the way Nomad is written, many of the scripts use "relative addressing" that requires us to use a "spacer directory" in the URL that calls Nomad. The spacer directory exists only in the URL, and doesn't actually exist anywhere on the computer. For example, the address of Nomad on my machine would be http://zenith.berkeley.edu/db/nomad. The directory /db doesn't actually exist, but is simply required as a consequence of not installing Nomad as the server root, as was intended when it was written*.
-------------------------
#alias for Nomad "spacer" directory
Alias /db/nomad /usr/local/nomad/httpd/html/nomad
Alias /db/cgi-bin /usr/local/nomad/httpd/cgi-bin
-------------------------


-------------------------
# ScriptAlias: This controls which directories contain server scripts.
# Format: ScriptAlias fakename realname

ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/

#add ScriptAlias for Nomad
ScriptAlias /db/cgi-bin/ /home/seidel/httpd/cgi-bin/
-------------------------

Optional: If you want to be able to call Nomad with a simple URL such as http://www.yourserver.edu/Nomad you can use the Redirect option in srm.conf as follows. Look for the section on Redirects and add the following lines:
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Format: Redirect fakename url
# add Redirect options for Nomad
Redirect /Nomad http://www.yourserver.edu/db/nomad/
#allow people to forget the capital?
Redirect /nomad http://www.yourserver.edu/db/nomad/

Re-start the web server

Now that the web server configuration has changed we need to re-start the server for the new options to take effect. One method of doing this is to use the UNIX kill command to tell the webserver process to re-start itself and re-read its start up files.

kill -1 `cat /var/run/httpd.pid `

The -1 option for kill causes a program to stop and re-start. Every process on a UNIX system has a process ID (aka PID). The process ID of the web server is stored in a file located in /var/run/httpd.pid. The command above is a fancy way of using the "cat" command to list the contents of the httpd.pid file and feed the result to the kill command. Another way of doing this would simply be to look inside the httpd.pid file (i.e. using "more"), and then type the number after the kill command.

One way to check that the web server started up ok is to look at the end of the error_log file kept by the server. Try:

Tail /etc/httpd/logs/error_log

* Another solution to this problem would be to modify many of the dozens of Nomad scripts, but this would get unwieldy. It is still possible to call Nomad with a simple URL such as http://www.yourserver.edu/nomad by simply configuring that URL for redirect to the actual URL of your choice. This is also done in srm.conf using the redirect option.

Back to Nomad installation.