sympa-community.github.io

Incubating the new Sympa documentation site

Configure HTTP server: Running separate FastCGI service

Requirements

General instruction

First, install WWSympa FCGI service. And then configure HTTP server if necessary.

Install WWSympa FCGI service

Systemd


Note:


  1. Register WWSympa FastCGI service.

    Put wwsympa.service file into Systemd system directory (such as /usr/lib/systemd/system).

    • With binary distributions, wwsympa.service file may have already been installed, if that package supports Systemd.


      Note:

      • With RPM (RHEL/CentOS 7 or Fedora), this file is prepared by sympa-httpd package.

    • If you have installed Sympa from source, and you have given --with-unitsdir=DIR option to configure script, you may find a file wwsympa.service in src/etc/script subdirectory of source tree.


      Note:

      • On Sympa prior to 6.2.36, you may find a file nginx-wwsympa.service. Use it as wwsympa.service.

    Whichever web server you use, the distributed service file will work. The only thing to take care of is the user defined by the -U option in FCGI_OPTS:

    FCGI_OPTS="-M 0600 -U apache"
    

    The value of this parameter (‘apache’ in the example) must be set to the username used by your web server (www-data for Apache HTTP Server in Debian, nginx for nginx on most of distributions, etc.)

    You can keep this parameter by adding the line above to a file /etc/sysconfig/sympa.


    Note:

    • You can also serve Sympa SOAP interface with this method. Follow the same instructions but with sympasoap.service (or nginx-sympasoap.service) file.

  2. Start WWSympa FastCGI service.
    # systemctl start wwsympa.service
    # systemctl status wwsympa.service
    
  3. Activate WWSympa FastCGI service.
    # systemctl enable wwsympa.service
    

FreeBSD ports/package

  1. Configure and activate the spawn-fcgi service (Note: Replace $EXECCGIDIR and $PIDDIR below):
    # sysrc spawn_fcgi_enable="YES"
    # sysrc spawn_fcgi_app="/usr/local/bin/perl"
    # sysrc spawn_fcgi_app_args="$EXECCGIDIR/wwsympa.fcgi"
    # sysrc spawn_fcgi_bindsocket="$PIDDIR/wwsympa.socket"
    # sysrc spawn_fcgi_bindsocket_mode="0600 -U www"
    # sysrc spawn_fcgi_username="sympa"
    # sysrc spawn_fcgi_groupname"sympa"
    

    Note:

    • If you also want to serve Sympa SOAP interface with this method, you may have to write an rc script to start another spawn-fcgi service. Contribution by readers will be appreciated.

  2. Start WWSympa FastCGI service.
    # /usr/local/etc/rc.d/spawn-fcgi start
    

System V init script

  1. If your system supports system V init script, edit example init script as you prefer, and copy it to system V init directory (such as /etc/rc.d/init.d) as the wwsympa file.


    Note:

    • You can also serve Sympa SOAP interface with this method. Follow the same instructions but with this example init script. Copy it as the sympasoap file.

  2. Start WWSympa FastCGI service.
    # service wwsympa start
    # service wwsympa status
    
  3. Activate WWSympa FastCGI service.
    # chkconfig wwsympa on
    

Setup HTTP server

If you have not added configuration for Sympa to HTTP server, follow instruction below.

nginx

  1. Add following excerpt to nginx configuration (Note: replace $PIDDIR and $STATICDIR below):
    server {
        listen      80;
        server_name localhost.localdomain;  # Change it!
    
        location /sympa {
            include       /etc/nginx/fastcgi_params;
            fastcgi_pass  unix:$PIDDIR/wwsympa.socket;
        }
    
        location /static-sympa {
            alias $STATICDIR;
        }
    }
    

    For the SOAP interface, add this in your server configuration (Note: replace $PIDDIR):

        location /sympasoap {
            include       /etc/nginx/fastcgi_params;
            fastcgi_pass  unix:$PIDDIR/sympasoap.socket;
        }
    

    See also a note below.


    Notes:

    • Some binary distributions ship configuration ready to edit:

      • On RPM, /etc/nginx/conf.d/sympa.conf file is prepared by sympa-nginx package.
    • With earlier version of Sympa, you may have to add following things:

      • With Sympa 6.2.54 or earlier, insert these into the section of “location /sympa”:
        fastcgi_split_path_info ^(/sympa)(.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        

        and these into the section of “location /sympasoap”, if any:

        fastcgi_split_path_info ^(/sympasoap)(.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        
      • Additionally, with Sympa 6.2.19b.2 or earlier, insert this into the section of “location /sympa” (Note: replace $EXECCGIDIR).
        fastcgi_param SCRIPT_FILENAME $EXECCGIDIR/wwsympa.fcgi;
        

  2. Edit it as you prefer.

    Note that server_name directive above should contain host part of wwsympa_url parameter. Because Sympa refers to SERVER_NAME CGI environment variable to determine web host name of the service.

  3. Restart nginx. Then test configuration according to instruction.

Apache HTTP Server

  1. Add following excerpt to httpd configuration (Note: replace $PIDDIR and $STATICDIR below):
    LoadModule alias_module modules/mod_alias.so
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
    
    ...
    
    <Location /sympa>
        SetHandler "proxy:unix:$PIDDIR/wwsympa.socket|fcgi://"
          # Don't forget to edit lines below!
        Require local
        #Require all granted
    </Location>
    
    <Location /static-sympa>
          # Don't forget to edit lines below!
        Require local
        #Require all granted
    </Location>
    Alias /static-sympa $STATICDIR
    

    For SOAP interface, add:

    <Location /sympasoap>
        SetHandler "proxy:unix:$PIDDIR/sympasoap.socket|fcgi://"
          # Don't forget to edit lines below!
        Require local
        #Require all granted
    </Location>
    

    Note:

    • Some binary distributions ship configuration ready to edit:

      • On RPM (RHEL/CentOS 7 or Fedora), /etc/httpd/conf.d/sympa.conf file is prepared by sympa-httpd package.

  2. Edit it as you prefer.

    Note that ServerName directive above should contain host part of wwsympa_url parameter. Because Sympa refers to SERVER_NAME CGI environment variable to determine web host name of the service.

  3. Restart httpd. Then test configuration according to instruction.

lighttpd

  1. Add following excerpt to lighttpd configuration (Note: replace $PIDDIR and $STATICDIR):
    server.modules += ("mod_fastcgi")
    server.modules += ("mod_alias")
    
    alias.url += ( "/static-sympa/" => "$STATICDIR/" )
    
    $HTTP["url"] =~ "^/sympa" {
    fastcgi.server = ( "/sympa" =>
        ((  "check-local" => "disable",
            "socket"      => "$PIDDIR/wwsympa.socket",
        ))
    )
    }
    
  2. Edit it as you prefer.

  3. Restart lighttpd. Then test configuration according to instruction.

CC BY-SA 4.0 Unless otherwise specified, the contents of this document are licensed under the Creative Commons - Attribution - ShareAlike license. For more details see LICENSE and AUTHORS.

Theme originally designed by orderedlist