Table Of Contents

Previous topic

1.1. How to install openPLM server 1.1

Next topic

2. settings — Settings

This Page


1.2. How to install openPLM server (development version)

This document describes how to install an openPLM server.

1.2.1. Requirements

This HowTo is based on:

  • Debian Squeeze
  • Apache Server version: Apache/2.2.16 (from Debian)
  • PostgreSQL 8.4.4
  • Python 2.6.X
  • Django 1.2.X
  • Celery 2.3.X to 2.5.X
  • Haystack 1.2.X
  • Xapian 1.2.X
  • Lepl 5.0
  • South 0.7.3


Django framework can run with SQLite 3 and MySQL databases and with other web servers. We welcome all feedbacks about these combinations. For more information, you can visit : Django website

1.2.2. Install necessary packages

First, you must install some dependencies:

  1. apt-get install swig build-essential pkg-config gettext
  2. apt-get install apache2 libapache2-mod-wsgi
  3. apt-get install python-pip python-dev python-imaging python-kjbuckets python-pypdf ipython
  4. pip install odfpy
  5. apt-get install graphviz graphviz-dev python-pygraphviz
  6. apt-get install python-xapian rabbitmq-server
  7. apt-get install python-django python-django-south
  8. pip install docutils
  9. pip install django-celery
  10. pip install 'django-haystack<2'
  11. apt-get install postgresql python-psycopg2
  12. pip install lepl
  13. apt-get install python-pisa libgsf-bin

To enable plain text search on files, you need to install the following dependencies:

  1. apt-get install poppler-utils html2text odt2txt antiword catdoc
  2. pip install openxmllib

1.2.3. Get code using Subversion

  • apt-get install subversion
  • mkdir /var/django

All files used for a new django site will be stored in this directory.

  • cd /var/django
  • svn co svn://

The directory ./openPLM is created and all codes are downloaded.

  • cd /var/django/openPLM

1.2.4. Configure PostgreSQL

  • mkdir /var/postgres

  • chown postgres:postgres /var/postgres/

  • find / -name initdb

  • locale-gen fr_FR.UTF-8 (replace fr_FR.UTF-8 with your locale)

  • su postgres

  • /usr/lib/postgresql/8.4/bin/initdb --encoding=UTF-8 --locale=fr_FR.UTF-8 --pgdata=/var/postgres/

  • /usr/lib/postgresql/8.4/bin/postgres -D /var/postgres & (it is not a problem if postgres is already running, you do not have to restart it)

  • psql:

    postgres=#create database openplm;
    postgres=#create role django with password 'MyPassword' login;
  • exit

1.2.5. Change the secret key

  • cd /var/django/openPLM/trunk/openPLM/
  • python bin/

1.2.6. Create the database

Edit the file /var/django/openPLM/trunk/openPLM/ and set the database password (‘MyPassword’) It must be the one set with the command create role django with password 'MyPassword' login; Here the DATABASE_USER is django, not the Django admin created by ./ syncdb --all.

For example:

    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # or 'postgresql', 'mysql', 'sqlite3', 'oracle'.
        'NAME': 'openplm',               # Or path to database file if using sqlite3.
        'USER': 'django',                # Not used with sqlite3.
        'PASSWORD': 'MyPassword',        # Not used with sqlite3.
        'HOST': 'localhost',             # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.

Then execute the following commands:

  • cd /var/django/openPLM/trunk/openPLM/
  • ./ syncdb --all
  • ./ migrate --all --fake


You have to create the superadmin user for Django and a special user named ‘company’. The company can access all contents from openPLM and should sponsor other users. The admin is here to administrate openPLM via its admin interface.

1.2.7. Compile message files

Run the following commands:

  1. make
  2. ./bin/ compile all.

1.2.8. Configure where the files are saved

Create directory where the uploaded files will be stored:

  • mkdir /var/openPLM

Change rights:

  • chown www-data:www-data /var/openPLM

Change rights for the directory where thumbnails will be stored:

  • chown www-data:www-data /var/django/openPLM/trunk/openPLM/media/thumbnails
  • chown www-data:www-data /var/django/openPLM/trunk/openPLM/media/public/thumbnails

1.2.9. Configure the search engine

Although haystack supports several search engines, openPLM needs xapian. You may change the setting HAYSTACK_XAPIAN_PATH if you want to put the indexes in another directory.

Once haystack is configured, you must rebuild the index:

  • ./ rebuild_index
  • chown www-data:www-data -R /var/openPLM/xapian_index/

1.2.10. Configure Celery

openPLM uses Celery to manage asynchronous tasks. Celery needs a broker, you can choose any broker supported by celery but rabbitmq is recommanded.

To configure rabbitmq, you must create an user and a vhost (as root):

  • service rabbitmq-server start
  • rabbitmqctl add_user openplm 'secret' (change this password, use single quotes to put special characters or spaces)
  • rabbitmqctl add_vhost openplm
  • rabbitmqctl set_permissions -p openplm openplm ".*" ".*" ".*"

Then you must modify the BROKER_* settings in the, if you follow this tutorial, you only have to change BROKER_PASSWORD.

For example:

BROKER_HOST = "localhost"
BROKER_USER = "openplm"
BROKER_VHOST = "openplm"

celeryd, celery’s daemon must be run. openPLM ships with an init script:

  • cp /var/django/openPLM/trunk/openPLM/etc/init.d/celeryd /etc/init.d/celeryd
  • cp /var/django/openPLM/trunk/openPLM/etc/default/celeryd /etc/default/celeryd
  • chmod +x /etc/init.d/celeryd
  • mkdir /var/log/celery
  • mkdir /var/run/celery
  • chown www-data:www-data /var/log/celery /var/run/celery

To launch celeryd, run /etc/init.d/celeryd start.

1.2.11. Check required modules

  • ./bin/

    /usr/local/lib/python2.6/dist-packages/pyPdf-1.12-py2.6.egg/pyPdf/ DeprecationWarning: the sets module is deprecated
    from sets import ImmutableSet
    All is ok

1.2.12. Configure Apache server

Edit you Apache configuration file (/etc/apache2/httpd.conf) and add the following lines:

WSGIScriptAlias / /var/django/openPLM/trunk/openPLM/apache/django.wsgi
# required to enable webdav access 
WSGIPassAuthorization On 

<Location /media/thumbnails>
    WSGIAccessScript /var/django/openPLM/trunk/openPLM/apache/access_restricted.wsgi
Alias /media /var/django/openPLM/trunk/openPLM/media
<Directory /var/django/openPLM/trunk/openPLM/media>
    Order deny,allow
    Allow from all

1.2.13. Restart Apache server

  • service apache2 restart

1.2.14. First steps in openPLM Adding users

To add users in OpenPLM, you have two methods. The first one uses the
delegation tab directly in OpenPLM and the second one uses the administration interface. Recommanded method

The first method is the recommanded way to add users to an OpenPLM instance. The only constraint is that you need to have a working email configuration.

You need to log into OpenPLM. If you have just completed the installation, you can log in using the company user created during installation.

Open your web browser and go to:



Here your_site_adress is given as example but you have to use your own site adress


Then follow the steps described in Add a user (sponsor).

Create other users if needed, then logout and login as your new user account. Second method

The second method to add users is not recomanded. Things can go wrong : permissions problems can occurs, and users might not be indexed. The only reason to use it is because you don’t need a working email configuration to use it. But even in that case, it is recommanded to take a few minutes to configure emails and use the sponsoring method.

Open your web browser and go to:



Here your_site_adress is given as example but you have to use your own site adress

Enter superadmin login and password:


If you see an IOError (socket closed), checks your settings, in particular the stuff related to Celery and RabbitMQ.

You can add new user and edit them going to Home>Auth>User:


Do not forget to edit Home>Plmapp>User profiles in order to give correct rights for openPLM application :



For more information about the Django Admin tool .

Then you must create a new Site (use the admin interface) and set the SITE_ID variable in the file.

You are now ready for your first login:


1.2.15. Requiring HTTPS connections

If your (apache) server support HTTPS, you can force HTTPS connections by setting the FORCE_HTTPS and SESSION_COOKIE_SECURE to True in the file.

Each HTTP connection will be redirected to an HTTPS connection.

A possible apache configuration would be (the rewrite and ssl modules must be enabled)

NameVirtualHost *:80
<VirtualHost *:80>

    WSGIScriptAlias / /var/django/openPLM/trunk/openPLM/apache/django.wsgi
    # required to enable webdav access 
    WSGIPassAuthorization On 

    <Location "/admin">
        RewriteEngine On
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    <Location "/media">
        RewriteEngine On
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


NameVirtualHost *:443
<VirtualHost *:443>

    SSLEngine on
    SSLCertificateFile    /etc/ssl/mycert.crt
    SSLCertificateKeyFile /etc/ssl/mykey.key
    SSLVerifyClient none

    WSGIScriptAlias / /var/django/openPLM/trunk/openPLM/apache/django.wsgi
    <Location /media/thumbnails>
        WSGIAccessScript /var/django/openPLM/trunk/openPLM/apache/access_restricted.wsgi
    Alias /media /var/django/openPLM/trunk/openPLM/media
    <Directory /var/django/openPLM/trunk/openPLM/media>
        Order deny,allow
        Allow from all


1.2.16. Configuring E-mails

There are several variables that can be set in the to configure how mails are sent. See the Django documentation for more details.

OpenPLM adds another variable EMAIL_OPENPLM which is the e-mail address set in the from field of each e-mail. Usually, this is a no-reply@ address.

1.2.17. Troubleshootings Admin pages are ugly

openPLM ships with a simlink (/path/to/openPLM/media/admin) that may be broken on your system.

To fix this link, run the following command: ln -s `python -c 'import django; print django.__path__[0]'`/contrib/admin/media /var/django/openPLM/trunk/openPLM/media/admin Connection refused

This error is thrown if Celery is mis-configured and can not connect to RabbitMQ.

See Configure Celery for more details, make sure that RabbitMQ is running and do not forget to edit the BROKER_* variables in the file. I cannot find any objects

You can rebuild the search index (Configure the search engine) and see if openPLM finds your parts.

It is possible that celery can not update the search index. You can check celery’s log (/var/log/celery/*.log) and see if it contains lines like [.. INFO/MainProcess] Got task from broker: openPLM.plmapp.tasks.update_index[...]. It may be a permission problem and chown www-data:www-data -R /var/openPLM/xapian_index/ may fix it. I try to connect to http://server/ but I always get an “It works” page

Maybe your apache installation is a little broken. Does http://server/home/ show a more acceptable result?