aboutsummaryrefslogtreecommitdiff
path: root/docs/installation.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/installation.rst')
-rw-r--r--docs/installation.rst49
1 files changed, 37 insertions, 12 deletions
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
-----------