.. _installation: ============ Installation ============ 1. Setup the repository:: $ wget -O - https://deb.entrouvert.org/entrouvert.gpg | apt-key add - $ echo deb http://deb.entrouvert.org/ buster main >> /etc/apt/sources.list $ apt update 2. Create the database:: $ apt install apg $ PASSWORD=$(apg -n 1 -M NCL -m 20) $ apt install postgresql $ su - postgres -c psql < /etc/authentic2/settings.d/database.py <`__. Specifying a different database ------------------------------- This is done by modifying the DATABASES dictionary in `/etc/authentic2/settings.d/database.py`. For example:: DATABASES['default'] = { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'authentic', 'USER': 'admindb', 'PASSWORD': 'foobar', 'HOST': 'db.example.com', 'PORT': '', # empty string means default value } You should refer to the Django documentation on databases settings at http://docs.djangoproject.com/en/dev/ref/settings/#databases for all the details. Running Authentic 2 behind an Apache2 reverse proxy --------------------------------------------------- Authentic 2 runs as an `uWSGI daemon `__ and can be configured as a backend for an Apache2 reverse proxy by adding the following example to `/etc/apache2/sites-available/authentic2.conf`:: ServerName idp.example.com DocumentRoot /var/www/empty RedirectPermanent / https://idp.example.com ErrorLog ${APACHE_LOG_DIR}/idp.example.com-error.log CustomLog ${APACHE_LOG_DIR}/idp.example.com-access.log combined ServerName idp.example.com DocumentRoot /var/www/empty SSLEngine On Alias /static /var/lib/authentic2/collectstatic ProxyPass /static ! Require all granted ProxyRequests Off ProxyPreserveHost on ProxyPass / unix:/var/run/authentic2/authentic2.sock|http://127.0.0.1/ ProxyPassReverse / unix:/var/run/authentic2/authentic2.sock|http://127.0.0.1/ RequestHeader set X-Forwarded-SSL "on" RequestHeader set X-Forwarded-Protocol "ssl" RequestHeader set X-Forwarded-Proto "https" Require all granted ErrorLog ${APACHE_LOG_DIR}/idp.example.com-error.log CustomLog ${APACHE_LOG_DIR}/idp.example.com-access.log combined And the enable it with:: $ a2ensite authentic2 It also requires modules that can be enabled as follows:: $ a2enmod proxy_http headers ssl Quickstarts ----------- .. toctree:: :maxdepth: 1 quick_oauth2_idp quick_saml2_idp quick_saml2_sp quick_cas_idp