Changeset 412 in main


Ignore:
Timestamp:
10/25/11 13:06:55 (8 years ago)
Author:
pcosquer
Message:

update the documentation: explain how to install/deploy xapian and celery

Location:
trunk/docs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/conf.py

    r406 r412  
    2222 
    2323from django.conf import global_settings, settings 
     24global_settings.HAYSTACK_SITECONF = "openPLM.plmapp.search_sites" 
     25global_settings.HAYSTACK_SEARCH_ENGINE = "dummy" 
    2426global_settings.DOCUMENTS_DIR = "/tmp" 
    2527global_settings.THUMBNAILS_DIR = "/tmp" 
  • trunk/docs/ht_1_install_server.rst

    r361 r412  
    99============= 
    1010 
    11 This HowTo is based on : 
    12  * Ubuntu 10.04 LTS server edition 
    13  * Apache Server version: Apache/2.2.14 (Ubuntu) 
    14  * PostgreSQL 8.4.4 
    15  * Python 2.6.5 
    16  * Django 1.1.1 
     11This HowTo is based on: 
     12 
     13    * Ubuntu 10.04 LTS server edition (also tested on Debian Squeeze) 
     14    * Apache Server version: Apache/2.2.14 (Ubuntu) 
     15    * PostgreSQL 8.4.4 
     16    * Python 2.6.X 
     17    * Django 1.2.X 
     18    * Celery 2.3.X 
     19    * Haystack 1.2.X 
     20    * Xapian 1.2.X 
    1721  
    18     .. note :: 
    19         Django framework can run with SQLite 3 and MySQL databases and with other web servers. 
    20         We welcome all feedbacks about these combinations. For more information, you can visit : 
    21         `Django website <http://www.djangoproject.com/>`_ 
     22  
     23.. note:: 
     24 
     25    Django framework can run with SQLite 3 and MySQL databases and with other web servers. 
     26    We welcome all feedbacks about these combinations. For more information, you can visit : 
     27    `Django website <http://www.djangoproject.com/>`_ 
    2228 
    2329Install necessary packages 
    2430========================== 
    2531 
    26     #. :command:`apt-get install swig build-essential pkg-config build-essential gettext` 
    27     #. :command:`apt-get install apache2 libapache2-mod-wsgi` 
    28     #. :command:`apt-get install python-setuptools python-dev python-imaging python-kjbuckets python-pypdf ipython` 
    29     #. :command:`easy_install odfpy` 
    30     #. :command:`apt-get install graphviz graphviz-dev` 
    31     #. :command:`easy_install pygraphviz` 
    32     #. :command:`apt-get install python-django python-django-south` 
    33     #. :command:`apt-get install postgresql python-psycopg2 pgadmin3` 
     32First, you must install some dependencies: 
     33 
     34    #. ``apt-get install swig build-essential pkg-config build-essential gettext`` 
     35    #. ``apt-get install apache2 libapache2-mod-wsgi`` 
     36    #. ``apt-get install python-setuptools python-dev python-imaging python-kjbuckets python-pypdf ipython`` 
     37    #. ``easy_install odfpy`` 
     38    #. ``apt-get install graphviz graphviz-dev`` 
     39    #. ``easy_install pygraphviz>=1.1`` 
     40    #. ``apt-get install python-xapian rabbitmq-server`` 
     41    #. ``apt-get install python-django python-django-south`` 
     42    #. ``easy_install celery`` 
     43    #. ``easy_install django-celery`` 
     44    #. ``easy_install django-haystack==1.2`` 
     45    #. ``apt-get install postgresql python-psycopg2 pgadmin3`` 
     46    #. ``apt-get install tracker-extract`` 
    3447    
    3548Check applications are ok 
    3649=============================== 
    3750 
    38     For Apache server : :: 
    39      
    40         root@openplm-demo:~# service apache2 status 
    41          
    42         Apache is running (pid 5315). 
    43      
    44     For Python : :: 
    45      
    46         root@openplm-demo:~# python 
    47          
    48         Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)  
    49         [GCC 4.4.3] on linux2 
    50         Type "help", "copyright", "credits" or "license" for more information. 
    51         >>>  
    52      
    53      
    54     .. note :: 
    55      
    56         press :kbd:`Control-D` to exit Python shell 
    57      
    58     For Django : :: 
    59      
    60         root@openplm-demo:~# django-admin --version 
    61         1.1.1 
    62  
    63 Get codes using Subversion 
     51For Apache server: :: 
     52 
     53    root@openplm-demo:~# service apache2 status 
     54     
     55    Apache is running (pid 5315). 
     56 
     57For Python: :: 
     58 
     59    root@openplm-demo:~# python 
     60     
     61    Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)  
     62    [GCC 4.4.3] on linux2 
     63    Type "help", "copyright", "credits" or "license" for more information. 
     64    >>>  
     65 
     66 
     67.. note:: 
     68 
     69    press :kbd:`Control-D` to exit Python shell 
     70 
     71For Django: :: 
     72 
     73    root@openplm-demo:~# django-admin --version 
     74    1.1.1 
     75 
     76 
     77Get code using Subversion 
    6478========================== 
    6579 
    66     * :command:`apt-get install subversion` 
    67      
    68     * :command:`mkdir /var/django` 
    69      
    70     All files used for a new django site will be stored in this directory. 
    71      
    72     * :command:`cd /var/django` 
    73      
    74     * :command:`svn co svn://openplm.org/openPLM` 
    75      
    76     The directory ./openPLM is created and all codes are downloaded. 
    77      
    78     * :command:`cd /var/django/openPLM` 
    79      
    80     * :command:`svn info` :: 
     80    * ``apt-get install subversion`` 
     81     
     82    * ``mkdir /var/django`` 
     83     
     84All files used for a new django site will be stored in this directory. 
     85     
     86    * ``cd /var/django`` 
     87     
     88    * ``svn co svn://openplm.org/openPLM`` 
     89     
     90 The directory ./openPLM is created and all codes are downloaded. 
     91     
     92    * ``cd /var/django/openPLM`` 
     93     
     94    * ``svn info`` :: 
    8195         
    8296        Path: . 
     
    95109==================== 
    96110 
    97     Check PostgreSQL is running: 
    98      
    99     * :command:`ps aux|grep postgres` :: 
     111Check PostgreSQL is running: 
     112     
     113    * ``ps aux|grep postgres`` :: 
    100114     
    101115        postgres 25961  0.0  0.9  50544  4968 ?    S    Aug26   0:14 /usr/lib/postgresql/8.4/bin/postgres -D /var/postgres 
     
    106120        root     27338  0.0  0.1   3324   804 pts/3    R+   16:53   0:00 grep --color=auto postgres 
    107121     
    108     .. note :: 
    109      
    110         If PostgreSQL is already installed, you can go to next topic directly. 
    111      
    112     Set password for 'postgres' user (in this example we give 'MyPassword' but you can change it) 
    113      
    114     * :command:`passwd postgres` 
    115     * :command:`mkdir /var/postgres` 
    116      
    117     All files necessary to run PostgreSQL will be stored in this directory. 
    118      
    119     * :command:`chown postgres:postgres /var/postgres/` 
    120     * :command:`find / -name initdb` :: 
     122.. note:: 
     123     
     124    If PostgreSQL is already installed, you can go to next topic directly. 
     125     
     126Set password for 'postgres' user (in this example we give 'MyPassword' but you can change it) 
     127     
     128    * ``passwd postgres`` 
     129    * ``mkdir /var/postgres`` 
     130     
     131All files necessary to run PostgreSQL will be stored in this directory. 
     132     
     133    * ``chown postgres:postgres /var/postgres/`` 
     134    * ``find / -name initdb`` :: 
    121135     
    122136        /usr/lib/postgresql/8.4/bin/initdb 
    123137         
    124     * :command:`locale-gen fr_FR.UTF-8` 
    125     * :command:`su postgres` 
    126     * :command:`/usr/lib/postgresql/8.4/bin/initdb --encoding=UTF-8 --locale=fr_FR.UTF-8 --pgdata=/var/postgres/` 
    127     * :command:`/usr/lib/postgresql/8.4/bin/postgres -D /var/postgres &` 
    128     * :command:`psql` :: 
     138    * ``locale-gen fr_FR.UTF-8`` 
     139    * ``su postgres`` 
     140    * ``/usr/lib/postgresql/8.4/bin/initdb --encoding=UTF-8 --locale=fr_FR.UTF-8 --pgdata=/var/postgres/`` 
     141    * ``/usr/lib/postgresql/8.4/bin/postgres -D /var/postgres &`` 
     142    * ``psql`` :: 
    129143     
    130144            postgres=#create database openplm; 
     
    132146            \q 
    133147     
    134     * :command:`exit` 
    135  
    136 Finalize installation 
    137 ===================== 
    138  
    139     * :command:`cd /var/django/openPLM/trunk/openPLM/` 
    140     * :command:`./manage.py syncdb --all` 
    141     * :command:`./manage.py migrate --all --fake` 
     148    * ``exit`` 
     149 
     150 
     151Create the database 
     152=================== 
     153 
     154    * ``cd /var/django/openPLM/trunk/openPLM/`` 
     155    * ``./manage.py syncdb --all`` 
     156    * ``./manage.py migrate --all --fake`` 
    142157     
    143158    .. note:: 
     
    148163        Edit the '/var/django/openPLM/trunk/openPLM/settings.py' and set correct password ('MyPassword') 
    149164        for DATABASE_PASSWORD 
    150      
    151     Create directory where the uploaded files will be stored : 
    152      
    153     * :command:`mkdir /var/openPLM` 
    154      
    155     Change rights : 
    156      
    157     * :command:`chown www-data:www-data /var/openPLM` 
    158      
    159     Change rights for the directory where thumbnails will be stored : 
    160      
    161     * :command:`chown www-data:www-data /var/django/openPLM/trunk/openPLM/media/thumbnails` 
    162      
    163     Check we have all modules : 
    164      
    165     * :command:`./check_modules.py` :: 
     165    
     166Configure where the files are saved 
     167=================================== 
     168 
     169Create directory where the uploaded files will be stored: 
     170     
     171    * ``mkdir /var/openPLM`` 
     172 
     173     
     174Change rights: 
     175     
     176    * ``chown www-data:www-data /var/openPLM`` 
     177     
     178Change rights for the directory where thumbnails will be stored: 
     179     
     180    * ``chown www-data:www-data /var/django/openPLM/trunk/openPLM/media/thumbnails`` 
     181    * ``chown www-data:www-data /var/django/openPLM/trunk/openPLM/media/navigate`` 
     182   
     183Configure the search engine 
     184============================= 
     185 
     186Although haystack supports several search engines, openPLM needs xapian. 
     187You may change the setting `HAYSTACK_XAPIAN_PATH` if you want to put the indexes 
     188in another directory. 
     189 
     190Once haystack is configured, you must rebuild the index: 
     191 
     192    * ``./manage.py rebuild_index`` 
     193    * ``chown www-data:www-data -R /var/openPLM/xapian_index/`` 
     194     
     195Configure Celery 
     196================ 
     197 
     198openPLM uses Celery to manage asynchronous tasks. Celery needs a broker, you can 
     199choose any broker supported by celery but *rabbitmq* is recommanded. 
     200 
     201To configure rabbitmq, you must create an user and a vhost: 
     202 
     203    * ``rabbitmqctl add_user openplm 'a secret password but not this one'`` 
     204    * ``rabbitmqctl add_vhost openplm`` 
     205    * ``rabbitmqctl set_permissions -p openplm openplm ".*" ".*" ".*"`` 
     206 
     207Then you must modify the `BROKER_*` settings, if you follow this tutorial, you 
     208only have to change `BROKER_PASSWORD`. 
     209 
     210:command:`celeryd`, celery's daemon must be run. openPLM ships with an init script: 
     211 
     212    * ``cp /var/django/openPLM/trunk/openPLM/etc/init.d/celeryd /etc/init.d/celeryd`` 
     213    * ``cp /var/django/openPLM/trunk/openPLM/etc/default/celeryd /etc/default/celeryd`` 
     214    * ``chmod +x /etc/init.d/celeryd`` 
     215    * ``mkdir /var/log/celery`` 
     216    * ``mkdir /var/run/celery`` 
     217    * ``chown www-data:www-data /var/log/celery /var/run/celery`` 
     218 
     219To launch :command:`celeryd`, run ``/etc/init.d celeryd start``. 
     220 
     221 
     222 
     223Check required modules 
     224====================== 
     225     
     226    * ``./check_modules.py`` :: 
    166227     
    167228        /usr/local/lib/python2.6/dist-packages/pyPdf-1.12-py2.6.egg/pyPdf/pdf.py:52: DeprecationWarning: the sets module is deprecated 
     
    169230        All is ok 
    170231 
    171     Configure Apache server : 
    172     * :command:`vi /etc/apache2/httpd.conf` : :: 
    173      
    174             WSGIScriptAlias / /var/django/openPLM/trunk/openPLM/apache/django.wsgi 
    175             Alias /media /var/django/openPLM/trunk/openPLM/media 
    176             <Directory /var/django/openPLM/trunk/openPLM/docs> 
    177                 Order deny,allow 
    178                 Allow from all 
    179             </Directory> 
    180             <Directory /var/django/openPLM/trunk/openPLM/media> 
    181                 Order deny,allow 
    182                 Allow from all 
    183             </Directory> 
    184      
    185     Restart Apache server : 
    186      
    187     * :command:`service apache2 restart` 
     232Configure Apache server 
     233======================= 
     234 
     235Edit you Apache configuration file (:file:`/etc/apache2/httpd.conf`) and 
     236add the following lines: :: 
     237     
     238    WSGIScriptAlias / /var/django/openPLM/trunk/openPLM/apache/django.wsgi 
     239    Alias /media /var/django/openPLM/trunk/openPLM/media 
     240    <Directory /var/django/openPLM/trunk/openPLM/docs> 
     241        Order deny,allow 
     242        Allow from all 
     243    </Directory> 
     244    <Directory /var/django/openPLM/trunk/openPLM/media> 
     245        Order deny,allow 
     246        Allow from all 
     247    </Directory> 
     248 
     249Restart Apache server 
     250===================== 
     251 
     252    * ``service apache2 restart`` 
    188253 
    189254First steps in openPLM 
    190255====================== 
    191256 
    192     Open your web browser and go to : :: 
    193      
    194         http://your_site_adress/admin/ 
    195          
    196     .. note:: Here your_site_adress is given as example but you have to use your own site adress 
    197      
    198     Enter superadmin login and password : 
    199      
    200     .. image:: images/admin_login.png 
    201      
    202     You can add new user and edit them going to Home>Auth>User :  
    203  
    204     .. image:: images/admin_user.png 
    205  
    206     Do not forget to edit Home>Plmapp>User profiles in order to give correct rights for openPLM application : 
    207  
    208     .. image:: images/admin_userprofile.png 
    209  
    210     .. note :: 
    211         For more information about the `Django Admin tool <http://docs.djangoproject.com/en/dev/intro/tutorial02/>`_ .  
    212  
    213     Then you must create a new *Site* (use the admin interface) and sets the `SITE_ID` 
    214     variable in the :file:`settings.py` file. 
    215  
    216     You are now ready for your first login : :: 
    217      
    218         http://localhost/ 
    219          
    220     .. image:: images/openplm_connexion.png 
     257Open your web browser and go to: :: 
     258 
     259    http://your_site_adress/admin/ 
     260     
     261.. note:: Here your_site_adress is given as example but you have to use your own site adress 
     262 
     263Enter superadmin login and password: 
     264 
     265.. image:: images/admin_login.png 
     266 
     267You can add new user and edit them going to Home>Auth>User:  
     268 
     269.. image:: images/admin_user.png 
     270 
     271Do not forget to edit Home>Plmapp>User profiles in order to give correct rights for openPLM application : 
     272 
     273.. image:: images/admin_userprofile.png 
     274 
     275.. note:: 
     276    For more information about the `Django Admin tool <http://docs.djangoproject.com/en/dev/intro/tutorial02/>`_ .  
     277 
     278Then you must create a new *Site* (use the admin interface) and sets the `SITE_ID` 
     279variable in the :file:`settings.py` file. 
     280 
     281You are now ready for your first login: :: 
     282 
     283    http://localhost/ 
     284     
     285.. image:: images/openplm_connexion.png 
    221286 
    222287 
Note: See TracChangeset for help on using the changeset viewer.