Skip to content

Instantly share code, notes, and snippets.

@ahmeti
Last active Jul 18, 2021
Embed
What would you like to do?
# Şifreli Giriş İçin
sudo adduser **USERNAME**
# Şifresiz Giriş SSH İçin
sudo adduser **USERNAME** --disabled-password
sudo su **USERNAME**
cd ~/
mkdir site1.com
cd site1.com
mkdir public
# PHP 7
sudo nano /etc/php/7.2/fpm/pool.d/**USERNAME**.conf
# PHP 8
sudo nano /etc/php/8.0/fpm/pool.d/**USERNAME**.conf
[**USERNAME**]
user = **USERNAME**
group = **USERNAME**
listen = /var/run/php7.2-fpm-**USERNAME**.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /
# PHP 8
listen = /run/php/php8.0-fpm-**USERNAME**.sock
nano /etc/nginx/sites-available/**USERNAME**
# HTTPS site için
server {
listen 443;
root /home/**USERNAME**/site1.com/public;
index index.php index.html;
server_name site1.com;
ssl on;
ssl_certificate /home/**USERNAME**/certificates/site1.com.crt;
ssl_certificate_key /home/**USERNAME**/certificates/site1.com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php7.2-fpm-**USERNAME**.sock;
}
}
# HTTP site için
server {
listen 80;
root /home/**USERNAME**/site1.com/public;
index index.php index.html;
server_name site1.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php7.2-fpm-**USERNAME**.sock;
}
}
sudo ln -s /etc/nginx/sites-available/**USERNAME** /etc/nginx/sites-enabled/
service php7.2-fpm restart
service nginx restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment