Setting up Indico

From ULYSSIS documentation

apt install -y libpq-dev apache2 libapache2-mod-proxy-uwsgi libapache2-mod-xsendfile libxslt1-dev libxml2-dev libffi-dev libpcre3-dev libyaml-dev libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev xz-utils liblzma-dev uuid-dev build-essential redis-server git libpango1.0-dev

apt install -y libjpeg-turbo8-dev


Create the indico database

To use PostgreSQL on you ULYSSIS account, you first need to create a PostgreSQL user on UCC. If you already have a PostgreSQL user, you can skip this step. More info on:Using_PostgreSQL#Creating_a_PostgreSQL_user.

Now you can create the username_indico database: Using_PostgreSQL#Creating_a_PostgreSQL_database.

Contact us at ulyssis@ulyssis.org and let us know you would like to get the unaccent and pg_trgm extensions enabled for your database.

Configure the Apache webserver using .htaccess

Create a folder for your installation:

mkdir ~/indico

Replace ``YOURHOSTNAME`` in the next files with the hostname on which your Indico instance should be available, e.g. ``indico.yourdomain.com``

cat > ~/indico/.htaccess <<'EOF'
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^YOURHOSTNAME$ [NC]
RewriteRule ^ https://YOURHOSTNAME%{REQUEST_URI} [R=301,L]
EOF

Create a TLS Certificate

Install Indico

Celery runs as a background daemon. Add a systemd unit file for it:


Now create a user that will be used to run Indico and switch to it:

.. code-block:: shell

   useradd -rm -g www-data -d /opt/indico -s /bin/bash indico
   su - indico

The first thing to do is installing pyenv - we use it to install the latest Python version as not all Linux distributions include it and like this Indico can benefit from the latest Python features.

.. code-block:: shell

   curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
cat >> ~/.bashrc <<'EOF'
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - bash)"
EOF
source ~/.bashrc

You are now ready to install Indico:

.. code-block:: shell

   python -m venv --upgrade-deps --prompt indico ~/indico/.venv
   source ~/indico/.venv/bin/activate
   pip install setuptools wheel
   pip install indico

6. Configure Indico


Once Indico is installed, you can run the configuration wizard. You can keep the defaults for most options, but make sure to use ``https://YOURHOSTNAME`` when prompted for the Indico URL. Also specify valid email addresses when asked and enter a valid SMTP server Indico can use to send emails. When asked for the default timezone make sure this is the main time zone used in your Indico instance.

.. code-block:: shell

   indico setup wizard
Indico root path: ~/indico 
Indico URL: https://indico.username.studentenweb.org                                                                                  
PostgreSQL database URI: postgresql://username:password@pgsql.ulyssis.org/username_indico
Redis URI (celery): redis://username:password@redis.ulyssis.org:6379/0                                                                                  

Now finish setting up the directory structure and permissions:

.. code-block:: shell

   mkdir ~/log/apache
   chmod go-rwx ~/* ~/.[^.]*
   chmod 710 ~/ ~/archive ~/cache ~/log ~/tmp
   chmod 750 ~/web ~/.venv
   chmod g+w ~/log/apache
   echo -e "\nSTATIC_FILE_METHOD = 'xsendfile'" >> ~/etc/indico.conf


7. Create database schema


Finally, you can create the database schema and switch back to *root*:

.. code-block:: shell

   indico db prepare
   exit


8. Launch Indico


You can now start Indico and set it up to start automatically when the server is rebooted:

.. code-block:: shell

   systemctl restart apache2.service indico-celery.service indico-uwsgi.service
   systemctl enable apache2.service postgresql.service redis-server.service indico-celery.service indico-uwsgi.service


9. Get a Certificate from Let's Encrypt


Getting_SSL/TLS


10. Create an Indico user


Access ``https://YOURHOSTNAME`` in your browser and follow the steps displayed there to create your initial user.


11. Install TeXLive


Follow the :ref:`PDF generation guide <pdf_generation>` to setup PDF document generation in Indico.


.. _deb-apache-shib:

Optional: Shibboleth


If your organization uses Shibboleth/SAML-based SSO, follow these steps to use it in Indico:

1. Install Shibboleth ^^^^^^^^^^^^^^^^^^^^^

.. code-block:: shell

   apt install -y libapache2-mod-shib
   a2enmod shib

2. Configure Shibboleth ^^^^^^^^^^^^^^^^^^^^^^^

This is outside the scope of this documentation and depends on your environment (Shibboleth, SAML, ADFS, etc). Please contact whoever runs your SSO infrastructure if you need assistance.

3. Enable Shibboleth in Apache ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Add the following code to your ``/etc/apache2/sites-available/indico.conf`` right before the ``AliasMatch`` lines:

.. code-block:: apache

   <LocationMatch "^(/Shibboleth\.sso|/login/shib-sso/shibboleth)">
       AuthType shibboleth
       ShibRequestSetting requireSession 1
       ShibExportAssertion Off
       Require valid-user
   </LocationMatch>


4. Enable Shibboleth in Indico ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. include:: ../_sso_indico.rst


.. _PostgreSQL wiki: https://wiki.postgresql.org/wiki/YUM_Installation#Configure_your_YUM_repository .. _Let's Encrypt: https://letsencrypt.org/