diff options
| -rw-r--r-- | CONTRIBUTORS | 2 | ||||
| -rw-r--r-- | conf/ihatemoney.service | 14 | ||||
| -rw-r--r-- | docs/installation.rst | 49 |
3 files changed, 39 insertions, 26 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1fc1463..f5c9fdb 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -16,10 +16,12 @@ donkers <thedonkers@gmail.com> Feth AREZKI <feth@tuttu.info> Frédéric Sureau <fredericsureau@gmail.com> Jocelyn Delalande <jocelyn@crapouillou.net> +Luc Didry <luc@didry.org> Lucas Verney <phyks@phyks.me> Mathieu Leplatre <leplatrem@gmail.com> Marien Fressinaud <dev@marienfressinaud.fr> mduret <mathieu.duret@gmail.com> +nailyk <nailyk_git@nailyk.fr> Tinmn <royque@gmail.com> Toover <toover@toover.me> Xavier Mehrenberger <xavier.mehrenberger@gmail.com> diff --git a/conf/ihatemoney.service b/conf/ihatemoney.service deleted file mode 100644 index c6cbb3f..0000000 --- a/conf/ihatemoney.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=I hate money -Requires=network.target postgresql.service -After=network.target postgresql.service - -[Service] -Type=simple -User=ihatemoney -WorkingDirectory=/var/lib/ihatemoney -ExecStart=/var/lib/ihatemoney/bin/gunicorn -c /etc/ihatemoney/gunicorn.conf.py ihatemoney.wsgi:application -SyslogIdentifier=ihatemoney - -[Install] -WantedBy=multi-user.target diff --git a/docs/installation.rst b/docs/installation.rst index f368aaa..d86dfcd 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -50,10 +50,6 @@ Activate the virtualenv:: Install ======= -Install Gunicorn dependency:: - - pip install gunicorn - Install the latest release with pip:: pip install ihatemoney @@ -135,7 +131,11 @@ With Apache and mod_wsgi 4. Activate the virtual host if needed and restart Apache With Nginx, Gunicorn and Supervisord/systemd ------------------------------------- +-------------------------------------------- + +Install Gunicorn:: + + pip install gunicorn 1. Create a dedicated unix user (here called `ihatemoney`), required dirs, and fix permissions:: @@ -145,23 +145,48 @@ With Nginx, Gunicorn and Supervisord/systemd 2. Create gunicorn config file :: - ihatemoney generate-config gunicorn.conf.py > /etc/ihatemoney/gunicorn.conf.py + ihatemoney generate-config gunicorn.conf.py > /etc/ihatemoney/gunicorn.conf.py + +3. Setup Supervisord or systemd + + - To use Supervisord, create supervisor config file :: + + ihatemoney generate-config supervisord.conf > /etc/supervisor/conf.d/ihatemoney.conf + + - To use systemd services, create ``ihatemoney.service`` in [#systemd-services]_:: + + [Unit] + Description=I hate money + Requires=network.target postgresql.service + After=network.target postgresql.service + + [Service] + Type=simple + User=ihatemoney + ExecStart=/home/john/ihatemoney/bin/gunicorn -c /etc/ihatemoney/gunicorn.conf.py ihatemoney.wsgi:application + SyslogIdentifier=ihatemoney + + [Install] + WantedBy=multi-user.target -3a. Create supervisor config file :: + Obviously, adapt the ``ExecStart`` path for your installation folder. - ihatemoney generate-config supervisord.conf > /etc/supervisor/conf.d/ihatemoney.conf + If you use SQLite as database: remove mentions of ``postgresql.service`` in ``ihatemoney.service``. + If you use MySQL or MariaDB as database: replace mentions of ``postgresql.service`` by ``mysql.service`` or ``mariadb.service`` in ``ihatemoney.service``. -3b. To use systemd services, symlink ``ihatemoney.service`` to [#systemd-services]_:: + Then reload systemd, enable and start ``ihatemoney``:: - ln -s /var/lib/ihatemoney/conf/ihatemoney.service /lib/systemd/system/ihatemoney.service + systemctl daemon-reload + systemctl enable ihatemoney.service + systemctl start ihatemoney.service 4. Copy (and adapt) output of ``ihatemoney generate-config nginx.conf`` with your nginx vhosts [#nginx-vhosts]_ -5. Reload both nginx and supervisord. It should be working ;) +5. Reload nginx (and supervisord if you use it). It should be working ;) .. [#nginx-vhosts] typically, */etc/nginx/conf.d/* or */etc/nginx/sites-available*, depending on your distribution. -.. [#systemd-services] ``/lib/systemd/system/ihatemoney.service`` path may change depending on your distribution. +.. [#systemd-services] ``/etc/systemd/system/ihatemoney.service`` path may change depending on your distribution. With Docker ----------- |
