Next: 15. Interaction between Sympa and other Up: Sympa Mailing Lists Management Software version Previous: 13. Authorization scenarios Contents Index
Subsections

- 14.1 How to create a virtual host
- 14.2 robot.conf
  - 14.2.1 Robot customization
- 14.3 Managing multiple virtual hosts

#
14. virtual host

Sympa is designed to manage multiple distinct mailing list servers on a single host with a single Sympa installation. Sympa virtual hosts are like Apache virtual hosting. Sympa virtual host definition includes a specific email address for the robot itself and its lists and also a virtual http server. Each robot provides access to a set of lists, each list is related to only one robot.

Most configuration parameters can be redefined for each robot except general Sympa installation parameters (binary and spool location, smtp engine, antivirus plugging,...).

The virtual host name as defined in Sympa documentation and configuration file refers to the Internet domaine of the virtual host.

Note that the main limitation of virtual hosts in Sympa is that you cannot create 2 lists with the same name (local part) among your virtual hosts.

# 14.1 How to create a virtual host

You don't need to install several Sympa servers. A single `sympa.pl` daemon and one or more fastcgi servers can serve all virtual host. Just configure the server environment in order to accept the new domain definition.

- The DNS must be configured to define a new mail exchanger record (MX) to route message to your server. A new host (A record) or alias (CNAME) are mandatory to define the new web server.
- Configure your MTA (sendmail, postfix, exim, ...) to accept incoming messages for the new robot domain. Add mail aliases for the robot :

  Examples (with sendmail):

      sympa@your.virtual.domain:      "| /usr/local/sympa-stable/bin/queue sympa@your.virtual.domain"
      listmaster@your.virtual.domain: "| /usr/local/sympa-stable/bin/queue listmaster@your.virtual.domain"
      bounce+*@your.virtual.domain:          "| /usr/local/sympa-stable/bin/bouncequeue sympa@your.virtual.domain"\\

- Define a virtual host in your HTTPD server. The fastcgi servers defined in the common section of you httpd server can be used by each virtual host. You don't need to run dedicated fascgi server for each virtual host.

  Examples:

      FastCgiServer /usr/local/sympa-stable/bin/wwsympa.fcgi -processes 3 -idle-timeout 120
      .....
      <VirtualHost 195.215.92.16>
        ServerAdmin webmaster@your.virtual.domain
        DocumentRoot /var/www/your.virtual.domain
        ServerName your.virtual.domain

        <Location /sympa>
           SetHandler fastcgi-script
        </Location>

        ScriptAlias /sympa /usr/local/sympa-stable/bin/wwsympa.fcgi

      </VirtualHost>

- Create a `/usr/local/sympa-stable/etc/your.virtual.domain/robot.conf` configuration file for the virtual host. Its format is a subset of `sympa.conf` and is described in the next section ; a sample `robot.conf` is provided.

- Create a `/usr/local/sympa-stable/expl/your.virtual.domain/` directory that will contain the virtual host mailing lists directories. This directory should have the sympa user as its owner and must have read and write access for this user.

      # su sympa -c 'mkdir /usr/local/sympa-stable/expl/your.virtual.domain'
      # chmod 750 /usr/local/sympa-stable/expl/your.virtual.domain

# 14.2 robot.conf

A robot is named by its domain, let's say my.domain.organd defined by a directory `/usr/local/sympa-stable/etc/my.domain.org`. This directory must contain at least a `robot.conf` file. This files has the same format as `/usr/local/sympa-stable/etc/sympa.conf` (have a look at robot.conf in the sample dir). Only the following parameters can be redefined for a particular robot :

- `http_host`
  This hostname will be compared with 'SERVER_NAME' environment variable in wwsympa.fcgi to determine the current Virtual Host. You can a path at the end of this parameter if you are running multiple virtual hosts on the same host.

      Examples: \\
      	http_host  myhost.mydom
      	http_host  myhost.mydom/sympa

- `wwsympa_url`
  The base URL of WWSympa

- `soap_url`
  The base URL of Sympa's SOAP server (if it is running ; see 11, page )

- `cookie_domain`

- `email`

- `title`

- `default_home`

- `create_list`

- `lang`

- `supported_lang`

- `log_smtp`

- `listmaster`

- `max_size`

- `css_path`

- `css_url`

- `logo_html_definition`

- `color_0`, color_1 ... color_15

- deprecated color definition `dark_color`, `light_color`, `text_color`, `bg_color`, `error_color`, `selected_color`, `shaded_color`

These settings overwrite the equivalent global parameter defined in `/usr/local/sympa-stable/etc/sympa.conf` for my.domain.orgrobot ; the main `listmaster` still has privileges on Virtual Robots though. The http_host parameter is compared by wwsympa with the SERVER_NAME environment variable to recognize which robot is in used.

## 14.2.1 Robot customization

In order to customize the web look and feel, you may edit the CSS definition. CSS are defined in a template named css.tt2. Any robot can use static css file for making Sympa web interface faster. Then you can edit this static definition and change web style. Please refer to `css_path` `css_url`. You can also quickly introduce a logo in left top corner of all pages configuring `logo_html_definition` parameter in robot.conf file.

In addition, if needed, you can customize each virtual host using its set of templates and authorization scenarios.

`/usr/local/sympa-stable/etc/my.domain.org/web_tt2/`, `/usr/local/sympa-stable/etc/my.domain.org/mail_tt2/`, `/usr/local/sympa-stable/etc/my.domain.org/scenari/` directories are searched when loading templates or scenari before searching into `/usr/local/sympa-stable/etc` and `/usr/local/sympa-stable/bin/etc`. This allows to define different privileges and a different GUI for a Virtual Host.

# 14.3 Managing multiple virtual hosts

If you are managing more than 2 virtual hosts, then you might cinsider moving all the mailing lists in the default robot to a dedicated virtual host located in the `/usr/local/sympa-stable/expl/my.domain.org/` directory. The main benefit of this organisation is the ability to define default configuration elements (templates or authorization scenarios) for this robot without inheriting them within other virtual hosts.

To create such a virtual host, you need to create `/usr/local/sympa-stable/expl/my.domain.org/` and `/usr/local/sympa-stable/etc/my.domain.org/` directories ; customize `host`, `http_host` and `wwsympa_url` parameters in the `/usr/local/sympa-stable/etc/my.domain.org/robot.conf` with the same values as the default robot (as defined in `sympa.conf` and `wwsympa.conf` files).

Next: 15. Interaction between Sympa and other Up: Sympa Mailing Lists Management Software version Previous: 13. Authorization scenarios Contents Index