Skip to Content.
Sympa Menu

Configure HTTP server: Using Systemd socket

Requirements

General instruction


Note:


First, install Systemd socket and WWSympa FastCGI service. And then configure HTTP server if necessary.

Install Systemd socket

Prepare socket unit file (Note: Replace $PIDDIR below).

/lib/systemd/system/wwsympa.socket:

[Unit]
Description=Sympa web interface socket

[Socket]
SocketUser=nobody
SocketMode=0600
ListenStream=$PIDDIR/wwsympa.socket

[Install]
WantedBy=sockets.target

If the socket should be read by the other user than nobody, you may create a drop-in snippet file such as:

/etc/systemd/system/wwsympa.socket.d/override.conf:

[Socket]
SocketUser=apache

And run:

# systemctl daemon-reload

Note that you may also run systemctl edit wwsympa.socket to create snippet and reload daemon at once.

Install WWSympa FastCGI service

Prepare service unit file (Note: Replace $EXECCGIDIR below).

/lib/systemd/system/wwsympa.service:

[Unit]
Description = WWSympa - Web interface for Sympa mailing list manager (service)
After = syslog.target sympa.service

[Service]
User = sympa
Group = sympa
ExecStart = $EXECCGIDIR/wwsympa.fcgi
StandardOutput = null
StandardInput = socket
StandardError = null
Restart=on-failure

[Install]
WantedBy = multi-user.target

Or, you might want to use multiwatch to run multiple workers (Note: Replace $EXECCGIDIR below, but do not replace $FCGI_CHILDREN).

wwsympa.service:

[Unit]
Description=Sympa web interface FastCGI backend
After=sympa.service
Requires=wwsympa.socket

[Service]
User=sympa
Group=sympa
ExecStart=/usr/bin/multiwatch \
          -f $FCGI_CHILDREN -- \
          $EXECCGIDIR/wwsympa.fcgi
StandardOutput=null
StandardInput=socket
StandardError=journal
Environment="FCGI_CHILDREN=5"
Restart=always
RestartSec=5

[Install]
Also=wwsympa.socket
WantedBy=multi-user.target

By default, five processes will run. To change number of processes, you may create a drop-in snippet file such as:

/etc/systemd/system/wwsympa.service.d/override.conf:

[Service]
Environment="FCGI_CHILDREN=2"

And run:

# systemctl daemon-reload

Note that you may also run systemctl edit wwsympa.service to create snippet and reload daemon at once.


Note:



Note:


Setup HTTP server

Proceed to Setup HTTP server as FastCGI proxy.

Stopping and starting service

Stopping service

To stop WWSympa service, stop Systemd socket also:

 ``` bash
 # systemctl stop wwsympa.socket
 # systemctl stop wwsympa.service
 ```

Starting service

To start WWSympa service, start Systemd socket:

 ``` bash
 # systemctl start wwsympa.socket
 ```

wwsympa.service will be invoked automatically when the socket will be accessed.

Top of Page