kuvia/docs/setup-server.md

92 lines
1.6 KiB
Markdown
Raw Normal View History

2021-01-12 16:50:08 +00:00
# Basic Tools
```
apt-get install -y git
```
# NGINX
```
apt-get install -y nginx
```
# PHP (Ubuntu 20.04)
```
2021-01-13 17:16:57 +00:00
apt install -y php-fpm php-cli php-simplexml php-mbstring php-gd php-mysql unzip php-zip
2021-01-12 16:50:08 +00:00
```
# 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;
```
2021-01-13 17:16:57 +00:00
```
GRANT ALL ON kuvia.* TO 'kuvia'@'%';
```
2021-01-12 16:50:08 +00:00
# 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;
2021-01-12 20:59:49 +00:00
server_name kuvia.cloud www.kuvia.cloud;
2021-01-12 16:50:08 +00:00
root /var/www/kuvia/public;
index index.html index.htm index.php;
2021-01-12 20:59:49 +00:00
client_max_body_size 100M;
2021-01-12 16:50:08 +00:00
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
```
2021-01-12 20:59:49 +00:00
# Setup php
set upload_max_filesize and post_max_size to 100M in php.ini