Setting up Indico: Difference between revisions

From ULYSSIS documentation
 
(4 intermediate revisions by the same user not shown)
Line 14: Line 14:


= Configure the Apache webserver using .htaccess =
= 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``
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'
cat > ~/indico/.htaccess <<'EOF'
RewriteEngine On
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^YOURHOSTNAME$ [NC]
RewriteCond %{HTTP_HOST} !^YOURHOSTNAME$ [NC]
RewriteRule ^ https://YOURHOSTNAME%{REQUEST_URI} [R=301,L]
RewriteRule ^ https://YOURHOSTNAME%{REQUEST_URI} [R=301,L]
EOF
EOF


= Create a TLS Certificate =
= Create a TLS Certificate =
Line 32: Line 35:


Celery runs as a background daemon. Add a systemd unit file for it:
Celery runs as a background daemon. Add a systemd unit file for it:
.. code-block:: shell
    cat > /etc/systemd/system/indico-celery.service <<'EOF'
    [Unit]
    Description=Indico Celery
    After=network.target
    [Service]
    ExecStart=/opt/indico/.venv/bin/indico celery worker -B
    Restart=always
    SyslogIdentifier=indico-celery
    User=indico
    Group=www-data
    UMask=0027
    Type=simple
    KillMode=mixed
    TimeoutStopSec=300
    [Install]
    WantedBy=multi-user.target
    EOF
    systemctl daemon-reload




Line 73: Line 52:
     curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
     curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash


    cat >> ~/.bashrc <<'EOF'
cat >> ~/.bashrc <<'EOF'
    export PATH="/opt/indico/.pyenv/bin:$PATH"
export PYENV_ROOT="$HOME/.pyenv"
    eval "$(pyenv init --path)"
export PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"
eval "$(pyenv init - bash)"
    EOF
EOF


    source ~/.bashrc
source ~/.bashrc


You are now ready to install Indico:
You are now ready to install Indico:
Line 85: Line 64:
.. code-block:: shell
.. code-block:: shell


     python -m venv --upgrade-deps --prompt indico ~/.venv
     python -m venv --upgrade-deps --prompt indico ~/indico/.venv
     source ~/.venv/bin/activate
     source ~/indico/.venv/bin/activate
    echo 'source ~/.venv/bin/activate' >> ~/.bashrc
     pip install setuptools wheel
     pip install setuptools wheel
    pip install uwsgi
     pip install indico
     pip install indico


6. Configure Indico
6. Configure Indico
Line 106: Line 82:
     indico setup wizard
     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:
Now finish setting up the directory structure and permissions:

Latest revision as of 17:10, 28 October 2025

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/