|
|
Daemon für [Gunicorn - a Python WSGI HTTP Server for UNIX](http://gunicorn.org)
|
|
|
|
|
|
Im virtualenv der Django Admintools applikation gunicorn installieren:
|
|
|
```
|
|
|
pip install gunicorn
|
|
|
```
|
|
|
|
|
|
File: `/etc/systemd/system/admintools.service` mit folgendem Inhalt erstellen:
|
|
|
```
|
|
|
[Unit]
|
|
|
Description=Admintools 2.0
|
|
|
After=network.target multi-user.target
|
|
|
|
|
|
[Service]
|
|
|
User=django
|
|
|
Environment="DJANGO_SETTINGS_MODULE=admintools.settings"
|
|
|
Environment="LANG=en_US.UTF-8"
|
|
|
Environment="PYTHONPATH=/webserver/virtualenvs/production/bin/python"
|
|
|
WorkingDirectory=/webserver/virtualenvs/production/admintools
|
|
|
ExecStart=/webserver/virtualenvs/production/bin/gunicorn -b 127.0.0.1:8000 -w 2 --log-file /webserver/virtualenvs/production/admintools.log admintools.wsgi:application
|
|
|
|
|
|
[Install]
|
|
|
WantedBy=multi-user.target
|
|
|
```
|
|
|
|
|
|
Danach als root:
|
|
|
```
|
|
|
systemctl daemon-reload
|
|
|
systemctl enable admintools
|
|
|
systemctl start admintools
|
|
|
``` |
|
|
\ No newline at end of file |