ELOG Administrator's Guide  

How to set up and run your very own ELOG server

  Installing and running on UNIX  

ELOG is being developed and tested under Linux, and is being used on (Sparc) Solaris workstations. It should also compile and run on other UNIX flavours.


Installation from the RPM file:

Since version 2.0, ELOG contains a RPM file which eases the installation. Get the file elog-x.x.x-x.i386.rpm from the download section and execute as root "rpm -i elog-x.x.x-x.i386.rpm". This will install the elogd daemon in /usr/local/sbin and the elog and elconv programs in /usr/local/bin. The sample configuration file elogd.cfg together with the sample logbook will be installed under /usr/local/elog and the documentation goes to /usr/share/doc. The elogd startup script will be installed at /etc/rc.d/init.d/elogd. To start the daemon, enter

It will listen under the port specified in /usr/local/elog/elogd.cfg which is 8080 by default. So one can connect using any browser with the URL:

To start the daemon automatically, enter:

which will start the daemon on run levels 3,4 and 5 after the next reboot.

Note that the RPM installation creates a user and group elog, under which the daemon runs.

To start the daemon on non-RedHat systems, like SuSE or Solaris, a more generic startup scrips has been provided by Steve Jones in the Contributions section.


Installation from the tarball:

Download the latest elog-x.x.x.tar.gz package.

Expand the compressed TAR file with tar -xzvf elog-x.x.x.tar.gz. This creates a subdirectory elog-x.x.x where x.x.x is the version number. In that directory execute make, which creates the executables elogd, elog and elconv. These executables can then be copied to a convenient place like /usr/local/bin or ~/bin. Alternatively, a "make install" will copy the daemon elogd to SDESTDIR (by default /usr/local/sbin) and the other files to DESTDIR (by default /usr/local/bin). These directories can be changed in the Makefile. The elogd executable can be started manually for testing with :

where the -p flag specifies the port. Without the -p flag, the server uses the standard WWW port 80. Note that ports below 1024 can only be used if elogd is started under root, or the "sticky bit" is set on the executable.

When elogd is started under root, it attaches to the specified port and tries to fall-back to a non-root account. This is necessary to avoid security problems. It looks in the configuration file for the statements Usr and Grp.. If found, elogd uses that user and goupe name to run under. The names must of course be present on the system (usually /etc/passwd and /etc/group). If the statements Usr and Grp. are not present, elogd tries user and group elog, then the default user and group (normally nogroup and nobody). Care has to be taken that elogd, when running under the specific user and group account, has read and write access to the configuration file and logbook directories. Note that the RPM installation automatically creates a user and group elog.

If the program complains with something like "cannot bind to port...", it could be that the network is not started on the Linux box. This can be checked with the /sbin/ifconfig program, which must show that eth0 is up and running.

The distribution contains a sample configuration file elogd.cfg and a demo logbook in the demo subdirectory. If the elogd server is started in the elogd-x.x.x directory, the demo logbook can be directly accessed with a browser by specifying the URL http://localhost:8080 (or whatever port you started the elog daemon on). If the elogd server is started in some other directory, you must specify the full path of the elogd file with the "-c" flag and change the Data dir = option in the configuration file to a full path like /usr/local/elog.

Once testing is complete, elogd will typically be started with the -D flag to run as a daemon in the background, like this :

Note that it is mandatory to specify the full path for the elogd file when started as a daemon.

To test the daemon, connect to your host via :

If port 80 is used, the port can be omitted in the URL. If several logbooks are defined on a host, they can be specified in the URL :

where <logbook> is the name of the logbook.

The contents of the all-important configuration file elogd.cfg are described below.

  Notes for various platforms  

Solaris:

Martin Huber reports that under Solaris 7 the following command line is needed to compile elog:

With some combinations of Solaris servers and client-side browsers there have also been problems with ELOG's keep-alive feature. In such a case you need to add the "-k" flag to the elogd command line to turn keep-alives off.


Mac OS X:

Sridhar Anandakrishnan and Recai Oktas report that under Mac OS X there is a problem with the default stack size. The command limit stacksize unlimited (for tcsh) or ulimit -s unlimited (for bash) increases the stacksize and fixes this problem. Read the according thread in the forum.


FreeBSD:

David Otto maintains the ELOG port for FreeBSD. To install ELOG on a FreeBSD system, you can simply type

  Running elogd under Apache  

For cases where elogd should run under port 80 in parallel to an Apache server, Apache can be configured to run Elog in a subdirectory of Apache. Start elogd normally under port 8080 (or similarly) as noted above and make sure it's working there. Then put following redirection into the Apache configuration file:

Make sure that the Apache modules mod_proxy.c and mod_alias.c are activated. Justin Dieters <enderak@yahoo.com> reports that mod_proxy_http.c is also required. The Redirect statement is necessary to automatically append a "/" to a request like http://your.host.domain/elog. Apache then works as a proxy and forwards all requests staring with /elog to the elogd daemon.

Note: Do not put "ProxyRequests On" into your configuration file. This option is not necessary and can be misused for spamming and proxy forwarding of otherwise blocked sites.

Because elogd uses links to itself (for example in the email notification and the redirection after a submit), it has to know under which URL it is running. If you run it under a proxy, you have to add the line:

into elogd.cfg.

Note that the variable $remote_host cannot be used inside elogd since the remote host is always the proxy host (anybody knows how to fix that???).


  Installing and running in Windows  

ELOG is distributed in binary (executable) form for Windows platforms. It will run happily in console mode (or "DOS box") under Windows 9x and ME. Under Windows NT and 2000 it is also possible to run it as a service (the Windows equivalent of a UNIX daemon).

Download the latest elogxxx.exe file and execute it. The installer puts the ELOG system into a directory you specify and adds some menu shortcuts. With these shortcuts, the daemon elogd.exe can be started directly and the demo logbook can be accessed with the browser. Alternatively, the elogd.exe daemon can be registered as a service under Windows NT/2000/XP, so it gets started automatically when windows boots. This can be selected during installation or be done manually with the start menu shortcuts.

While the pre-2.5.3 methods of installing elogd.exe as a daemon (namely FireDaemon and srvany.exe) are still possible, they are not recommended any more.

Under Windows, the ports below 1024 can be used without restriction. So if no web server is running on the same PC the ELOG daemon can be started under the standard Web port 80. This is achieved by changing the port=8080 option in elogd.cfg to port=80 and restarting elogd.


  Server Configuration  

The ELOG daemon elogd can be executed with the following options :

with :

It may also be used to generate passwords :

with :

The appearance, functionality and behaviour of the various logbooks on an ELOG server are determined by the single elogd.cfg file in the ELOG installation directory.

This file may be edited directly from the file system, or from a form in the ELOG Web interface (when the Config menu item is available). In this case, changes are applied dynamically without having to restart the server. Instead of restarting the server, under Unix one can send a HUP signal like "killall -HUP elogd" to tell the server to re-read its configuration.

The many options of this unique but very important file are documented on the separate elogd.cfg syntax page.

To better control appearance and layout of the logbooks, elogd.cfg may optionally specify the use of additional files containing HTML code, and/or custom "themes" configurations. These need to be edited directly from the file system right now.

The meaning of the directory flags -s and -d is explained in the section covering the configuration options Resource dir and Logbook dir in the elogd.cfg description.


  Secure Connections HOWTO  

Although the elogd program does not support secure connections over SSL directly, it is still possible to access elogd securely using one of the following methods. It is recommented to run elog through an HTTPS proxy to avoid exposing elog passwords to clear text sniffing attacks.

Using Apache:

The
Apache web server can be used as a proxy server allowing secure connections. To do so, Apache has to be configured accordingly and a certificate has to be generated. See some instructions on how to create a certificate, and see Running elogd under Apache before on this page on how to run elogd under Apache. Once configured correctly, elogd can be accessed via http://your.host and via https://your.host simultaneously.

The redirection statement has to be changed to and following has to be added to the section "VirtualHOst ...:443 in /etc/httpd/conf.d/ssl.conf: Then, following URL statement has to be written to elogd.cfg: There is a more detailed step-by-step instructions at the contributions section.

Using ssh:

elogd can be accessed through a a SSH tunnel. To do so, open an SSH tunnel like:

This opens a secure tunnel from your local host, port 1234, to the server host where the elogd daemon is running on port 8080. Now you can access http://localhost:1234 from your browser and reach elogd in a secure way.

Using stunnel:

Note: It was reported that the below instructions are outdated. However I will leave them for a while as a working basis for someone who volunteers to update them..

To use elogd togethwer with stunnel, following steps are necessary:

  1. Start elogd. If another Web server is running on port 80, use a different port.

  2. Configure stunnel. This requires the creation of a certificate. See the manual for details.

  3. Start the stunnel program if not already done and start it with:

    stunnel -d 443 -r your.host.name:80
    Substitute the port 80 if you started elogd on another port. This causes stunnel to receive requests on the https port 443 and forward them to the elogd port.

  4. Put the URL under which elogd runs into elogd.cfg:

    URL = https://your.host.name/
    Note the https at the beginning of the URL, which is mandatory. Once you use the https URL, elog won't work correctly when accessed not through stunnel via http://.., since any redirection would always bring you back to https://...).

  5. Connect to your logbook with a browser which supports SSL via:

    https://your.host.name/
  6. If you have problems, start stunnel in the foreground mode with

    stunnel -f -d 443 -r your.host.name:80
    This reveals any potential error.


  How It All Works  

For the technically curious :

The concept of ELOG is very simple. The logbook functionality is implemented by a single daemon program, elogd, which is written in C. It contains an integrated Web server, which does not serve files like standard Web servers, but reads logbook entries from its database and formats them into HTML. Since only forms and tables are used, no Java or Javascript is necessary, which makes the logbook display very fast. The system does not use any images on purpose to reduce the amount of data to be transferred. Since the ELOG daemon contains its own http server, no additional server like Apache is required.

The "database" in which ELOG saves its entries is in plain ASCII format. One file is created for each day in the form YYMMDDa.log (where YY is the year, MM the month and DD the day). For ELOG versions 1.x.x, the format was YYMMDD.log. Messages are separated internally by the string $@MID@$. If this string is entered in a message (main body text or attribute), it gets converted automatically in order not to invalidate the database structure.

If attachments are submitted, they are saved as separate files named YYMMDD_HHMMSS_name - where in addition to the date the time is specified and name is the original file name of the attachment. To copy the database to another computer, only the *.log files and the attachment files need to be copied. To copy for example all files from March 2001, just select them with 0103??a.log and 0103??_*.