wiki:Admin/Installation0.98

Installing Indico

Only >=0.98

Before starting

From 0.98 on, Indico runs on WSGI. Previous releases were using mod_python. mod_python is no longer supported.

There are WSGI modules for all major web servers. We normally run mod_wsgi, using the Apache httpd server. Here is the recommended setup:

  • Python 2.6+
  • Apache httpd 2.2+
  • mod_wsgi 3.3+ (by installing libapache2-mod-wsgi)

Some older versions will probably work, but we cannot guarantee that everything goes fine.

There are two dependencies that cannot be installed by easy_install:

You can bypass this by installing them using pip:

   $ easy_install pip   # if you don't have it already
   $ pip install reportlab PIL

Otherwise, you can install them manually.

Here is the complete list of dependencies (if for some reason you need to install them manually). The version numbers are indicative - they're versions known to be stable, but more recent versions may work as well.

Installing it

There are two options:

fetching a release (recommended)

You can do it from command line (recommended) executing:

# easy_install indico

Or, you can also do it fetching a tarball or egg file from here.

from our Git repository

You can find our git repository here (development sources);

You should have checked out a cds-indico directory. cd into it and simply do (as root):

# python setup.py install

The setup script will fetch all the dependencies for you and install Indico as a Python EGG in your Python library path.

Post-Install script

The next step is to run indico_initial_setup:

# indico_initial_setup 
No previous installation of Indico was found.
Please specify a directory prefix:
[/opt/indico]: 

and follow the instructions that the script will provide. By default, Indico will be installed under /opt/indico, but the setup script allows you to specify other paths.

By the end of the process, you should have obtained some information on how to start the database:

If you are running ZODB on this host:
 - Review etc/zodb.conf and etc/zdctl.conf to make sure everything is ok.
 - To start the database run: zdaemon -C etc/zdctl.conf start

As well as some information on the paths:

    indico.conf:      /opt/indico/etc/indico.conf

    BinDir:           /opt/indico/bin
    DocumentationDir: /opt/indico/doc
    ConfigurationDir: /opt/indico/etc
    HtdocsDir:        /opt/indico/htdocs

Configuring Apache

If you already have a previous installation of Indico with mod_python, you should first remove it before starting the mod_wsgi installation and configuration.

If this is not your case, you can skip this step.

Removing mod_python

Locate the apache configuration file (httpd.conf or apache2.conf). In Linux, it is located by default in /etc/apache2/.

Edit the apache configuration file and make sure the next lines are commented (add a '#' at the start of each line):

Let's pretend your username is jdoe

#        DocumentRoot /opt/indico/htdocs
#        directoryIndex index.py index.html

#        SetEnv PYTHON_EGG_CACHE /tmp/.python-eggs

#<Directory "/opt/indico/htdocs/services">
#    PythonPath "sys.path+['/opt/indico','/opt/indico/htdocs']"
#    SetHandler python-program
#    PythonHandler MaKaC.services.handler
#    Allow from All
#</Directory>

#<Directory "/opt/indico/htdocs">
#    AddHandler python-program .py
#    PythonHandler mod_python.publisher
#    PythonDebug On
#    PythonPath "sys.path+['/opt/indico']"
#    Allow from All 
#</Directory>

#Alias /indico/images "/opt/indico/htdocs/images"
#Alias /indico/js "/opt/indico/htdocs/js"
#Alias /indico "/opt/indico/htdocs"

Finally, you might want to disable mod_python and the previous Indico installation, for avoiding incompatibilities.

  • In Linux, execute the next lines:
    jdoe@localhost ~$ sudo a2dismod python
    jdoe@localhost ~$ sudo a2dissite [name of the old webpage file]
    

In many cases the name of the old webpage file will be indico. To make sure, you can try writing "sudo a2dissite " and pressing [tab] for autocompletion.


You have two different configurations. You can choose to use only one of them or both.

HTTP Mode

Create a new file in the 'sites-available' folder of apache. It's located by default under '/etc/apache2/sites-available/'.

jdoe@localhost ~$ sudo gedit /etc/apache2/sites-available/indico

Copy the next lines into that file, making sure to replace 'jdoe' with your username:

AddDefaultCharset UTF-8
<VirtualHost *:80>
        # mod_wsgi indico

	ErrorLog /var/log/apache2/error.log
        LogLevel warn
	
	Alias /indico/images "/opt/indico/htdocs/images"
	Alias /indico/css "/opt/indico/htdocs/css"
	Alias /indico/js "/opt/indico/htdocs/js"
	Alias /indico/ihelp "/opt/indico/htdocs/ihelp"

	WSGIDaemonProcess WSGIDAEMON processes=32 threads=1 inactivity-timeout=3600 maximum-requests=10000 \
            python-eggs=/opt/indico/tmp/egg-cache

	WSGIScriptAlias /indico "/opt/indico/htdocs/index.wsgi"
	
	<Directory "/opt/indico">
	    WSGIProcessGroup WSGIDAEMON
	    WSGIApplicationGroup %{GLOBAL}
	    AllowOverride None
	    Options None
	    Order deny,allow
	    Allow from all
	</Directory>
</VirtualHost>

Here's the explanation of the above lines:

  • Alias: Redirects some static locations to the containing folders, reducing load times.
  • WSGIDaemonProcess: Create 32 daemon processes of 1 thread each with name WSGIDAEMON. Set the python-path and python-eggs paths. (The other two parameters are for robustness).
  • WSGIScriptAlias: Redirect all petitions starting with /indico to the specified file.
  • WSGIProcessGroup: Configure the execution with the settings of WSGIDAEMON.
  • WSGIApplicationGroup: Set the execution to run under the same Python interpreter (the first created).

Finally, enable wsgi, the new webpage and restart apache.

jdoe@localhost ~$ sudo a2enmod wsgi
jdoe@localhost ~$ sudo a2ensite indico
jdoe@localhost ~$ sudo apache2ctl restart

Accessing http://localhost/indico/index.py should give you the main Indico page.

HTTPS Mode

Create a new file in the 'sites-available' folder of apache. It's located by default under '/etc/apache2/sites-available/'.

jdoe@localhost ~$ sudo gedit /etc/apache2/sites-available/indico-ssl

Copy the next lines into that file, making sure to replace 'jdoe' with your username:

<IfModule mod_ssl.c>
<VirtualHost *:443>

	ErrorLog /var/log/apache2/error.log
            LogLevel warn
	
	Alias /indico/images "/opt/indico/htdocs/images"
	Alias /indico/css "/opt/indico/htdocs/css"
	Alias /indico/js "/opt/indico/htdocs/js"
	Alias /indico/ihelp "/opt/indico/htdocs/ihelp"

        WSGIScriptAlias /indico "/opt/indico/htdocs/index.wsgi"

        SSLEngine on
        SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
	SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
</VirtualHost>
</IfModule>

Finally, enable ssl and wsgi, the new webpage and restart apache.

jdoe@localhost ~$ sudo a2enmod ssl
jdoe@localhost ~$ sudo a2enmod wsgi
jdoe@localhost ~$ sudo a2ensite indico-ssl
jdoe@localhost ~$ sudo apache2ctl restart

Accessing https://localhost/indico/index.py should give you the main Indico page.

Indico config file

The next step should be inspecting indico.conf and configuring it to fit your server configuration. indico.conf replaces the old config.xml, so you will have to update it with the paramaters that you already have in your config.xml.

Post-install tasks

If you wish to use the scheduler daemon (replaces old taskDaemon), then you should run:

sudo -u apache indico_scheduler start

Do not forget to delete the following file:

/your/tmp/folder/vars.js.tpl.tmp

Migration

If you are using an existing DB, please read this.

Future installations

Once you have succeeded to install Indico for the first time, you can automatize the upgrading process with a single script. This script should basically include the following actions:

$ easy_install -U indico

$ indico_initial_setup --existing-config=/opt/indico/etc/indico.conf #replace with your path to your indico.conf

# restart apache
/path/to/httpd restart

Last modified 3 weeks ago Last modified on 05/27/13 18:57:53