docker-mailman
docker-mailman copied to clipboard
Include example config for Apache in instructions
The instructions include an example config for nginx, but not one for Apache. Below is the config I ended up with. This was cobbled together from a number of mailman configuration guides and some info about the uwsgi proxy that I learned while working on another piece of software:
<VirtualHost *:81>
ServerName lists.DOMAIN.TLD
ServerAdmin webmaster@localhost
DocumentRoot /opt/mailman/web
ErrorLog ${APACHE_LOG_DIR}/domains/lists.DOMAIN.TLD/error.log
CustomLog ${APACHE_LOG_DIR}/domains/lists.DOMAIN.TLD/access.log combined
Alias /static /opt/mailman/web/static
Alias /favicon.ico /opt/mailman/web/static/hyperkitty/img/favicon.ico
ProxyPassMatch ^/static/ !
ProxyPassMatch ^/favicon.ico !
ProxyPass / uwsgi://localhost:8080/
ProxyPassReverse / uwsgi:/localhost:8080/
WSGITrustedProxyHeaders X-Forwarded-For X-Forwarded-Proto
<Directory /opt/mailman/web/static/hyperkitty/img/>
Allow from all
Require all granted
Options FollowSymLinks
</Directory>
<Directory /opt/mailman/web/static/>
Options FollowSymLinks
Allow from all
Require all granted
</Directory>
</VirtualHost>
It was necessary to install and enable mod-proxy-uwsgi and mod_proxy for this config to work. On my system, SSL is handled by haproxy, and requests are sent cleartext to Apache on localhost port 81. I have haproxy setting the X-Forwarded-Proto header to https and it is also setting X-Forwarded-For as most proxies do. The inclusion of WSGITrustedProxyHeaders X-Forwarded-For X-Forwarded-Proto in the config ensures that uwsgi is informed that https is being used even though Apache is not doing SSL.
I don't know if what I came up with is suitable for inclusion in the README or not.
Thank you, this is the first config that really works! Only two lines are different in my setup:
ProxyPass / unix:/run/mailman3-web/uwsgi.sock|uwsgi://localhost/
ProxyPassReverse / unix:/run/mailman3-web/uwsgi.sock|uwsgi://localhost/
Instead the port 8080 setup in your file.
Idon't understand why there is no common config example like this somewhere in the documentation.
Instead the port 8080 setup in your file.
That's cool. I actually didn't know there was a socket, but I did know that the app was exposed on port 8080. I generally prefer network communication to sockets, though there are certainly uses for sockets.
I am trying to create a push request for the doc.
This issue has not been updated for more than 1year