kuvia/docs/setup-server.md
2021-01-12 19:05:03 +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 php-simplexml php-mbstring php-gd php-mysql 

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;

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 www1.kuvia.cloud www1.kuvia.cloud www2.kuvia.cloud www3.kuvia.cloud www4.kuvia.cloud www5.kuvia.cloud www6.kuvia.cloud www7.kuvia.cloud www8.kuvia.cloud www9.kuvia.cloud;
    root /var/www/kuvia/public;

    index index.html index.htm index.php;

    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