spip #8

Description

SPIP is a publishing system for the Internet in which great importance
is attached to collaborative working, to multilingual environments,
and to simplicity of use for web authors. SPIP's benefit consists in:
* managing a magazine type site i.e. made up mainly of articles and
news items inserted in an arborescence of sections nested in each
others. * completely separating and distributing three kinds of tasks
over various players: the graphic design, the site editorial input
through the submission of articles and news items and the site
editorial management. * spare the webmaster and all the participants
to the life of the site, a number of tedious aspects of web
publishing as well as the need to learn lengthy technical skills.
SPIP allows you to start creating your sections and articles
straight away.


Overview

This charm provides a SPIP service from http://www.spip.net/.
Spip is a publication blog plateform.

Usage

Simple deployment:

   juju deploy mysql
   juju deploy spip
   juju add-relation mysql spip
   juju expose spip

One box deployment:

juju deploy mysql
jitsu deploy-to <id of mysql> spip
juju add-relation mysql spip
juju expose spip

Associate a floating ip to the spip service.

With a web browser, go to http://your.spip.service.ip/spip/ecrire
Select your site's language and click on Next.
The "Connection to your database" Step 1 has already be performed by the charm, click on Next.
Do not change the "prefix" setting on the "Choosing your database" Step 2, just click on Next.
Fill the form related to your personal information on Step 3, then click on Next.
The step 4 may takes some time to run. If it fail, go back to http://your.spip.service.ip/spip/ecrire
and perform the same steps.
If everything worked all right, you should end up on a page with the following message:

Done!

SPIP is now ready for use

You still have to click on the "private area" area button.
Even if you experience an error message, the spip site should be installed.

The public site is available at http://your.spip.service.ip/spip/
The admin site is available at http://your.spip.service.ip/spip/ecrire

Load balancing deployement:

There are still several problems to cope with when using Spip behind a load balancer:

  • some directories will be shared on a nfs mount point (IMG, plugins and squelettes).
    As each spip server is unaware of the others, things may not work as expected if two
    spip machine try to write concurrently on the same data (by example, trying to upload
    two images at the same time).

  • Authentication. Each spip server is using some cookies to authenticate users.
    As each server generate its own set of cookies, any access requiring an authentication
    may result in generating a new login prompt each time a new Spip server is involved.

If spip was using session to manage authentication, a solution could be to use memcached,
however, this does not seems to be the case (even with a php.ini configured to use a
share memcached server for the session, several authentication prompt happens).

To workaround this problem, cookie authentication is disabled by default in the db-relation-changed
hook by setting ignore_remote_user to true in /var/www/spip/config/mes_options.php.

This way, the authentication is based on a simple http auth protocol.

Even then, you will have to authenticate at least once on each real SPIP server added
as a unit to the spip service.

Prepare a spip.yaml with the following content:

haproxy:
default_timeouts: "queue 7000, connect 7000, client 7000, server 7000"
services: |
- service_name: haproxy_service
service_host: "0.0.0.0"
service_port: 80
service_options: [balance leastconn , appsession spip_session len 34 timeout 3h request-learn]
server_options: maxconn 100
spip:
spip-origin: 3.0.5

Use space, not tabs.
Then deploy things with:

 juju deploy nfs
 juju deploy mysql
 juju deploy --config=spip.yaml spip
 juju deploy --config=spip.yaml haproxy

 juju add-relation spip mysql
 juju add-relation nfs spip:nfs
 juju add-relation spip haproxy

 juju expose haproxy

Associate a floating ip to the haproxy service.

With a web browser, go to http://your.haproxy.service.ip/spip/ecrire
Select your site's language and click on Next.
The "Connection to your database" Step 1 has already be performed by the charm, click on Next.
Do not change the "prefix" setting on the "Choosing your database" Step 2, just click on Next.
Fill the form related to your personal information on Step 3, then click on Next.
The step 4 may takes some time to run. If it fail, go back to http://your.haproxy.service.ip/spip/ecrire
and perform the same steps.
If everything worked all right, you should end up on a page with the following message:

Done!

SPIP is now ready for use

You still have to click on the "private area" area button.
Even if you experience an error message, the spip site should be installed.

The public site is available at http://your.spip.service.ip/spip/
The admin site is available at http://your.spip.service.ip/spip/ecrire

Now, you can add some spip unit (here 5 new units):

juju add-unit -n 5 spip

Configuration

By default, the charm deploy the packaged version of spip.
If you want to deploy another version, use spip-origin. The only current value is 3.0.5

By example, create a spip.cfg file with the following content:

spip:
spip-origin: 3.0.5

And deploy the charm with:

juju deploy --config=spip.cfg spip

Contact Information

Author: Pierre Amadio pierre.amadio@canonical.com
Report bugs at: http://bugs.launchpad.net/charms
Location: http://jujucharms.com

Configuration

spip-origin
(string) Where to get the sources of spip from. distro (default): from apt-get 3.0.5 : upstream http://files.spip.org/spip/stable/spip-3.0.zip?1352900441
distro