summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author√Čtienne Loks2011-10-25 14:15:21 +0200
committer√Čtienne Loks2011-10-25 14:15:21 +0200
commit97e37da73eeef899628491aee9989ac4691b3784 (patch)
tree477fdf8ac29309f9ec8ebe8469c1a7139d8baadc
parent0d930f95701fbbc9b5b7fb9bc28c3a664a600f9a (diff)
Update of documentation
-rw-r--r--docs/conf/apache-modpython-virtualhost.conf13
-rw-r--r--docs/conf/apache-modpython.conf13
-rw-r--r--docs/conf/apache-wsgi.conf11
-rw-r--r--docs/conf/django.wsgi5
-rw-r--r--docs/source/install.rst122
5 files changed, 117 insertions, 47 deletions
diff --git a/docs/conf/apache-modpython-virtualhost.conf b/docs/conf/apache-modpython-virtualhost.conf
new file mode 100644
index 0000000..06bbff8
--- /dev/null
+++ b/docs/conf/apache-modpython-virtualhost.conf
@@ -0,0 +1,13 @@
+<VirtualHost *:80>
+ ServerName papillon.example.com
+ # directory path to the installation of Papillon
+ PythonPath "['/var/local/django/papillon/'] + sys.path"
+ SetHandler python-program
+ PythonHandler django.core.handlers.modpython
+ SetEnv DJANGO_SETTINGS_MODULE papillon.settings
+ # set it to on or off if in test or production environment
+ PythonDebug On
+ # put differents interpreter names if you deploy several Papillon
+ PythonInterpreter papillon
+</VirtualHost>
+
diff --git a/docs/conf/apache-modpython.conf b/docs/conf/apache-modpython.conf
new file mode 100644
index 0000000..5e0d15d
--- /dev/null
+++ b/docs/conf/apache-modpython.conf
@@ -0,0 +1,13 @@
+# part of the address after the root of your site: EXTRA_URL
+<Location "/papillon/">
+ # directory path to the installation of Papillon
+ PythonPath "['/var/local/django/papillon/'] + sys.path"
+ SetHandler python-program
+ PythonHandler django.core.handlers.modpython
+ SetEnv DJANGO_SETTINGS_MODULE papillon.settings
+ # set it to on or off if in test or production environment
+ PythonDebug On
+ # put differents interpreter names if you deploy several Papillon
+ PythonInterpreter papillon
+</Location>
+
diff --git a/docs/conf/apache-wsgi.conf b/docs/conf/apache-wsgi.conf
new file mode 100644
index 0000000..a5277e6
--- /dev/null
+++ b/docs/conf/apache-wsgi.conf
@@ -0,0 +1,11 @@
+<VirtualHost *:80>
+ ServerName papillon.example.com
+ WSGIDaemonProcess ishtar processes=2 maximum-requests=500 threads=1
+ WSGIProcessGroup ishtar
+ WSGIScriptAlias / /var/local/django/papillon/apache/django.wsgi
+
+ ErrorLog ${APACHE_LOG_DIR}/papillon/error.log
+ LogLevel warn
+ CustomLog ${APACHE_LOG_DIR}/papillon/access.log combined
+
+</VirtualHost>
diff --git a/docs/conf/django.wsgi b/docs/conf/django.wsgi
new file mode 100644
index 0000000..7f86580
--- /dev/null
+++ b/docs/conf/django.wsgi
@@ -0,0 +1,5 @@
+import os, sys
+sys.path.append('/var/local/django/papillon/')
+os.environ['DJANGO_SETTINGS_MODULE'] = 'papillon.settings'
+import django.core.handlers.wsgi
+application = django.core.handlers.wsgi.WSGIHandler()
diff --git a/docs/source/install.rst b/docs/source/install.rst
index 5a7ef6f..48f098d 100644
--- a/docs/source/install.rst
+++ b/docs/source/install.rst
@@ -8,8 +8,8 @@ Papillon installation
:Date: 2011-10-25
:Copyright: CC-BY 3.0
-This document presents the installation of Ishtar on a machine with GNU/Linux.
-Instruction are given for Debian but they are easy to adapt to other distribution.
+This document presents the installation of Papillon on a machine with GNU/Linux.
+Instructions are given for Debian and bash but they are easy to adapt to other distribution and other shells.
.. contents::
@@ -35,21 +35,30 @@ The simple way to obtain theses elements is to get package from your favourite l
For instance the packages for Debian squeeze are get with::
$ sudo apt-get install python python-django python-django-south
- $ sudo apt-get install python-markdown gettext apache2 libapache2-mod-python
+ $ sudo apt-get install python-markdown gettext apache2
Otherwise refer to the sites of these applications.
Optionnal requesite:
- `tinymce <http://tinymce.moxiecode.com/>`_: Javascript WYSIWYG Editor. If you want to use it don't forget to edit TINYMCE_URL in settings.py.
+Choose an install path
+----------------------
+
+First of all you have to choose an install path::
+
+ $ INSTALL_PATH=/var/local/django/
+
+Of course you have to create it if it doesn't exist.
Getting the sources
-------------------
The last "stable" version is available in this `directory <http://www.peacefrogs.net/download/>`.
-Another solution is to get it from the git repository (inside /var/local/django/ if you want to strictly follow this HOWTO)::
+Another solution is to get it from the git repository::
+ $ cd $INSTALL_PATH
$ git clone git://www.peacefrogs.net/git/papillon
$ cd papillon
$ git tag -l # list tagged versions
@@ -60,18 +69,18 @@ Install the sources
If necessary unpack then move the sources in a directory readable to the apache user (www-data in Debian)::
- sudo mkdir /var/local/django
- cd /var/local/django
- sudo tar xvjf /home/etienne/papillon-last.tar.bz2
- cd /var/local/django/papillon
- sudo chown -R etienne:www-data papillon
+ $ cd $INSTALL_PATH
+ $ sudo tar xvjf /home/etienne/papillon-last.tar.bz2
+ $ cd papillon
+ $ sudo chown -R etienne:www-data papillon
In your Papillon application directory create settings.py to fit to your configuration.
A base template is provided (settings.py.tpl). The main parameters to change are pointed here::
- $ cd /var/local/papillon/papillon/
- $ PAPILLON_DIR=`pwd`
+ $ cd $INSTALL_PATH
+ $ cd papillon/papillon
+ $ PAPILLON_PATH=`pwd`
$ cp settings.py.tpl settings.py
$ nano settings.py
####
@@ -98,10 +107,11 @@ A base template is provided (settings.py.tpl). The main parameters to change are
ADMIN_MEDIA_PREFIX = '/media/'
(...)
-If your papillon is going to be used by many people, it is recommanded to use a "real" database like mysql or postgresql.
+If your Papillon is going to be used by many people, it is recommanded to use a "real" database like mysql or postgresql.
In the directory Papillon, put up a symbolic link to the basic styles django (change the path depending on your installation of django)::
+ $ cd $PAPILLON_PATH
$ ln -s /usr/share/python-support/python-django/django/contrib/admin/media/ .
@@ -109,29 +119,34 @@ Database initialisation
-----------------------
In the directory Papillon simply::
+ $ cd $PAPILLON_PATH
$ ./manage.py syncdb
Answer the questions to create an administrator (administration pages can be found at: http://where_is_papillon/admin) then::
+ $ cd $PAPILLON_PATH
$ ./manage.py migrate polls
If you use sqlite (default database) give the write rights on the database file to the apache user::
+ $ cd $PAPILLON_PATH
$ chmod g+w papillon.db
$ chmod g+w .
Compiling languages
-------------------
-If your language is available in the locale directory of Papillon, you will just need to get it compiled. Still being in the papillon 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 Papillon, you will just need to get it compiled. Still being in the Papillon directory, this can be done with (here, "de" stands for german. Replace it with the appropriate language code)::
- django-admin compilemessages -l de
+ $ cd $PAPILLON_PATH
+ $ django-admin compilemessages -l de
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)::
- django-admin makemessages -l de
+ $ cd $PAPILLON_PATH
+ $ django-admin makemessages -l de
There should now be a django.po file in locale/de/LC_MESSAGES. Complete it with your translation.
@@ -143,48 +158,61 @@ Webserver configuration
Only Apache configuration is given. Papillon can probably be run on other
webserver feel free to complete this documentation.
-Apache mod_python configuration
-*******************************
+Apache configuration
+********************
-Create and edit a configuration file for Papillon::
+Three configuration files are provided:
- sudo vim /etc/apache2/sites-available/papillon
+ - apache-modpython.conf: for installation with mod_python on extra path
+ - apache-modpython-virtualhost.conf: for installation with mod_python on a virtual host
-Insert Apache directives for your installation::
+ - apache-wsgi.conf: for installation with WSGI on a virtual host
- # part of the address after the root of your site: EXTRA_URL
- <Location "/papillon/">
- # directory path to the father of the installation of Papillon
- PythonPath "['/var/local/django/papillon/'] + sys.path"
- SetHandler python-program
- PythonHandler django.core.handlers.modpython
- SetEnv DJANGO_SETTINGS_MODULE papillon.settings
- # set it to on or off if in test or production environment
- PythonDebug On
- # put differents interpreter names if you deploy several Papillon
- PythonInterpreter papillon
- </Location>
+WSGI is recommanded.
-Or if you want to use a virtual domain::
+Install with mod_python
++++++++++++++++++++++++
- <VirtualHost *:80>
- ServerName papillon.youdomain.net
- # directory path to the father of the installation of Papillon
- PythonPath "['/var/local/django/papillon/'] + sys.path"
- SetHandler python-program
- PythonHandler django.core.handlers.modpython
- SetEnv DJANGO_SETTINGS_MODULE papillon.settings
- # set it to on or off if in test or production environment
- PythonDebug On
- # put differents interpreter names if you deploy several Papillon
- PythonInterpreter papillon
- </VirtualHost>
+Install mod_python for apache::
+
+ $ sudo apt-get install libapache2-mod-python
+
+Copy and adapt the choosen configuration file for Papillon::
+
+ $ cd $INSTALL_PATH
+ $ sudo cp papillon/docs/conf/apache-modpython.conf /etc/apache2/sites-available/papillon
+ $ sudo nano /etc/apache2/sites-available/papillon
Active this site, reload Apache and now your Papillon "can fly"::
- sudo a2ensite papillon
- sudo /etc/init.d/apache2 reload
+ $ sudo a2ensite papillon
+ $ sudo /etc/init.d/apache2 reload
+
+Install with mod_wsgi
++++++++++++++++++++++++
+
+Install mod_wsgi for apache::
+
+ $ sudo apt-get install libapache2-mod-wsgi
+
+Copy and adapt the apache configuration file for Papillon::
+
+ $ cd $INSTALL_PATH
+ $ sudo cp papillon/docs/conf/apache-wsgi.conf /etc/apache2/sites-available/papillon
+ $ sudo nano /etc/apache2/sites-available/papillon
+
+Copy and adapt the wsgi configuration file for Papillon::
+
+ $ cd $INSTALL_PATH
+ $ sudo mkdir apache
+ $ sudo cp docs/conf/django.wsgi apache/
+ $ sudo nano apache2/django.wsgi
+
+Active this site, reload Apache and now your Papillon "can fly" (with WSGI wings)::
+
+ $ sudo a2ensite papillon
+ $ sudo /etc/init.d/apache2 reload
Post-installation