- GhostBSD 24.04.1 (커널 FreeBSD 14.0-STABLE GENERIC amd64 / Mate 1.28.1)
# dependencies
sudo pkg upgrade
sudo pkg update
## nginx
sudo pkg install nginx-full
## nginx 웹서버 활성화
sudo nano /etc/rc.conf
nginx_enabl="YES" # 저장
sudo service nginx start
## mariadb
sudo pkg install mariadb1011-server
## mariadb 서버 활성화
sudo nano /etc/rc.conf
mysql_enable="YES" # 저장
sudo chown -R mysql:mysql /var/db/mysql
sudo chmod 755 /var/db/mysql
sudo service mysql-server start
### mariadb setting
sudo mysql_secure_installation
## php-fpm는 php에 내장되어 있음
sudo pkg install php82-mysqli php82-xml php82-mbstring php82-gd php82-intl php82-ldap php82-zip php82-imap php82-pear php82-zlib php82-curl php82-fileinfo php82-pdo_mysql
sudo nano /etc/rc.conf
php_fpm_enable="YES" #추가
sudo service php-fpm start
### php check
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/phpinfo.php
http://localhost
sudo nano /usr/local/etc/nginx/nginx.conf로 설정파일을 수정합니다:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root /usr/local/www/nginx-dist;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
# 파일 업로드 크기 제한 설정 (필요한 경우)
client_max_body_size 20M;
# 정적 파일 캐싱 설정 (선택사항)
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 30d;
}
}
}
# limesurvey
## download
cd /tmp
sudo fetch https://download.limesurvey.org/latest-master/limesurvey6.6.0+240729.zip
# https://community.limesurvey.org/downloads/ 에서 <Download> 링크를 복사해서 붙여주세요.
sudo unzip limesurvey6.6.0+240729.zip
sudo mv limesurvey /usr/local/www/nginx-dist/
## directory/file ownership
sudo chown -R www:www /usr/local/www/nginx-dist/limesurvey/
sudo chmod -R 755 /usr/local/www/nginx-dist/limesurvey/tmp
sudo chmod -R 755 /usr/local/www/nginx-dist/limesurvey/upload
sudo chmod -R 755 /usr/local/www/nginx-dist/limesurvey/application/config
limesurvey download --> https://community.limesurvey.org/downloads/
## database setting for limesurvey
sudo mysql -u root -p
CREATE DATABASE limesurvey;
CREATE USER 'limesurvey'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON limesurvey.* TO 'limesurvey'@'localhost';
FLUSH PRIVILEGES;
EXIT;
/etc/nginx/sites-available/default 파일에 적용해주세요:
sudo nano /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\.ht {
deny all;
}
# LimeSurvey specific location
location /limesurvey {
try_files $uri $uri/ /limesurvey/index.php?$query_string;
}
}
sudo nginx -t
sudo systemctl restart nginx
http://localhost/limesurvey/admin
# update setting nginx server
sudo systemctl restart nginx
출처: http://modernity.tistory.com/entry/Limesurvey-Self-Installation-2-Nginx와-함께 [FOSSER_Ricoop:티스토리]
'BSD > FreeBSD' 카테고리의 다른 글
freebsd 14.1 설치 (0) | 2024.06.24 |
---|---|
freebsd 14.1 설치 (0) | 2024.06.22 |
FreeBSD12.0 설치에 관한 단상(1) (0) | 2019.01.23 |
xfce (+ nvidia ) 설치 회고 (0) | 2018.10.15 |
FreeBSD 11.2 설치 즈음의 회고 (0) | 2018.10.14 |