kuvia/docs/setup-server.md
2021-01-15 02:10:48 +01:00

1.6 KiB

Basic Tools

apt-get install -y git

NGINX

apt-get install -y nginx

PHP (Ubuntu 20.04)

apt install -y php-fpm php-cli php-simplexml php-mbstring php-gd php-mysql unzip php-zip

Install Composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/bin --filename=composer
php -r "unlink('composer-setup.php');" 

Setup MYSQL

apt-get install -y mysql-server
mysql_secure_installation
mysql_secure_installation

Run the following mysql commands

CREATE DATABASE kuvia;
CREATE USER 'kuvia'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL ON kuvia.* TO 'kuvia'@'localhost';
FLUSH PRIVILEGES;
GRANT ALL ON kuvia.* TO 'kuvia'@'%';

Setup Project

cd /var/www
git clone https://git.keks.cloud/kekskurse/kuvia.git
cd kuvia
composer install

Setup .env

Setup env

Setup nginx config

/etc/nginx/sites-available/kuvia

server {
    listen 80;
    server_name kuvia.cloud www.kuvia.cloud;
    root /var/www/kuvia/public;

    index index.html index.htm index.php;
    client_max_body_size 100M;

    location / {
            try_files $uri $uri/ /index.php?$query_string;
     }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
     }

    location ~ /\.ht {
        deny all;
    }
}

run

ln -s /etc/nginx/sites-available/kuvia /etc/nginx/sites-enabled/
systemctl restart nginx

Setup php

set upload_max_filesize and post_max_size to 100M in php.ini