Migrating indico 1.2 to 2.0, non root URL upgrade


#1

Our original installation was made with indico 1.2.1, and has been working quite well for a bit less than two years. That installation was configured to work on its own folder instead of on the html document root of the server. I’m aware that indico documentation strongly recommends against that, but it was necessary because of the way our system works: we have Indico installed in its own virtual server, and the main institution server allows access to the Indico pages through a ProxyPass, ProxyPassReverse set of instructions:

ProxyPass /indico https://indico.virtual.server/indico
ProxyPassReverse /indico https://indico.virtual.server/indico

Both our experience and some question threads, like this one:

(1) https://serverfault.com/questions/561892/how-to-handle-relative-urls-correctly-with-a-reverse-proxy

tells us that this kind of proxy configuration cannot be used on the root html document directory when the internal links are absolute, as seems to be the case with indico, so trying to install indico on the root html directory of the indico virtual server and using this proxy configuration:

ProxyPass /indico https://indico.virtual.server
ProxyPassReverse /indico https://indico.virtual.server

didn’t work at all (the local installation of indico did work, but the proxy didn’t), so we had to install indico in its individual folder and use the former proxy configuration. As I’ve already mentioned, this has been working for a bit less than two years.

I’d like to mention that the link (1) suggests some additional alternatives, but none of them seems to be feasible: we cannot change the internal indico links to relative links (“One”), some of the internal first level folder links interfere with other links on the main server, so they can not be redirected individually (“Three”), and we cannot change the name of the virtual host (“Four”). As far as I know, “Five” doesn’t apply.

Now I’m trying to migrate indico 1.2.1 to indico 2.0 and, when installing indico, again in its own folder, following these instructions:

https://docs.getindico.io/en/latest/installation/production/debian/apache/#deb-apache-pkg

but making some changes to the configuration files:

  1. /etc/uwsgi/apps-available/indico.ini

is changed to:

[uwsgi]
uid = indico
gid = www-data
umask = 027

processes = 4
enable-threads = true
socket = 127.0.0.1:8008
stats = /opt/indico/indico/web/uwsgi-stats.sock 
protocol = uwsgi

master = true
auto-procname = true
procname-prefix-spaced = indico
disable-logging = true

plugin = python
single-interpreter = true

touch-reload = /opt/indico/indico/web/indico.wsgi  
wsgi-file = /opt/indico/indico/web/indico.wsgi  
virtualenv = /opt/indico/indico/.venv 

vacuum = true
buffer-size = 20480
memory-report = true
max-requests = 2500
harakiri = 900
harakiri-verbose = true
reload-on-rss = 2048
evil-reload-on-rss = 8192
  1. /etc/apache2/sites-available/indico.conf

    <VirtualHost *:443>
    ServerName indico.virtual.server
    DocumentRoot “/var/empty/apache”

     SSLEngine             on
     SSLCertificateFile    /etc/apache2/ssl/indico.crt
     SSLCertificateKeyFile /etc/apache2/ssl/indico.key
     SSLProtocol           all -SSLv2 -SSLv3
     SSLCipherSuite        ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
     SSLHonorCipherOrder   on
    
     XSendFile on
     XSendFilePath /opt/indico/indico 
     CustomLog /opt/indico/indico/log/apache/access.log combined
     ErrorLog /opt/indico/indico/log/apache/error.log
     LogLevel error
     ServerSignature Off
    
     AliasMatch "^/indico/static/assets/(core|(?:plugin|theme)-[^/]+)/(.*)$" "/opt/indico/indico/assets/$1/$2" 
     AliasMatch "^/indico/(images|fonts)(.*)/(.+?)(__v[0-9a-f]+)?\.([^.]+)$" "/opt/indico/indico/web/static/$1$2/$3.$5"
     AliasMatch "^/indico/(css|dist|images|fonts)/(.*)$" "/opt/indico/indico/web/static/$1/$2" 
     Alias /robots.txt /opt/indico/indico/web/htdocs/robots.txt <<<<
    
     SetEnv UWSGI_SCHEME https
     ProxyPass / uwsgi://127.0.0.1:8008/
    
     <Directory /opt/indico>
         AllowOverride None
         Require all granted
     </Directory>
    
  2. /etc/systemd/system/indico-celery.service

     [Unit]
     Description=Indico Celery
     After=network.target
    
     [Service]
     ExecStart=/opt/indico/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
    

and creating the user “indico” like this:

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

Moreover, the older indico installation has been copied to “/opt/indico-legacy” and when the wizard asks about that, that directory has been selected. The base url is given as “https://indico.virtual.server/indico” (that was the same in the older installation), so the final “indico.conf” file is:

# General settings
SQLALCHEMY_DATABASE_URI = 'postgresql:///indico'
SECRET_KEY = ''
BASE_URL = 'https://indico.virtual.server/indico'
CELERY_BROKER = 'redis://127.0.0.1:6379/0'
REDIS_CACHE_URL = 'redis://127.0.0.1:6379/1'
CACHE_BACKEND = 'redis'
DEFAULT_TIMEZONE = 'UTC'
DEFAULT_LOCALE = 'en_GB'
ENABLE_ROOMBOOKING = False
CACHE_DIR = '/opt/indico/indico/cache'
TEMP_DIR = '/opt/indico/indico/tmp'
LOG_DIR = '/opt/indico/indico/log'
ASSETS_DIR = '/opt/indico/indico/assets'
STORAGE_BACKENDS = {'default': 'fs:/opt/indico/indico/archive', 'legacy': 'fs-readonly:/opt/indico-legacy'}
ATTACHMENT_STORAGE = 'default'
ROUTE_OLD_URLS = True

# Email settings
SMTP_SERVER = ('127.0.0.1', 25)
SMTP_USE_TLS = False
SMTP_LOGIN = ''
SMTP_PASSWORD = ''
SUPPORT_EMAIL = 'indico@ice.csic.es'
PUBLIC_SUPPORT_EMAIL = 'indico@ice.csic.es'
NO_REPLY_EMAIL = 'noreply@ice.csic.es'

STATIC_FILE_METHOD = 'xsendfile'

I’m finding the following problems:

  1. Accessing (from the virtual server, using lynx, so no proxy involved yet) https://indico.virtual.server/indico I get a 404 error, an error about “Bad HTML”, and then this page:
    [logo_indico_bw.png]
    Choose Timezone
    (*) Use the event/category timezone
    ( ) Specify a timezone
    [UTC___________________________]
    (BUTTON) Save
    UTC English
    * English
    * Español
    * Français

    Login
    Home Create event
      * Create lecture
      * Create meeting
      * Create conference
    

    Not Found

    The page you are looking for doesn't exist.
    Go to the main page
    
    Indico
    Powered by Indico
      * Help
      * Contact
    

    Your browser is out of date!

    Update your browser to view this website correctly. Update my browser now
    
    ×
    

if I follow the link to “Go to the main page”, it points to https://indico.virtual.server (no “/indico”), and I obtain the same “bootstrap” page that I would obtain if installing in “/opt/indico”. So at least, both this “bootstrap” page and its link seem to be ignoring all the changes I’ve made. My guess is that I missed some configuration option at some point, but I cannot find where that may be.

  1. I’m not sure if this is an error, but even if I install in /opt/indico (no subfolders), opening “https://indico.virtual.server” shows the bootstrap page (no errors this time). Yet, since it’s an upgrade, I would expect it to use the users and configuration of the old server instead of asking me to create a new one.

Regards,

Josep Guerrero
ICE