Setting Up the MOO's UNIX Directory Structure

Generally, educational MOOs are maintained by a group of people. For this reason, it is convenient to have more than one person be able to maintain the MOO server site, including having the ability to edit and rearrange files on the site. This document details the arrangement of files and directories that Diversity University's experience has found to be effective, and describes the function of each file and directory.

This document does not give instructions for compiling the LambdaMOO Server, which is described elsewhere.

In this example, an admnistrative account is established called "ourmoo" and an administrative group named "mooadmin" is also created. You will typically want to customize this for your own site.

Although you don't have to have root access to the computer to set up most of the MOO's system, you will need someone with root access to create the base directory for the structure (given as "~ourmoo" in the example below), and to create a "ourmoo" account and a "mooadmin" group.

NOTE: The "~ourmoo" directory described below should be set to mode "g+s" before you create any subdirectories within it. In addition, you should use the "umask 007" command either in your ".cshrc" file or by hand before creating the files and subdirectories described here, to save the work of having to adjust their mode later.

Basic Structure

You should generally have an account for the MOO project itself, called "ourmoo" in the example below, although people will generally use their own UNIX account for performing maintenance. In addition, there should be a UNIX group for people who will be performing maintenance, called "mooadmin" in this example.

Diversity University recommends the following structure for a site:

Every directory in this structure should have mode settings o+rwx, g+rwxs, and be owned by the user "ourmoo" and the "mooadmin" group.

Note that all the directories are mode g+s (group SUID). Under most UNIX systems, this insures that files and subdirectories created within these directories will have the same group ownership as the parent directory. This helps insure that these resources will all be manipulatable by your maintenance staff.

In addition, if the accounts for your maintenance staff will be used only for maintaining the MOO, then you should insure that all files and subdirectories they create are group-writable, by including the line:

in the ".cshrc" file of their home directory. If you are not using a C-shell, you will need to adjust accordingly. Note that you might want to have such a ".cshrc" prepared in the "~ourmoo" directory, and then have the personal ".cshrc" files of individual users contain: as their only line. If their work will not be group-writable by default, your staff will need to remember to appropriately "chmod" the files and directories that they create.

Directory ~ourmoo/bin/

This directory contains the scripts and other maintenance tools used for MOO support. If you have other software installed specifically for use by MOO maintenance staff, it should generally go here. The scripts that Diversity University has developed and recommends are: IMPORTANT: You will need to change some configuration lines in each of these scripts to enable them to run correctly! Generally, this involves specifying what the MOO system's base directory is (e.g. "/usr/ourmoo/") and in what directory the MOO database is located (e.g. "usr/ourmoo/moo").

The "statmoo" script can be used as a cgi-bin if you have a Web server that supports these. This allows you to check the status of the MOO through the Web. Generally, it can simply be copied to the appropriate directory where such applications belong, and usually renamed to "statmoo.cgi" (mostly for clarity, since this isn't generally required).

You'll probably want to add "~ourmoo/bin" to your PATH, to enable you to issue commands like "runmoo" and "watchmoo" without giving the full path for those scripts. You'll generally have to expand "~ourmoo" to its full specification (e.g. "/usr/ourmoo") for setting the PATH environment variable.

Directory ~ourmoo/moo/

Files and subdirectories in ~ourmoo/moo include the MOO database and server, logs, and other files directly associated with the MOO itself. This directory include:
modes group owner file or directory
-rw-rw----  ourmoo mooadmin ourmoo.db
-rw-rw---- ourmoo mooadmin crontab.ourmoo
drwxrws--- ourmoo mooadmin files
drwxrws--- ourmoo mooadmin backup.dbs
drwxrws--- ourmoo mooadmin backup.logs
drwxrwx--- ourmoo mooadmin server-source
 

This directory also must contain a link named "moo" to the "~ourmoo/moo/server-source/MOO-1.8.0p6/moo" executable file (the compiled LambdaMOO Server itself).

The ourmoo.db file is the MOO database itself. If you are starting with an eDUcore, you will want to place a copy in this directory and rename the database appropriately (with a ".db" extension). Note that you don't have to name the MOO database according to the name of the administrative username ("ourmoo" in this example), although it must have the ".db" extension. The name given to the MOO database, however, will be used as the base for some of the other supporting files (e.g. the log files), and you may need to adjust the configuration of the supporting scripts appropriately.

The crontab.ourmoo file gives the schedule for the nightly full backups of the MOO database (and associated FUP file system). An example is provided in the eDUcore server setup package. Note that you'll need to modify it to fit your own directory names and structure.

Note that other files will be automatically created when you run the MOO, including:

The "du.log" file is the log for the running MOO, which is transferred to the "backup.logs" directory each time the MOO is restarted.

The "moo.pid" file is the current PID for the MOO process, written by the "runmoo" script, and which is used by the "killmoo" and "statmoo" scripts.

The "du.restart.log" notes each time the MOO is restarted, and is written to by the "runmoo" script.

The "du_backup.log" and "du_backup.pid" files are the log and current PID for the nightly full MOO backup process. The "dobackup" script writes to them.

Directory ~ourmoo/moo/backup.logs

When the MOO is restarted, the "runmoo" script appends the existing "~ourmoo/moo/ourmoo.log" file to a file in this directory. Note that the logs continue to get appended, so this file can grow rather large. We recommend renaming and compressing it quarterly. The compressed log archives can be stored in this directory.

Directory ~ourmoo/moo/backup.dbs

The nightly full backup of the MOO database and associated FUP files is stored here by the "dobackup" script. Depending upon the settings in the "~ourmoo/moo/crontab.ourmoo" file, several days of nightly backups are retained (usually three to seven). In addition, you should rename one of the nightly backup archive files monthly, quarterly, and annually for longer-term retention, depending on your needs and amount of available disk space.

Direcotry ~ourmoo/moo/files

This directory is used by the MOO's FUP system, if it has been installed. We strongly recommend you use FUP, since it allows the MOO to store mail system texts, and other texts, outside the database itself. Mail system texts are usually one of the largest resources in the MOO, in terms of amount of memory it takes up. In order to minimize the size of the database, we recommend using the FUP system to "externalize" the mail system. The MOO itself will create all the files and subdirectories needed in the "~ourmoo/moo/files" directory. How to modify the MOO to use externalized mail is described in the MOO's internal help system under the "disk-mail" topic.

The MOO also uses the FUP system to retrieve it's Web Gateway page, from "~ourmoo/moo/files/web/gateway.html" if that file exists. This enables a simple mechanism to provide the same gateway page through both the MOO and an external Web server.

Directory ~ourmoo/moo/server-source

This directory contains the source files and compiled version of the LambdaMOO server, server patches, and any previous versions of the LambdaMOO server you may choose to retain. A typical structure for this directory is: We assume here that you have only the 1.8.0p6 version of the MOO server installed. Note that for this example the link at "~ourmoo/moo/moo" points to the executable file "moo" in the "~ourmoo/moo/server-source/MOO-1.8.0p6/" directory. That directory is generally created automatically when you fully expand the "LambdaMOO-1_8_0p6_tar.gz" file.

The "~ourmoo/moo/server-source/patches/" directory should contain the MOO server patches that you will be applying to the MOO server before compiling it. Diversity University recommends several patches, which are available at:

These patches should be placed in this directory. Generally, you can do this just by downloading the archive file containing all the patches into this directory, and expanding it. Application of the patches, and how to compile the LambdaMOO Server, is described in a separate document.

Diversity University eDUcore



Last modified 09Dec97
Copyright 1997 © Diversity University. All rights reserved.