Web Server Configuration
------------------------

Your web server must be configured to

- Execute files ending to .cgi as CGI scripts

- Execute and show output of index.cgi as directory index

- Allow execution of CGI scripts in the directory where Wcal is installed

If using Apache:

    Add the following lines to srm.conf and restart Apache

      <Directory /home/httpd/html/wcal>
        AddHandler cgi-script .cgi
        DirectoryIndex index.cgi
        Options +ExecCGI
      </Directory>

    (Change the directory to where you installed Wcal.)

    If using Apache 1.3 or newer, make sure the Apache configuration option
    ServerSignature is not on. This breaks Wcal.

If using Netscape Enterprise Server:

    - To make index.cgi run as a CGI script, set "Activate CGI as a file
      type to "Yes" under "Programs" / "CGI File Type".

    - To make the server show index.cgi as directory index, "index.cgi" has
      to be added to the "Index Filenames" section under "Content Mgmt" /
      "Document Preferences". Thanks to Philipp Hanes <phanes@iconnet.com>
      for these instructions.

    However, Netscape Enterprise Server (obviously) doesn't use .htaccess
    files for access control, so Wcal access control simply won't out of
    box, and you must configure it separately in web server.

I don't know about other web servers. If you get Wcal to work with other web
servers, please tell me how you did that.

Once your web server is correctly configured, install Wcal itself either
by doing automatic installation as explained in the next section, or
install it by hand as instructed in section Manual Installation.

Automatic Installation
----------------------

1. If your perl isn't in /usr/bin/perl, change the path to perl on the first
line of wcald. Default values assume you're installing Wcal as root.

2. Set the two variables at the top of Makefile correctly, and do

  make install

That will compile and install Wcal.

3. Edit /etc/wcal.conf to suit yourself.

4. If using Apache 1.3 or newer, make sure the Apache configuration option
ServerSignature is not on. This breaks Wcal.

5. Now you should be done. You must start Wcal daemon wcald to the
background, so type something like

  /home/httpd/html/wcal/wcald &

After that you should be able to access Wcal by refering to index.cgi, by
default in URL /wcal/.

If automatic installation didn't work for you, read the next section Manual
Installation.

Manual Installation
-------------------

0. If you don't have perl modules Data::Dumper and Date::Manip installed, or
you have version older than 5.22 of Date::Manip, install them; they come
with Wcal distribution. You install them as following

  zcat Data-Dumper-2.07.tar.gz | tar xvf -
  cd <module-name>
  perl Makefile.pl
  make install

You don't need to touch the configuration file of Date::Manip although its
INSTALL suggests you do that.

1. If you're not installing Wcal as root but as a nonpriviledged user, you
must change the location of the configuration file. Do this by editing the
variable CONF_FILE at the top of both wcald and cgi-proxy.c.

2. You can also run wcald in a different computer than the web server by
changing configuration parameters 'address' and possibly 'port'. If you want
to do this, create identical configuration file at both hosts. The web
server host only needs index.cgi and wcal.conf. The host where wcald runs
needs all files.

3. Create index.cgi by compiling cgi-proxy.c

  make

4. Create the directory in your web server html tree where Wcal will
reside. I'd type

  mkdir /home/httpd/html/wcal

5. Copy programs wcald and index.cgi and images left-arrow.gif and
right-arrow.gif there

  cp wcald index.cgi left-arrow.gif right-arrow.gif \
    /home/httpd/html/wcal/

6. Copy sample wcal.conf into /etc (or where ever you made CONF_FILE point
into)

  cp wcal.conf /etc/

7. Now give files the right permissions. This is crucial. Only the user the
web server runs CGI scripts as and the user wcald runs as should have
access to wcal.conf, because it contains a password wcald uses for
making sure it's accessed by cgi-proxy. My apache runs CGI scripts as user
and group httpd and I run wcald as root, so I'd write

  chgrp httpd /etc/wcal.conf
  chmod 0640 /etc/wcal.conf

8. wcald will create one directory per user below the directory where it
resides (/home/httpd/html/wcal in this example). Therefore, the user that
CGI scripts are run as needs write permission to that directory. I'd write

  chgrp httpd /home/httpd/html/wcal
  chmod 0770 /home/httpd/html/wcal

9. You can run wcald either as root or any other user. It needs write
permission to the database directory /var/wcal (or whatever you set the
configuration parameter "database directory" as) which it creates
automatically if it doesn't already exist, and read permission for the
configuration file /etc/wcal.conf. If you run wcald as root, you don't
need to worry about permissions of the database directory. Otherwise, make
sure the user that wcald runs as can write to the database directory.

10. Now edit /etc/wcal.conf to suit yourself. It's documented in
wcal.conf.5. If you want any security, at least change the password (which
you don't need to even know, but it just must be there). All available
configuration parameters are shown in the sample configuration file,
together with default values if there is one.

11. Once Wcal is installed correctly, you must start wcald to the
background. Web server will run binary program index.cgi which reads the CGI
request, connects to wcald, relays the request to it and gives the output
back to the web server. Start wcald

  /home/httpd/html/wcald &

12. Now you should be able to access wcal by refering to index.cgi, by
default in URL /wcal/.

Common problems
---------------

1) When you access URL /wcal, you get just a directory listing

Your web server isn't configured to execute file 'index.cgi' as a CGI
program that generates the directory index. In Apache, add "index.cgi" to
the "DirectoryIndex" line in srm.conf. In Netscape Enterprise Server, set
"Activate CGI as a file type to "Yes" under "Programs" / "CGI File Type".

2) When you access URL /wcal, you get a "403 Forbidden" error or similar

Your web server doesn't allow executing CGI scripts in the directory where
you installed Wcal. In Apache, add for example the following into srm.conf

  <Directory /home/httpd/html/wcal>
    Options +ExecCGI
  </Directory>


If you have problems, suggestions, fixes or anything, don't hesitate to
contact me.


			Samuli Krkkinen <skarkkai@woods.iki.fi>
