sudo apt update
sudo apt install nginx
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql -u root -p
CREATE DATABASE limesurvey_db;
CREATE USER 'root'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON limesurvey_db.* TO 'root'@'localhost';
FLUSH PRIVILEGES;
exit
sudo add-apt-repository ppa:ondrej/php
sudo apt install php8.1-fpm php8.1-mysql php8.1-curl php8.1-gd php8.1-mbstring php8.1-xml php8.1-zip php8.1-imap
cd /var/www/html
sudo wget https://download.limesurvey.org/latest-master/limesurvey6.2.8+230921.zip -O limesurvey.zip
sudo apt-get install unzip
sudo unzip limesurvey.zip
sudo mv limesurvey limesurvey.example.com
sudo rm limesurvey.zip
sudo chmod -R 777 /var/www/html/limesurvey.example.com/tmp
sudo chmod -R 777 /var/www/html/limesurvey.example.com/upload
sudo chmod -R 777 /var/www/html/limesurvey.example.com/application/config
sudo vi /etc/nginx/sites-available/limesurvey
sudo ln -s /etc/nginx/sites-available/limesurvey /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
Nginx config
server {
listen 80;
server_name limesurvey.example.com www.limesurvey.example.com;
root /var/www/html/limesurvey.example.com;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
sudo apt install certbot python3-certbot-nginx
certbot --nginx -d limesurvey.example.com -d www.limesurvey.example.com -m example@gmail.com --non-interactive --agree-tos