New charm (Limesurvey)

Bug #899849 reported by Nick Barcet
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charms Collection
Fix Released
Nick Barcet

Bug Description

I've created a charm for limesurvey. Please review.

Tags: new-charm

Related branches

Nick Barcet (nijaba)
description: updated
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Nick! Thanks, this is great! It deploys as the readme suggests, and I was able to add-unit without errors, though load balancing was not working (see below).

There is one blocking change needed before it can be official.

You need to cryptographically verify the source of the php5-zip extension and limesurvey itself.

I'd suggest using charm-helpers, like this:

add-apt-repository ppa:charmers/charm-helpers
apt-get update
apt-get install charm-helper-sh

. /usr/share/charm-helper/sh/
ch_get_file "xxxxxxxxxx"

where xxxxxx is the sha256sum of the file (works with sha1 or md5 too..)

And the same for the limesurvey file. You'll probably have to choose a specific version of limesurvey so that you can embed the md5sum. If you want it to be dynamic and always get the latest limesurvey, you'll need an HTTPS source of hashes for the files, which I don't believe sourceforge or pecl offer unfortunately.

Some other stuff that is not a blocker for inclusion in lp:charm but need to be fixed at some point...


website-relation-joined, use `unit-get private-address` instead of `hostname -f`. `hostname -f` is unreliable in many environments.


I think you'll have to make the rooturl a config option, though leaving it blank can probably safely be left as the public hostname of the instance. Otherwise load balancing more than one limesurvey will be impossible. It looks like the install guide recommends leaving this set to $SERVER['SERVER_NAME']. I'm not sure if this will work though.


When using ServerName/VirtualHost, you need to remove the default site, so that the nodes can be load balanced (its hard to predict which site Apache will choose as the "Default" virtualhost, so make it the only virtualhost). I deployed under a load balancer and got the "It Works!" page. a2dissite default should do the trick.


The session handler is, by default, file. You will want to add a peer relation that changes the session handler to 'db' when units are added so that load balancing works without persistence.


Next steps:

Once the first bug is fixed, just comment back here and we'll take another look. The others should either be fixed now, or added as bug reports once the charm is in lp:charm.


Changed in charm:
status: New → Incomplete
assignee: nobody → Nick Barcet (nijaba)
Revision history for this message
Nick Barcet (nijaba) wrote :

All 5 issues should now be fixed in the branch. Thanks a lot for your review :)

Changed in charm:
status: Incomplete → Confirmed
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Great job Nick! Charm is now in the official charm repo as 'lp:charm/limesurvey'

Tested with haproxy and 2 units, seems to work alright, siege w/ the default settings revealed problems, but I think they are probably due to our not-so-tuned haproxy settings.

Transactions: 3887 hits
Availability: 98.73 %
Elapsed time: 514.67 secs
Data transferred: 7.29 MB
Response time: 1.47 secs
Transaction rate: 7.55 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 11.11
Successful transactions: 3887
Failed transactions: 50
Longest transaction: 11.61
Shortest transaction: 0.30

My admin session would occasionally require re-authing, I don't know if thats by design or a weirdness in the app. Anyway, it worked great. I am going to open a bug to have the database table type to InnoDB, but I'm not going to fix that as I'd like for somebody to test it and make sure limesurvey works ok with it. One woudl need to change $databasetabletype in config.php to 'InnoDB'.

./config-defaults.php:$databasetabletype = 'myISAM'; // Storage engine mysql should use when creating survey results tables and token tables (if mysql is used). Default is myISAM.

Thanks again Nick!!

Changed in charm:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.