From 43be944fd9dab169e2258d1df4d63f72a9e347ae Mon Sep 17 00:00:00 2001 From: "tim@bastelfreak.de" Date: Sat, 6 Dec 2014 20:34:58 +0100 Subject: [PATCH] add docs for systemd+nginx+gunicorn --- README.rst | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 3530782..2f42290 100644 --- a/README.rst +++ b/README.rst @@ -222,7 +222,7 @@ scenarios: * Apache + mod_wsgi * Apache + mod_passenger -* uwsgi + nginx +* nginx + uwsgi * nginx + gunicorn If you deploy Puppetboard through a different setup we'd welcome a pull @@ -512,6 +512,33 @@ As we may want to serve in the background, and we need ``PUPPETBOARD_SETTINGS`` stderr_logfile=/var/log/supervisor/puppetboard/puppetboard.err environment=PUPPETBOARD_SETTINGS="/var/www/puppetboard/settings.py" + +For newer systems with systemd (for example CentOS7), you can use the following service file (``/usr/lib/systemd/system/gunicorn@.service``): + +.. code-block:: ini + + [Unit] + Description=gunicorn daemon for %i + After=network.target + + [Service] + ExecStart=/usr/bin/gunicorn --config /etc/sysconfig/gunicorn/%i.conf %i + ExecReload=/bin/kill -s HUP $MAINPID + PrivateTmp=true + User=gunicorn + Group=gunicorn + +And the corresponding gunicorn config (``/etc/sysconfig/gunicorn/puppetboard.app\:app.conf``): + +.. code-block:: ini + + import multiprocessing + + bind = '127.0.0.1:9090' + workers = multiprocessing.cpu_count() * 2 + 1 + chdir = '/usr/lib/python2.7/site-packages/puppetboard' + raw_env = ['PUPPETBOARD_SETTINGS=/var/www/puppetboard/settings.py', 'http_proxy='] + Security --------