source: main/trunk/docs/admin/ht_1_install_server.rst @ 582

Revision 582, 9.4 KB checked in by pcosquer, 9 years ago (diff)

docs: fix wrong command

How to install openPLM server

This document describes how to install an openPLM server.

Requirements

This HowTo is based on:

  • Ubuntu 10.04 LTS server edition (also tested on Debian Squeeze)
  • Apache Server version: Apache/2.2.14 (Ubuntu)
  • PostgreSQL 8.4.4
  • Python 2.6.X
  • Django 1.2.X
  • Celery 2.3.X
  • Haystack 1.2.X
  • Xapian 1.2.X
  • Lepl 5.0
  • South 0.7.3

Note

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

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-setuptools python-dev python-imaging python-kjbuckets python-pypdf ipython
  4. easy_install odfpy
  5. apt-get install graphviz graphviz-dev
  6. easy_install 'pygraphviz>=1.1'
  7. apt-get install python-xapian rabbitmq-server
  8. apt-get install python-django python-docutils
  9. easy_install 'south>=0.7'
  10. easy_install celery
  11. easy_install django-celery
  12. easy_install 'django-haystack<2'
  13. apt-get install postgresql python-psycopg2
  14. apt-get install tracker-extract
  15. easy_install lepl

Check applications are ok

For Apache server:

root@openplm-demo:~# service apache2 status
Apache is running (pid 5315).

For Python:

root@openplm-demo:~# python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Note

press :kbd:`Control-D` to exit Python shell

System Message: ERROR/3 (<string>, line 73); backlink

Unknown interpreted text role "kbd".

For Django:

root@openplm-demo:~# django-admin --version
1.2.5

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://openplm.org/openPLM

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

  • cd /var/django/openPLM

  • svn info

    Path: .
    URL: svn://openplm.org/openPLM
    Repository Root: svn://openplm.org/openPLM
    Repository UUID: 5b46f505-65de-4892-aab2-a53e26d394e5
    Revision: 195
    Node Kind: directory
    Schedule: normal
    Last Changed Author: pjoulaud
    Last Changed Rev: 195
    Last Changed Date: 2010-08-25 11:29:03 +0200 (mer., 25 août 2010)
    

Configure PostgreSQL

Check PostgreSQL is running:

  • ps aux|grep postgres

    postgres 25961  0.0  0.9  50544  4968 ?    S    Aug26   0:14 /usr/lib/postgresql/8.4/bin/postgres -D /var/postgres
    postgres 25963  0.0  1.0  50664  5600 ?    Ss   Aug26   1:07 postgres: writer process
    postgres 25964  0.0  0.2  50544  1336 ?    Ss   Aug26   1:00 postgres: wal writer process
    postgres 25965  0.0  0.2  50808  1480 ?    Ss   Aug26   0:28 postgres: autovacuum launcher process
    postgres 25966  0.0  0.2  14664  1224 ?    Ss   Aug26   0:24 postgres: stats collector process
    root     27338  0.0  0.1   3324   804 pts/3    R+   16:53   0:00 grep --color=auto postgres
    

Note

If PostgreSQL is already installed, you can go to next topic directly.

Set password for 'postgres' user (in this example we give 'MyPassword' but you can change it)

  • passwd postgres
  • mkdir /var/postgres

All files necessary to run PostgreSQL will be stored in this directory.

  • chown postgres:postgres /var/postgres/

  • find / -name initdb

    /usr/lib/postgresql/8.4/bin/initdb
    
  • locale-gen fr_FR.UTF-8

  • 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 &

  • psql

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

Create the database

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

Note

You have to create the superadmin user for Django (in this example, we give 'MyAdmin' but you can change it) and its password.

Warning

Edit the '/var/django/openPLM/trunk/openPLM/settings.py' and set correct password ('MyPassword') for DATABASE_PASSWORD

Compile message files

Run the following commands:

  1. make
  2. ./manage.py compilemessages.

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/navigate

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:

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

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):

  • 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, if you follow this tutorial, you only have to change BROKER_PASSWORD.

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

System Message: ERROR/3 (<string>, line 222); backlink

Unknown interpreted text role "command".
  • 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 :command:`celeryd`, run /etc/init.d/celeryd start.

System Message: ERROR/3 (<string>, line 231); backlink

Unknown interpreted text role "command".

Check required modules

  • ./check_modules.py

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

Configure Apache server

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

System Message: ERROR/3 (<string>, line 246); backlink

Unknown interpreted text role "file".
WSGIScriptAlias / /var/django/openPLM/trunk/openPLM/apache/django.wsgi
Alias /media /var/django/openPLM/trunk/openPLM/media
<Directory /var/django/openPLM/trunk/openPLM/docs>
    Order deny,allow
    Allow from all
</Directory>
<Directory /var/django/openPLM/trunk/openPLM/media>
    Order deny,allow
    Allow from all
</Directory>

Restart Apache server

  • service apache2 restart

First steps in openPLM

Open your web browser and go to:

http://your_site_adress/admin/

Note

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

Enter superadmin login and password:

images/admin_login.png

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:

images/admin_user.png

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

images/admin_userprofile.png

Note

For more information about the Django Admin tool .

Then you must create a new Site (use the admin interface) and sets the SITE_ID variable in the :file:`settings.py` file.

System Message: ERROR/3 (<string>, line 293); backlink

Unknown interpreted text role "file".

You are now ready for your first login:

http://localhost/
images/openplm_connexion.png

Configuring E-mails

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

System Message: ERROR/3 (<string>, line 306); backlink

Unknown interpreted text role "file".

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.

Note: See TracBrowser for help on using the repository browser.