- Install Apache
- Permissions
- Apache Config
- Static files
Install Apache
# apt-get install apache2 libapache2-mod-fastcgi
Permissions
wwsympa cgi needs to run with the same permissions as the other sympa processes. There are many ways to do this (e.g. setuid bit, suexec, c wrapper) but the easiest is to just have apache run as user and group sympa.sympa. Since we are setting up a dedicated list machine, this is fine for our needs.
In /etc/apache2/apache2.conf, change:
User www-data
Group www-data
to
User sympa
Group sympa
Apache Config
First of all we disable the default configuration:
# a2dissite default
# a2dissite ssl
And make sure ssl is loaded:
# a2enmod ssl
Now we create a a new config file in /etc/apache2/sites-available:
/etc/apache2/sites-available/sympa:
User sympa
Group sympa
DocumentRoot /home/sympa/static_content
FastCgiServer /home/sympa/bin/wwsympa.fcgi -processes 4
<Location /www>
SetHandler fastcgi-script
</Location>
ScriptAlias /www /home/sympa/bin/wwsympa.fcgi
Alias /static-sympa /home/sympa/static_content
<VirtualHost $MYDOMAIN:443>
SSLEngine on
SSLCertificateKeyFile /etc/certs/$MYDOMAIN/key.pem
SSLCertificateFile /etc/certs/$MYDOMAIN/cert.pem
ServerName $MYDOMAIN
DocumentRoot /home/sympa/static_content
RedirectMatch ^/$ https://$MYDOMAIN/www/
</VirtualHost>
<VirtualHost $MYDOMAIN:80>
ServerName $MYDOMAIN
DocumentRoot /home/sympa/static_content
RedirectMatch (.*)$ https://$MYDOMAIN$1
</VirtualHost>
And enable it:
# a2ensite sympa
By the way, we redirect all requests to https.
Static files
Create the static_content directory and at least a css subdir to place static files:
# mkdir -p /home/sympa/static_content/css
# chown -R sympa.sympa /home/sympa/static_content
|