diff --git a/docs/setup.rst b/docs/setup.rst --- a/docs/setup.rst +++ b/docs/setup.rst @@ -137,6 +137,7 @@ from index. If you want to rebuild the index from scratch, you can use the ``-f`` flag as above, or in the admin panel you can check the "build from scratch" checkbox. +.. _ldap-setup: Setting up LDAP support ----------------------- @@ -767,6 +768,12 @@ that, you'll need to: a2enmod wsgi +- Add global Apache configuration to tell mod_wsgi that Python only will be + used in the WSGI processes and shouldn't be initialized in the Apache + processes:: + + WSGIRestrictEmbedded On + - Create a wsgi dispatch script, like the one below. Make sure you check that the paths correctly point to where you installed Kallithea and its Python Virtual Environment. @@ -779,8 +786,9 @@ Here is a sample excerpt from an Apache .. code-block:: apache WSGIDaemonProcess kallithea \ - processes=1 threads=4 \ - python-path=/srv/kallithea/venv/lib/python2.7/site-packages + threads=4 \ + python-home=/srv/kallithea/venv + WSGIProcessGroup kallithea WSGIScriptAlias / /srv/kallithea/dispatch.wsgi WSGIPassAuthorization On @@ -788,13 +796,15 @@ Or if using a dispatcher WSGI script wit .. code-block:: apache - WSGIDaemonProcess kallithea processes=1 threads=4 + WSGIDaemonProcess kallithea threads=4 + WSGIProcessGroup kallithea WSGIScriptAlias / /srv/kallithea/dispatch.wsgi WSGIPassAuthorization On -.. note:: - When running apache as root, please make sure it doesn't run Kallithea as - root, for examply by adding: ``user=www-data group=www-data`` to the configuration. +Apache will by default run as a special Apache user, on Linux systems +usually ``www-data`` or ``apache``. If you need to have the repositories +directory owned by a different user, use the user and group options to +WSGIDaemonProcess to set the name of the user and group. Example WSGI dispatch script: @@ -810,11 +820,11 @@ Example WSGI dispatch script: import site site.addsitedir("/srv/kallithea/venv/lib/python2.7/site-packages") - from paste.deploy import loadapp + ini = '/srv/kallithea/my.ini' from paste.script.util.logging_config import fileConfig - - fileConfig('/srv/kallithea/my.ini') - application = loadapp('config:/srv/kallithea/my.ini') + fileConfig(ini) + from paste.deploy import loadapp + application = loadapp('config:' + ini) Or using proper virtualenv activation: