LimeSurvey

LimeSurvey is a free and open source survey web application.


Note

For this guide you should be familiar with the basic concepts of

License

LimeSurvey software is licenced under the GPLv2.

Prerequisites

We’re using PHP in the stable version 8.1:

[isabell@stardust ~]$ uberspace tools version show php
Using 'PHP' version: '8.1'
[isabell@stardust ~]$

You’ll need your MySQL credentials. Get them with my_print_defaults:

[isabell@stardust ~]$ my_print_defaults client
--default-character-set=utf8mb4
--user=isabell
--password=MySuperSecretPassword
[isabell@stardust ~]$

Your survey URL needs to be setup:

[isabell@stardust ~]$ uberspace web domain list
isabell.uber.space
[isabell@stardust ~]$

Installation

Download archive

Visit LimeSurvey’s community downloads page and copy the .zip download link. Then, cd to your DocumentRoot and use wget to download the file. Make sure to replace the dummy URL with the one you just copied.

[isabell@stardust ~]$ cd /var/www/virtual/$USER/
[isabell@stardust html]$ wget -O limesurvey.zip https://download.limesurvey.org/latest-stable-release/limesurvey5.4.10+221107.zip
[...]
2022-11-09 12:39:03 (16,1 MB/s) - »limesurvey.zip« saved [84075454/84075454]
[isabell@stardust html]$

Extract archive

[isabell@stardust isabell]$ unzip limesurvey.zip
[…]
 inflating: limesurvey/upload/twig/extensions/HelloWorld_Twig_Extension/README.md
 inflating: limesurvey/upload/twig/extensions/README.md
[isabell@stardust isabell]$

Remove old html directory and rename the extracted directory

[isabell@stardust isabell]$ rm -f html/nocontent.html; rmdir html
[isabell@stardust isabell]$ mv limesurvey html
[isabell@stardust isabell]$

Configuration

Point your browser to your domain (e.g. https://isabell.uber.space) and use the installer to set up your database and admin user account.

We recommend to use a new database such as isabell_limesurvey for LimeSurvey.

Edit .htaccess

The default .htaccess includes a RewriteCond so that existing directories won’t be rewritten, but for some reason it is commented out:

#RewriteCond %{REQUEST_FILENAME} !-d

Edit the .htaccess file and uncomment the line above, so the full .htaccess file should look like this:

<IfModule mod_rewrite.c>
    RewriteEngine on

    # if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # otherwise forward it to index.php
    RewriteRule . index.php

    # deny access to hidden files and directories except .well-known
    RewriteCond %{REQUEST_URI} !^/\.well-known
    RewriteRule ^(.*/)?\.+ - [F]
</IfModule>

# deny access to hidden files and directories without mod_rewrite
RedirectMatch 403 ^/(?!\.well-known/)(.*/)?\.+

# General setting to properly handle LimeSurvey paths
# AcceptPathInfo on

Best practices

Updates

Note

Check the update feed regularly to stay informed about the newest version.

When a new version is released, copy the download link and download it as above, but exclude /application/config/config.php and /upload/* when extracting the archive.

[isabell@stardust ~]$ cd /var/www/virtual/$USER/html/
[isabell@stardust html]$ wget -O limesurvey.tar.gz https://www.limesurvey.org/stable-release?download=4711:limesurvey4711%20180926targz
[isabell@stardust html]$ tar -xzf limesurvey.tar.gz --strip-components=1 --overwrite  --exclude '/application/config/config.php' --exclude '/upload/*'
[isabell@stardust html]$

Tested with LimeSurvey 5.4.10, Uberspace 7.13.0, and PHP 8.1

Written by: Nico Graf <hallo@uberspace.de>