summaryrefslogtreecommitdiff
path: root/docs/install.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/install.rst')
-rw-r--r--docs/install.rst218
1 files changed, 106 insertions, 112 deletions
diff --git a/docs/install.rst b/docs/install.rst
index 884867b..da40848 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -5,7 +5,7 @@ Chimère installation
====================
:Author: Étienne Loks
-:date: 2012-02-15
+:date: 2012-03-09
:Copyright: CC-BY 3.0
This documents presents the installation of Chimère.
@@ -20,155 +20,183 @@ Installation
Prerequisites
*************
- - `apache <http://www.apache.org/>`_ version 2.x with [mod_python http://www.modpython.org/] 3.x
-
+ - `apache <http://www.apache.org/>`_ version 2.x
- `python <http://www.python.org/>`_ versions 2.6 or 2.7
-
- - `geodjango <http://www.djangoproject.com/>`_ version 1.0
-
+ - `django <http://www.djangoproject.com/>`_ version 1.3
+ - `south <http://south.aeracode.org/>`_
- `postgres <http://www.postgresql.org/>`_ version 8.x
-
- `gettext <http://www.gnu.org/software/gettext/>`_
-
- `psycopg2 <http://freshmeat.net/projects/psycopg/>`_
-
- `Python Imaging Library <http://www.pythonware.com/products/pil/>`_
-
- `Beautiful Soup <http://www.crummy.com/software/BeautifulSoup/>`_
-
- `lxml <http://lxml.de/>`_
+ - `jquery <http://jquery.com/>`_
+ - `jquery-ui <http://jqueryui.com/>`_
-geodjango is a part of django version 1.0 but it has some specific (geographically related) additionnal dependencies:
+geodjango is a part of django since version 1.0 but it has some specific
+(geographically related) additional dependencies:
- `geos <http://trac.osgeo.org/geos/>`_ 3.0.x
-
- `proj.4 <http://trac.osgeo.org/proj/>`_ 4.4 to 4.6
-
- `posgis <http://postgis.refractions.net/>`_ versions 1.2.1 or 1.3.x
-
- `gdal <http://www.gdal.org/>`_
Optionaly (but recommanded):
- `tinymce <http://tinymce.moxiecode.com/>`_
-
- `gpsbabel <http://www.gpsbabel.org/>`_
-The simpliest way to obtain these packages is to get them from your favorite Linux distribution repositories (for instance python, python-django, python-beautifulsoup, tinymce, apache2, libgeos-3.2.0, proj, gdal-bin, python-gdal, python-lxml, python-psycopg2, python-imaging, gettext, postgresql-8.4 and postgresql-8.4-postgis packages for Debian Squeeze). If these packages do not exist in your distribution's repository, please refer to the applications' websites.
+The simpliest way to obtain these packages is to get them from your favorite
+Linux distribution repositories. For instance on Debian Wheezy::
+
+ apt-get install python python-django python-django-south \
+ python-beautifulsoup tinymce apache2 libgeos-3.3.1 proj gdal-bin \
+ python-gdal python-lxml python-psycopg2 python-imaging gettext \
+ postgresql-9.1 postgresql-9.1-postgis libjs-jquery libjs-jquery-ui
+
+If these packages do not exist in your distribution's repository, please refer
+to the applications' websites.
Database configuration
**********************
-Now that postgres and postgis are installed, you need to create a new user for chimere::
+Now that postgres and postgis are installed, you need to create a new user for
+chimere::
createuser --echo --adduser --createdb --encrypted --pwprompt chimere-user
-Then, you have to create the database, and initialize the geographic types (adapt the paths accordingly to your needs)::
+Then, you have to create the database and initialize the geographic types (adapt
+the paths accordingly to your needs)::
createdb --echo --owner chimere-user --encoding UNICODE chimere "My Chimère database"
createlang plpgsql chimere
psql -d chimere -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
psql -d chimere -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
-Getting the sources
-*******************
-
-The last "stable" version is available in this `directory <http://www.peacefrogs.net/download/>`_.
-
-Another solution is to get the last git version::
-
- git clone git://www.peacefrogs.net/git/chimere
- git tag -l # list tagged versions
- git checkout v1.0.0 # checkout the desired version
-
-
Install the sources
*******************
-Unpack and move the files in an apache user (www-data for Debian) readable directory::
+Choose a path to install your Chimère::
sudo mkdir /var/local/django
- cd /var/local/django
- sudo tar xvjf /home/etienne/chimere-last.tar.bz2
- sudo chown -R etienne:www-data chimere
-
-In your chimere application directory create settings.py to fit to your configuration.
-A base template is provided (settings.py.example)::
+ INSTALL_PATH=/var/local/django
- cd chimere/chimere/
- cp settings.py.example settings.py
- vim settings.py
- ####
- PROJECT_NAME = u'Chimère'
+From an archive
++++++++++++++++
- ROOT_PATH = '/var/local/django/chimere/chimere/' # path to the installation of Chimère
+The last "stable" version is available in this `directory <http://www.peacefrogs.net/download/>`_.
- SERVER_URL = "http://www.peacefrogs.net/" # root of the web address of Chimère
- EXTRA_URL = 'chimere/' # suffix to the web address of Chimère
- BASE_URL = SERVER_URL + EXTRA_URL
- EMAIL_HOST = 'localhost' # smtp of an email server to send emails
+Download, unpack and move the files in an apache user (www-data for Debian)
+readable directory::
- TINYMCE_URL = SERVER_URL + 'tinymce/'
+ cd $INSTALL_PATH
+ sudo tar xvjf /home/etienne/chimere-last.tar.bz2
+ sudo chown -R myusername:www-data chimere
- # chimere specific
- DEFAULT_CENTER = (-1.679444, 48.114722) # default center of the map
- EPSG_PROJECTION = 900913 # projection used for data exchange (JSON flow)
- EPSG_DISPLAY_PROJECTION = 4326 # projection used to display on the map
+From the git repository
++++++++++++++++++++++++
- # default id category to check on the map
- DEFAULT_CATEGORIES = [1] # list of default category ids checked on the map
+Another solution is to get the last git version::
- # JS definition of the main map cf. OpenLayers documentation for more details
- # to begin you can leave the default OpenStreetMap map rendered with Mapnik
- MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')"
+ cd $INSTALL_PATH
+ git clone git://www.peacefrogs.net/git/chimere
+ cd chimere
+ git tag -l # list tagged versions
+ git checkout v2.0.0 # checkout the desired version
- # setting the appropriate language code for your site
- LANGUAGE_CODE = 'en-gb'
- # database configuration
- DATABASE_ENGINE = 'postgresql_psycopg2' # leave it to 'postgresql_psycopg2'
- DATABASE_NAME = 'chimere' # database name
- DATABASE_USER = 'chimere-user' # database user
- DATABASE_PASSWORD = 'mypassword' # database password
- DATABASE_HOST = '' # set to empty string for localhost
+Base configuration
+******************
- DATABASE_PORT = '' # set to empty string for default
+There a default project provided "example_project". Copy and modify it (or
+get another project based on Chimere)::
- ####
+ cd $INSTALL_PATH/chimere
+ cp -r example_project mychimere_project
-If you want to use tinymce don't forget to make it available to Chimère.
+In your chimere application directory create settings.py to fit to your
+configuration.
+A base template is provided (settings.py.example) and short descriptions of
+the more relevant fields are given below (at least check them)::
-In this same chimere directory, make a symbolic link to django's basic styles (do not forget to change the path according to your configuration, it is the last time I will recall it to you. Next time, you are on your own!)::
+ cd $INSTALL_PATH/chimere/mychimere_project
+ cp settings.py.example settings.py
+ vim settings.py
+:Fields:
+
+ * PROJECT_NAME: name of the project
+ * ROOT_PATH: path to the installation of Chimère
+ * SERVER_URL: root of the web address of Chimère
+ * EXTRA_URL: suffix to the web address of Chimère
+ * EMAIL_HOST: smtp of an email server to send emails
+ * STATIC_URL: url to static files
+ * TINYMCE_URL: url to tinymce path (default is appropriate
+ for a Debian installation with tinymce activated)
+ * JQUERY_JS_URLS: list of Jquery and Jquery-ui urls (default is appropriate
+ for a Debian installation with Jquery and Jquery-ui activated)
+ * JQUERY_CSS_URLS: list of Jquery and Jquery-ui urls (default is appropriate
+ for a Debian installation with Jquery and Jquery-ui activated)
+ * GPSBABEL: path to gpsbabel (default is appropriate
+ for a Debian installation with gpsbabel installed)
+ * CHIMERE_DEFAULT_ZOOM: default zoom on map
+ * CHIMERE_DEFAULT_CENTER: center of the map
+ * CHIMERE_RESTRICTED_EXTENT: to restrict the map to a defined bounding box
+ set it here (left, bottom, right, top)
+ * CHIMERE_DYNAMIC_CATEGORIES: dynamic load of categories on the main map
+ * CHIMERE_DISPLAY_AREAS: display area's shortcuts
+ * CHIMERE_DEFAULT_CATEGORIES: ids of default categories to check on the map
+ * DATABASES: parameters for the database
+ * TIME_ZONE: local time zone for this installation
+ * LANGUAGE_CODE: language code for this installation
+ * ROOT_URLCONF: url configuration for your project something like:
+ 'mychimere_project.urls'
+
+In this same chimere directory, make a symbolic link to django's basic styles
+(do not forget to change the path according to your configuration)::
+
+ cd $INSTALL_PATH/chimere/mychimere_project
ln -s /usr/share/pyshared/django/contrib/admin/media/ .
Compiling languages
*******************
-If your language is available in the locale directory of chimere, you will just need to get it compiled. Still being in the chimere directory, this can be done with (here, "de" stands for german. Replace it with the appropriate language code)::
+If your language is available in the locale directory of chimere, you will just
+need to get it compiled. This can be done with (here, "de" stands for german. Replace it with the appropriate language code)::
- django-admin compilemessages -l de
+ cd $INSTALL_PATH/chimere/mychimere_project
+ ./manage.py compilemessages -l fr
-If your language is not available, feel free to create the default po files and to submit it, contributions are well appreciated. Procedure is as follows :
+If your language is not available, feel free to create the default po files and
+to submit it, contributions are well appreciated. Procedure is as follows:
-You first need to create the default po file (of course, replace "de" according to the language you chose to create)::
+You first need to create the default po file (of course, replace "fr" according
+to the language you choose to create)::
- django-admin makemessages -l de
+ ./manage.py makemessages -l fr
-There should now be a django.po file in locale/de/LC_MESSAGES. Complete it with your translation.
+There should now be a django.po file in locale/fr/LC_MESSAGES. Complete it with
+your translation.
-Now that the translation file is completed, just compile it the same way you would have if the language file was already available.
+Now that the translation file is completed, just compile it the same way you
+would have if the language file was already available.
Database initialisation
***********************
Create the appropriate tables (still being in chimère application directory)::
+ cd $INSTALL_PATH/chimere/mychimere_project
./manage.py syncdb
-You will be prompted for the creation of an administrator account (administration can be found at: http://where_is_chimere/admin).
+You will be prompted for the creation of an administrator account
+(administration can be found at: http://where_is_chimere/admin). Then you have
+to create tables managed with south::
+
+ ./manage.py migrate -a
+
The database is set, congratulations!
Webserver configuration
@@ -195,40 +223,6 @@ To activate the website reload apache::
sudo a2ensite chimere
sudo /etc/init.d/apache2 reload
-Apache configuration with mod_python
-++++++++++++++++++++++++++++++++++++
-
-Install mod_python for apache::
-
- apt-get install libapache2-mod-python
-
-Create and edit a configuration file for Chimère::
-
- sudo vim /etc/apache2/sites-available/chimere
-
-Insert Apache directives for your installation::
-
- # part of the address after the root of your site
- <Location "/chimere/">
- # directory path to the father of the installation of Chimère
- PythonPath "['/var/local/django/'] + sys.path"
- SetHandler python-program
- PythonHandler django.core.handlers.modpython
- SetEnv DJANGO_SETTINGS_MODULE chimere.settings
- # set it to on or off if in test or production environment
- PythonDebug On
- # put differents interpreter names if you deploy several Chimère
- PythonInterpreter chimere
- </Location>
-
-To activate the website reload apache::
-
- sudo a2ensite chimere
- sudo /etc/init.d/apache2 reload
-
-
-Now that you have gone through ALL this configuration procedure (which was not that hard after all) you can configure the site.
-
------------------
Base configuration
------------------