Next: 8. Authentication Up: Sympa Mailing Lists Management Software version Previous: 6. Sympa and its database Contents Index
Subsections

- 7.1 Organization
- 7.2 HTTPD setup
  - 7.2.1 wwsympa.fcgi access permissions
  - 7.2.2 Installing wwsympa.fcgi in your Apache server
  - 7.2.3 Using FastCGI
- 7.3 wwsympa.conf parameters
  - 7.3.1 arc_path
  - 7.3.2 archive_default_index thrd | mail
  - 7.3.3 archived_pidfile
  - 7.3.4 bounce_path
  - 7.3.5 bounced_pidfile
  - 7.3.6 cookie_expire
  - 7.3.7 cookie_domain
  - 7.3.8 default_home
  - 7.3.9 icons_url
  - 7.3.10 log_facility
  - 7.3.11 mhonarc
  - 7.3.12 password_case sensitive | insensitive
  - 7.3.13 title
  - 7.3.14 use_fast_cgi 0 | 1
- 7.4 MhOnArc
- 7.5 Archiving daemon
- 7.6 Database configuration

# 7. WWSympa, Sympa's web interface

WWSympa is Sympa's web interface.

#
7.1 Organization

WWSympa is fully integrated with Sympa. It uses `sympa.conf` and Sympa's libraries. The default Sympa installation will also install WWSympa.

Every single piece of HTML in WWSympa is generated by the CGI code using template files (See 11.1, page ). This facilitates internationalization of pages, as well as per-site customization.

The code consists of one single PERL CGI script, `WWSympa.fcgi`. To enhance performance you can configure WWSympa to use FastCGI ; the CGI will be persistent in memory.
All data will be accessed through the CGI, including web archives. This is required to allow the authentication scheme to be applied systematically.

Authentication is based on passwords stored in the database table user_table ; if the appropriate `Crypt::CipherSaber` is installed, password are encrypted in the database using reversible encryption based on RC4. Otherwise they are stored in clear text. In both cases reminding of passwords is possible. To keep track of authentication information WWSympa uses HTTP cookies stored on the client side. The HTTP cookie only indicates that a specified e-mail address has been authenticated ; permissions are evaluated when an action is requested.

The same web interface is used by the listmaster, list owners, subscribers and others. Depending on permissions, the same URL may generate a different view.

WWSympa's main loop algorithm is roughly the following :

1. Check authentication information returned by the HTTP cookie

2. Evaluate user's permissions for the requested action

3. Process the requested action

4. Set up variables resulting from the action

5. Parse the HTML template files

# 7.2 HTTPD setup

## 7.2.1 wwsympa.fcgi access permissions

Because Sympa and WWSympa share a lot of files, `wwsympa.fcgi`, must run with the same uid/gid as `archived.pl`, `bounced.pl` and `sympa.pl`. There are different ways to organize this :

- With some operating systems no special setup is required because wwsympa.fcgi is installed with suid and sgid bits, but this will not work if suid scripts are refused by your system.

- Run a dedicated Apache server with sympa.sympa as uid.gid (The Apache default is nobody.nobody)

- Use a Apache virtual host with sympa.sympa as uid.gid ; Apache needs to be compiled with suexec. Be aware that the Apache suexec usually define a lowest UID/GID allowed to be a target user for suEXEC. For most systems including binaries distribution of Apache, the default value 100 is common. So Sympa UID (and Sympa GID) must be higher then 100 or suexec must be tuned in order to allow lower UID/GID. Check http://httpd.apache.org/docs/suexec.html#install for details

  The User and Group directive have to be set before the FastCgiServer directive is encountered.

- Otherwise, you can overcome restrictions on the execution of suid scripts by using a short C program, owned by sympa and with the suid bit set, to start `wwsympa.fcgi`. Here is an example (with no guarantee attached) :

      #include <unistd.h>

      #define WWSYMPA "/home/sympa/bin/wwsympa.fcgi"

      int main(int argn, char **argv, char **envp) {
          argv[0] = WWSYMPA;
          execve(WWSYMPA,argv,envp);
      }

## 7.2.2 Installing wwsympa.fcgi in your Apache server

If you chose to run `wwsympa.fcgi` as a simple CGI, you simply need to script alias it.

         Example :
           	ScriptAlias /wws /home/sympa/bin/wwsympa.fcgi

Running FastCGI will provide much faster responses from your server and reduce load (to understand why, read http://www.fastcgi.com/fcgi-devkit-2.1/doc/fcgi-perf.htm)

         Example :
    	FastCgiServer /home/sympa/bin/wwsympa.fcgi -processes 2
    	<Location /wws>
       	  SetHandler fastcgi-script
    	</Location>

    	ScriptAlias /wws /home/sympa/bin/wwsympa.fcgi

If you run Virtual robots, then the FastCgiServer(s) can serve multiple robots. Therefore you need to define it in the common section of your Apache configuration file.

## 7.2.3 Using FastCGI

FastCGI is an extention to CGI that provides persistency for CGI programs. It is extemely useful with WWSympa since source code interpretation and all initialisation tasks are performed only once, at server startup ; then file wwsympa.fcgi instances are waiting for clients requests.

WWSympa can also work without FastCGI, depending on the use_fast_cgi parameter (see 7.3.14, page ).

To run WWSympa with FastCGI, you need to install :

- : the Apache module that provides features

- `FCGI` : the Perl module used by WWSympa

# 7.3 wwsympa.conf parameters

## 7.3.1 arc_path

(Default value: `/home/httpd/html/arc`)
Where to store html archives. This parameter is used by the `archived.pl` daemon. It is a good idea to install the archive outside the web hierarchy to prevent possible back doors in the access control powered by WWSympa. However, if Apache is configured with a chroot, you may have to install the archive in the Apache directory tree.

## 7.3.2 archive_default_index thrd | mail

(Default value: `thrd`)
The default index organization when entering web archives : either threaded or chronological order.

## 7.3.3 archived_pidfile

(Default value: `archived.pid`)
The file containing the PID of `archived.pl`.

## 7.3.4 bounce_path

(Default value: `/var/bounce`)
Root directory for storing bounces (non-delivery reports). This parameter is used mainly by the `bounced.pl` daemon.

## 7.3.5 bounced_pidfile

(Default value: `bounced.pid`)
The file containing the PID of `bounced.pl`.

## 7.3.6 cookie_expire

(Default value: `0`) Lifetime (in minutes) of HTTP cookies. This is the default value when not set explicitly by users.

## 7.3.7 cookie_domain

(Default value: `localhost`)
Domain for the HTTP cookies. If beginning with a dot ('.'), the cookie is available within the specified internet domain. Otherwise, for the specified host. Example :

    		   cookie_domain cru.fr
    		   cookie is available for host 'cru.fr'

    		   cookie_domain .cru.fr
    		   cookie is available for any host within 'cru.fr' domain

The only reason for replacing the default value would be where WWSympa's authentication process is shared with an application running on another host.

## 7.3.8 default_home

(Default value: `home`)
Organization of the WWSympa home page. If you have only a few lists, the default value `home' (presenting a list of lists organized by topic) should be replaced by `lists' (a simple alphabetical list of lists).

## 7.3.9 icons_url

(Default value: `/icons`)
URL of WWSympa's icons directory.

## 7.3.10 log_facility

WWSympa will log using this facility. Defaults to Sympa's syslog facility. Configure your syslog according to this parameter.

## 7.3.11 mhonarc

(Default value: `/usr/bin/mhonarc`)
Path to the (superb) MhOnArc program. Required for html archives http://www.oac.uci.edu/indiv/ehood/mhonarc.html

## 7.3.12 password_case sensitive | insensitive

(Default value: `insensitive`)
If set to insensitive, WWSympa's password check will be insensitive. This only concerns passwords stored in Sympa database, not the ones in .

Be careful : in previous 3.xx versions of Sympa, passwords were lowercased before database insertion. Therefore changing to case-sensitive password checking could bring you some password checking problems.

## 7.3.13 title

(Default value: `Mailing List Service`)
The name of your mailing list service. It will appear in the Title section of WWSympa.

##
7.3.14 use_fast_cgi 0 | 1

(Default value: `1`)
Choice of whether or not to use FastCGI. On listes.cru.fr, using FastCGI increases WWSympa performance by as much as a factor of 10. Refer to http://www.fastcgi.com/ and the Apache config section of this document for details about FastCGI.

# 7.4 MhOnArc

MhOnArc is a neat little converter from mime messages to html. Refer to http://www.oac.uci.edu/indiv/ehood/mhonarc.html.

The long mhonarc resource file is used by WWSympa in a particular way. MhOnArc is called to produce not a complete html document, but only a part of it to be included in a complete document (starting with `<`HTML`>` and terminating with `<`/HTML`>` ;-) ). The best way is to use the MhOnArc resource file provided in the WWSympa distribution and to modify it for your needs.

The mhonarc resource file is named `mhonarc-ressources`. You may locate this file either in

1. `/home/sympa/expl/mylist/mhonarc-ressources` in order to create a specific archive look for a particular list

2. or `/home/sympa/etc/mhonarc-ressources`

# 7.5 Archiving daemon

`archived.pl` converts messages from Sympa's spools and calls `mhonarc` to create html versions (whose location is defined by the "arc_path" WWSympa parameter). You should probably install these archives outside the Sympa home_dir (Sympa's initial choice for storing mail archives : `/home/sympa/expl/mylist`). Note that the html archive contains a text version of each message and is totally separate from Sympa's main archive.

1. create a directory according to the WWSympa "arc_path" parameter (must be owned by sympa, does not have to be in Apache space unless your server uses chroot)

2. for each list, if you need a web archive, create a new web archive paragraph in the list configuration. Example :

            web_archive
            access public|private|owner|listmaster|closed

   If web_archive is defined for a list, every message distributed by this list is copied to `/home/sympa/spool/outgoing/`. (No need to create nonexistent subscribers to receive copies of messages)

3. start `archived.pl`. Sympa and Apache

4. check WWSympa logs, or alternatively, start `archived.pl` in debug mode (-d).

5. If you change mhonarc resources and wish to rebuild the entire archive using the new look defined for mhonarc, simply create an empty file named ".rebuild.mylist@myhost" in `/home/sympa/spool/outgoing`, and make sure that the owner of this file is Sympa.

            example : su sympa -c "touch /home/sympa/spool/outgoing/.rebuild.sympa-fr@cru.fr"

   You can also rebuild web archives from within the admin page of the list.

   Furthermore, if you want to get list's archives, you can do it via the `List-admin menu-> Archive Management`

# 7.6 Database configuration

WWSympa needs an RDBMS (Relational Database Management System) in order to run. All database access is performed via the Sympa API. Sympa currently interfaces with MySQL, PostgreSQL, Oracle and Sybase.

A database is needed to store user passwords and preferences. The database structure is documented in the Sympa documentation ; scripts for creating it are also provided with the Sympa distribution (in `script`).

User information (password and preferences) are stored in the «User» table. User passwords stored in the database are encrypted using reversible RC4 encryption controlled with the `cookie` parameter, since WWSympa might need to remind users of their passwords. The security of WWSympa rests on the security of your database.

Next: 8. Authentication Up: Sympa Mailing Lists Management Software version Previous: 6. Sympa and its database Contents Index