title | prev | up | next | redirect_from | |
---|---|---|---|---|---|
Configure HTTP server: Using separate FastCGI service |
configure-mail-server.md |
configure-http-server.md |
configure-http-server.md#tests |
|
-
HTTP server.
Currently, nginx and Apache HTTP Server (2.4 or later) are reported working.
Note:
-
For Apache HTTP Server:
-
Instruction described in this chapter needs mod_proxy_fcgi module introduced by HTTP Server 2.4. See another instruction to know about configuration with HTTP Server prior to 2.4.
-
Sympa prior to 6.2.25b.1 has a bug and doesn't work properly with the method described in this chapter. Upgrading to recent version is recommended, or see another instruction.
-
-
-
spawn-fcgi, an implementation of FastCGI server.
-
FCGI, FastCGI interface for Perl.
First, install WWSympa FCGI service. And then configure HTTP server if necessary.
Note:
- Systemd support with FastCGI services was introduced on Sympa 6.2.15.
-
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.
- With RPM (RHEL/CentOS 7 or Fedora), this file is prepared by
-
If you have installed Sympa from source, and you have given
--with-unitsdir=DIR
option toconfigure
script, you may find a filewwsympa.service
insrc/etc/script
subdirectory of source tree.
Note:
- On Sympa prior to 6.2.36, you may find a file
nginx-wwsympa.service
. Use it aswwsympa.service
.
- On Sympa prior to 6.2.36, you may find a file
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
(ornginx-sympasoap.service
) file.
-
-
Start WWSympa FastCGI service.
# systemctl start wwsympa.service # systemctl status wwsympa.service
-
Activate WWSympa FastCGI service.
# systemctl enable wwsympa.service
-
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.
-
Start WWSympa FastCGI service.
# /usr/local/etc/rc.d/spawn-fcgi start
-
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 thewwsympa
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.
- You can also serve Sympa SOAP interface with this method. Follow the
same instructions but with this
example init script. Copy it as
the
-
Start WWSympa FastCGI service.
# service wwsympa start # service wwsympa status
-
Activate WWSympa FastCGI service.
# chkconfig wwsympa on
If you have not added configuration for Sympa to HTTP server, follow instruction below.
-
Add following excerpt to nginx configuration (Note: replace
$PIDDIR
,$EXECCGIDIR
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; # If you changed wwsympa_url in sympa.conf, change this regex too! fastcgi_split_path_info ^(/sympa)(.*)$; fastcgi_param SCRIPT_FILENAME $EXECCGIDIR/wwsympa.fcgi; fastcgi_param PATH_INFO $fastcgi_path_info; } location /static-sympa { alias $STATICDIR; } }
For the SOAP interface, add this in your
server
configuration:location /sympasoap { include /etc/nginx/fastcgi_params; fastcgi_pass unix:$PIDDIR/sympasoap.socket; fastcgi_param SCRIPT_FILENAME $EXECCGIDIR/sympa_soap_server.fcgi; fastcgi_param PATH_INFO $fastcgi_path_info; }
Note:
-
Some binary distributions ship configuration ready to edit:
- On RPM,
/etc/nginx/conf.d/sympa.conf
file is prepared bysympa-nginx
package.
- On RPM,
-
-
Edit it as you prefer.
Note that
server_name
directive above should contain host part ofwwsympa_url
parameter. Because Sympa refers toSERVER_NAME
CGI environment variable to determine web host name of the service. -
Restart nginx. Then test configuration according to instruction.
-
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://" Require all granted </Location> <Location /static-sympa> Require all granted </Location> Alias /static-sympa $STATICDIR
For SOAP interface, add:
<Location /sympasoap> SetHandler "proxy:unix:$PIDDIR/sympasoap.socket|fcgi://" 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 bysympa-httpd
package.
- On RPM (RHEL/CentOS 7 or Fedora),
-
-
Edit it as you prefer.
Note that
ServerName
directive above should contain host part ofwwsympa_url
parameter. Because Sympa refers toSERVER_NAME
CGI environment variable to determine web host name of the service. -
Restart httpd. Then test configuration according to instruction.