maart 10, 2021

Limesurvey on ubuntu

Install Limesurvey open source survey software on ubuntu 20.04

Lamp server

sudo apt-get update
sudo apt-get install apache2 mariadb-server -y
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.2 php7.2-cli php7.2-common php7.2-mbstring php7.2-xml php7.2-mysql php7.2-gd php7.2-zip php7.2-ldap php7.2-imap unzip wget curl
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mysql
sudo systemctl enable mysql

Configure MySql database

sudo mysql_secure_installation
Enter current password for root (enter for none):
Set root password? [Y/n]: N 
Remove anonymous users? [Y/n]: Y 
Disallow root login remotely? [Y/n]: Y 
Remove test database and access to it? [Y/n]:  Y 
Reload privilege tables now? [Y/n]:  Y
mysql -u root -p
-MariaDB [(none)]>CREATE DATABASE limesurvey_db;MariaDB [(none)]>GRANT ALL PRIVILEGES ON limesurvey_db.* TO 'limesurvey_user'@'localhost' IDENTIFIED BY 'password';MariaDB [(none)]>FLUSH PRIVILEGES;MariaDB [(none)]>\q

Download Limesurvey

wget https://download.limesurvey.org/lts-releases/limesurvey3.25.17+210309.zip
sudo apt-get install unzip
unzip limesurvey3.25.17+210309.zip -d /var/www/html/
sudo chown www-data:www-data -R /var/www/html/limesurvey/
sudo nano /etc/apache2/sites-available/limesurvey.conf

Add the following lines:

<VirtualHost *:80> 
ServerAdmin admin@example.com
DocumentRoot /var/www/html/limesurvey/ 
ServerName example.com 
<Directory /var/www/html/limesurvey/> 
Options FollowSymLinks 
AllowOverride All 
</Directory> 
ErrorLog /var/log/apache2/lime-error_log 
CustomLog /var/log/apache2/lime-access_log common 
</VirtualHost>
sudo a2ensite limesurvey
sudo systemctl restart apache2

Go to ip-address of the server and add / limesurvey/admin after the address