$ sudo mkdir -p /var/www/html/domain
$ wget https://github.com/flatpressblog/flatpress/archive/1.3.1.zip
$ unzip flatpress-1.3.1.zip
$ mv flatpress-1.3.1/* /var/www/html/domain
$ chown -R www-data:www-data /var/www/html/domain
$ chmod -R 775 /var/www/html/domain
$ nano /etc/nginx/conf.d/domain.conf
server {
listen 80;
server_name domain.com;
root /var/www/html/domain;
index index.php index.html index.htm;
error_log /var/log/nginx/domain_error.log;
access_log /var/log/nginx/domain_access.log;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
$ nginx -t
$ systemctl reload nginx
http://domain1.com
$ apt-get update --allow-releaseinfo-change -y $ apt-get install --reinstall ca-certificates -y $ apt-get upgrade -y $ apt-get install nano wget curl perl sudo -y $ sudo apt -y dist-upgrade $ sudo apt --purge autoremove -y $ sudo apt update && sudo apt upgrade -y $ apt -y purge Apache2* bind* exim* ufw firewalld libapache2-mod-php* $ adduser lighttpd $ adduser lighttpdsudo $ su - lighttpd $ exit 1. ============Install DB================ $ apt install mariadb-server mariadb-client -y $ systemctl start mariadb $ systemctl enable mariadb $ systemctl status mariadb $ mysql_secure_installation type y to set the root password $ mariadb -u rootexit; 2. ==========Install PHP================== $ sudo apt -y install php software-properties-common $ sudo apt -y install php-common php-mysql php-xml php-xmlrpc php-curl php-gd php-imagick php-cli php-fpm php-json php-imap php-mbstring php-opcache php-soap php-dev php-cgi php-zip php-intl php-bcmath php-pear $ sudo apt -y install libmcrypt-dev libreadline-dev mcrypt
$ sudo apt -y install php8.2 php8.2-fpm php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc php8.2-curl php8.2-gd php8.2-cli php8.2-dev php8.2-imap php8.2-mbstring php8.2-soap php8.2-zip php8.2-cgi
$ sudo apt -y install php7.4 php7.4-fpm php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc
$ sudo apt -y install php7.4-curl php7.4-gd php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring
$ sudo apt -y install php7.4-soap php7.4-zip php7.4-cgi
3. =============Install Lighttpd=======================
$ apt-get install lighttpd -y
$ systemctl start lighttpd
$ systemctl enable lighttpd
$ systemctl status lighttpd
go to http://your-server-ip
$ apt -y purge Apache2* bind* exim* ufw firewalld libapache2-mod-php*
**if it doesn't have space, check */var/cache/* and **/var/log(except Apache2)** clean crap!**
# if you want to use php-fpm; Use PHP-FPM service for PHP via FastCGI
$ sudo systemctl restart php8.2-fpm
$ sudo lighty-enable-mod fastcgi fastcgi-php-fpm
$ nano /etc/php/8.2/fpm/php.ini
uncomment
cgi.fix_pathinfo=1
$ sudo service lighttpd force-reload
$ sudo nano /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf
fastcgi.server += ( ".php" =>
((
"socket" => "/run/php/php8.2-fpm.sock",
"broken-scriptfilename" => "enable"
))
)
$ sudo systemctl restart lighttpd
$ sudo nano /var/www/html/test.php
http://your i.p/test.php
4. ============Lighttpd conf=====================================
$ nano /etc/lighttpd/lighttpd.conf
server.module += ("mod_rewrite")
server.document-root = "/home/lighttpd/" OR "/var/www/html/"
server.port = 80
server.bind = "72.12.5.10"
---//At the bottom of the file, add:---------
include "domain1.conf" //include "domain2.conf" and many more...
5. =========Making Website========================
# mkdir -p /home/lighttpd
# mkdir -p /home/lighttpd/domain1 OR "/var/www/html/domain1"
# mkdir -p /home/lighttpd/domain1/logs OR "/var/www/html/domain1/logs"
# nano /etc/lighttpd/domain1.conf and paste
$HTTP["host"] =~ "domain1\.com" {
server.document-root = "/home/lighttpd/domain1" OR "/var/www/html/domain1"
accesslog.filename = "/home/lighttpd/domain1/logs/access.log" OR "/var/www/html/domain1/logs"
}
# chown -R www-data:www-data /home/lighttpd/domain1 // don't forget!!!
OR chown -R www-data:www-data /var/www/html/domain1
# chmod -R 755 /home/lighttpd/domain OR chmod -R 755 /var/www/html/domain1
# systemctl restart lighttpd
6. =======Install Grav==============
$ wget https://getgrav.org/download/core/grav-admin/latest -O grav-admin.zip
$ unzip grav-admin.zip -d grav
$ mv grav grav2
$ mv grav2/grav-admin/ /var/www/html/grav
$ rm -rf grav2/
$ nano /etc/lighttpd/lighttpd.conf
add server.module += ("mod_rewrite")
at bottom add include "domain1.conf"
$ nano /etc/lighttpd/domain1.conf and paste
$HTTP["host"] =~ "domain1.com" {
server.document-root = "/var/www/html/grav"
accesslog.filename = "/var/www/html/grav/logs"
url.rewrite-if-not-file = ( "" => "/index.php" )
}
$ chown -R www-data:www-data /var/www/html/grav
$ chmod -R 755 /var/www/html/grav
$ systemctl restart lighttpd
7. =========Install Webmin===============
$ curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
$ sh setup-repos.sh
$ apt -y install webmin --install-recommends
( change port: $ sudo nano -w /etc/webmin/miniserv.conf )
Install ClassicPress
$ sudo mkdir -p /var/www/html/website1 $ wget https://github.com/ClassicPress/ClassicPress-release/archive/refs/tags/2.2.0.tar.gz $ tar xf 2.2.0.tar.gz $ mv ClassicPress-release-2.2.0/* /var/www/html/domain $ nano /etc/nginx/sites-available/domain.conf server { listen 80; server_name domain.com; root /var/www/html/domain; index index.php index.html; location / { index index.php index.html index.htm; try_files $uri $uri/ =404; } location ~* \.php$ { fastcgi_pass unix:/run/php/php8.2-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; include snippets/fastcgi-php.conf; } } $ ln -s /etc/nginx/sites-available/domain.conf /etc/nginx/sites-enabled/ $ sudo nginx -t $ sudo systemctl restart nginx $ systemctl restart nginx $ cd /var/www/html/domain $ cp wp-config-sample.php wp-config.php $ nano wp-config.php $ chown -R www-data:www-data /var/www/html/domain $ chmod -R 755 /var/www/html/domain $ sudo rm /etc/nginx/sites-enabled/default $ sudo rm /etc/nginx/sites-available/default $ sudo nginx -t $ sudo systemctl restart nginx http://domain1.com
Install HTMLY
$ sudo mkdir -p /var/www/html/domain $ wget https://github.com/danpros/htmly/archive/refs/tags/v3.0.1.tar.gz $ tar xf v3.0.1.tar.gz $ mv htmly-3.0.1/* /var/www/html/domain $ sudo nano /etc/nginx/conf.d/domain.conf server { listen 80; server_name domain.com; root /var/www/html/domain; index index.php index.html; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; # Block access to .ini files. Important. location ~\.(ini)$ { deny all; return 404; } location / { try_files $uri $uri/ /index.php?$args; } location ~ .php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } $ sudo nginx -t $ sudo systemctl restart nginx OR $ sudo mkdir -p /var/www/html/website1 $ sudo cd /var/www/html/website1 $ wget https://github.com/danpros/htmly/releases/download/v3.0.1/online-installer.php http://domain/online-installer.php
Install PhpMyAdmin with Domain
$ sudo apt -y install phpmyadmin $ ln -s /usr/share/phpmyadmin /var/www/html $ cd /var/www/html/phpmyadmin $ sudo cp config.sample.inc.php config.inc.php $ sudo nano config.inc.php $cfg['blowfish_secret'] = ''; $ chown -R www-data:www-data /var/www/html/phpmyadmin $ chmod -R 755 /var/www/html/phpmyadmin sudo rm -rf /var/www/html/phpmyadmin/setup $ nano /etc/nginx/conf.d/domain.conf // this is in conf.d not sites_available server { listen 80; server_name Domain; root /var/www/html/phpmyadmin; index index.php index.html index.htm; error_log /var/log/nginx/phpmyadmin_error.log; access_log /var/log/nginx/phpmyadmin_access.log; client_max_body_size 100M; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } $ rm /etc/nginx/sites-enabled/default $ rm /etc/nginx/sites-available/default $ nginx -t $ systemctl reload nginx http://domain1.com =====Un-install Phpmyadmin======= sudo apt-get remove phpmyadmin sudo apt-get purge phpmyadmin sudo apt-get autoremove sudo rm -rf /usr/share/phpmyadmin sudo systemctl restart nginx sudo rm -rf /etc/phpmyadmin/ sudo apt -y autoremove
Install Bludit CMS
$ wget https://www.bludit.com/releases/bludit-3-16-2.zip $ unzip bludit-3-16-2.zip $ mv bludit-3-16-2 /var/www/html/domain $ chown -R www-data:www-data /var/www/html/domain $ chmod -R 775 /var/www/html/domain $ sudo nano /etc/nginx/conf.d/domain.conf server { listen 80; server_name domain.com; root /var/www/html/domain; index index.php; location ~ \.php$ { fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_index index.php; include fastcgi.conf; } location / { try_files $uri $uri/ /index.php?$args; } location ^~ /bl-content/tmp/ { deny all; } location ^~ /bl-content/pages/ { deny all; } location ^~ /bl-content/databases/ { deny all; } } $ ln -s /etc/nginx/sites-available/domain.conf /etc/nginx/sites-enabled/ $ nginx -t $ systemctl restart nginx http://domain
Install PluXml
$ sudo mkdir -p /var/www/html/domain $ wget https://pluxml.org/download/pluxml-latest.zip $ unzip pluxml-latest.zip $ mv PluXml-5.8.16/* /var/www/html/domain $ chown -R www-data:www-data /var/www/html/domain $ chmod -R 775 /var/www/html/domain $ nano /etc/nginx/conf.d/domain.conf server { listen 80; server_name domain.com; root /var/www/html/domain; index index.php index.html index.htm; error_log /var/log/nginx/domain_error.log; access_log /var/log/nginx/domain_access.log; client_max_body_size 100M; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } $ nginx -t $ systemctl reload nginx http://domain1.com
Prerequisite
This page will install Ghost, Grave, Wordpress, Webmin, PhpMyAdmin with Nginx on Debian/Ubuntu. Check sourcelist first, make sure it has backports; $ sudo apt update && sudo apt upgrade -y $ sudo apt install curl software-properties-common apt-transport-https ca-certificates gnupg2 -yInstall NodeJs, npm
$ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - $ sudo apt install nodejs -y $ node --version $ npm --versionInstall UFW
$ sudo apt install ufw -y $ sudo ufw allow ssh $ sudo ufw allow http $ sudo ufw allow https $ sudo ufw enable
Install DB
$ apt install mariadb-server mariadb-client -y $ systemctl start mariadb $ systemctl status mariadb $ systemctl enable mariadb $ sudo mysql_secure_installation
Install Nginx
$ sudo apt install nginx -y $ sudo systemctl start nginx $ sudo systemctl enable nginx $ sudo nano /etc/nginx/sites-enabled/default -------------------------------------------- server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /var/www/html; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; } }
Install Webmin
$ sudo chown www-data:www-data /var/www/html $ curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh $ sh setup-repos.sh $ apt -y install webmin --install-recommends ( change port: $ sudo nano -w /etc/webmin/miniserv.conf )
Install Ghost
$ adduser nginx $ adduser nginx sudo $ su - nginx $ exit $ sudo mysql -u root -p CREATE DATABASE ghostbuster; CREATE USER 'ghostadmin'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON ghostbuster.* TO 'ghostadmin'@'localhost'; FLUSH PRIVILEGES; EXIT; $ sudo mkdir -p /var/www/html/ghost $ sudo chown www-data:www-data /var/www/html/ghost $ chmod 775 /var/www/html/ghost // do this x3 or go to webmin Install Ghost-Cli $ sudo su - nginx $ sudo npm install ghost-cli@latest -g $ ghost --version $ cd /var/www/html/ghost ---- > ghost install Blog URL (e.g., https://yourdomain.com) MySQL hostname (localhost) MySQL username and password (created earlier) Ghost database name (ghostdb) The installer will set up Ghost and its dependencies automatically.
$ apt -y purge Apache2* bind* exim* ufw firewalld libapache2-mod-php* postfix
Install PHP
$ sudo apt -y install php php-common php-mysql php-xml php-xmlrpc php-curl php-gd php-imagick php-cli php-fpm php-json php-imap php-mbstring php-opcache php-soap php-dev php-cgi php-zip php-intl php-bcmath php-pear $ sudo apt -y install libmcrypt-dev libreadline-dev mcrypt zip unzip php-zip php-tokenizer
Configuring Nginx for Ghost
$ sudo nano /etc/nginx/sites-available/ghost.conf
server {
listen 80;
server_name yourdomain.com;
root /var/www/html/ghost;
index index.php index.html index.htm;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
client_max_body_size 50m;
}
$ sudo ln -s /etc/nginx/sites-available/ghost.conf /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl restart nginx
============================================
Securing Ghost with SSL/TLS
$ sudo apt install certbot python3-certbot-nginx -y
$ sudo certbot --nginx -d yourdomain.com
================================================
$ ghost start # Start Ghost
$ ghost stop # Stop Ghost
$ ghost restart # Restart Ghost
$ ghost status # Check Ghost status
$ sudo systemctl enable ghost_yourdomain-com
=================================================
Troubleshooting Common Issues
1. Permission Problems
$ sudo chown -R nginx:nginx /var/www/ghost
$ sudo find /var/www/html/ghost -type d -exec chmod 775 {} \;
$ sudo find /var/www/html/ghost -type f -exec chmod 664 {} \;
2. Database Connection Issues
sudo systemctl status mysql
$ mysql -u ghostadmin -p -e "USE ghostbuster; SHOW TABLES;"
3. Nginx Configuration Errors
$ sudo tail -f /var/log/nginx/error.log
$ sudo nginx -t
Install Grav
$ cd /var/www/html $ sudo wget https://getgrav.org/download/core/grav-admin/1.7.48 $ sudo unzip 1.7.48 $ sudo mv grav-admin grav $ sudo chown -R www-data:www-data /var/www/html/grav $ sudo nano /etc/nginx/conf.d/grav.conf server { listen 80; server_name grav.example.com; root /var/www/html/grav; index index.html index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; } location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; } } $ sudo nginx -t $ sudo systemctl restart nginx $ sudo systemctl status nginx If any issues with the scheduler in Grav, run the following command: $ sudo crontab -u www-data -e And add this line to the bottom of the file: cd /var/www/html/grav;/usr/bin/php bin/grav scheduler 1>> /dev/null 2>&1
Install WordPress
$ curl -L -O http://wordpress.org/latest.tar.gz $ tar xf latest.tar.gz $ mv wordpress/* /var/www/html/domain $ nano /etc/nginx/sites-available/domain.conf server { listen 80; server_name domain.com; root /var/www/html/domain; index index.php index.html; location / { index index.php index.html index.htm; try_files $uri $uri/ =404; } location ~* \.php$ { fastcgi_pass unix:/run/php/php8.2-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; include snippets/fastcgi-php.conf; } } $ ln -s /etc/nginx/sites-available/domain.conf /etc/nginx/sites-enabled/ $ sudo nginx -t $ systemctl restart nginx $ cp /var/www/html/domain/wp-config-sample.php /var/www/html/domain/wp-config.php $ nano /var/www/html/domain/wp-config.php Insert db name, passwd, localhost $ chown -R www-data:www-data /var/www/html/domain $ chmod -R 755 /var/www/html/domain $ sudo rm /etc/nginx/sites-enabled/default $ sudo rm /etc/nginx/sites-available/default $ sudo nginx -t http://domain1.com
OR
$ wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz
$ tar -xzvf /tmp/wordpress.tar.gz -C /var/www/html
$ chown -R www-data:www-data /var/www/html/wordpress
$ chmod -R 755 /var/www/html/wordpress
Create a Virtual Host (Server Blocks) for WordPress website on the Nginx server.
$ nano /etc/nginx/conf.d/wordpress.conf
Add the content to file.
server {
listen 80;
listen [::]:80;
server_name website1.com;
root /var/www/html/wordpress;
index index.php index.html index.htm;
error_log /var/log/nginx/wordpress_error.log;
access_log /var/log/nginx/wordpres_access.log;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
$ sudo nginx -t
$ systemctl restart nginx
Install Composer
$ curl -sS https://getcomposer.org/installer | php $ sudo mv composer.phar /usr/local/bin/composer $ sudo chmod +x /usr/local $ bin/composer $ composer $ sudo nginx -t $ sudo systemctl reload nginx
Install, PHP, DB, Caddy first.
$ adduser caddy
$ adduser caddy sudo
$ su - caddy
$ exit
$ cd /usr/share/caddy
$ sudo wget https://getgrav.org/download/core/grav-admin/1.7.48
$ sudo unzip 1.7.48
$ sudo mv grav-admin grav
$ sudo chown -R $USER:$USER /usr/share/caddy/grav
$ nano /etc/caddy/Caddyfile
your_domain:80 {
tls xxx@xxx.com
root * /usr/share/caddy/grav
file_server
encode zstd gzip
php_fastcgi unix//run/php/php8.2-fpm.sock
# Begin - Security
# deny all direct access for these folders
rewrite /(\.git|cache|bin|logs|backups|tests)/.* /403
# deny running scripts inside core system folders
rewrite /(system|vendor)/.*\.(txt|xml|md|html|htm|shtml|shtm|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ /403
# deny running scripts inside user folder
rewrite /user/.*\.(txt|md|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ /403
# deny access to specific files in the root folder
rewrite /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) /403
respond /403 403
## End - Security
# global rewrite should come last.
try_files {path} {path}/ /index.php?_url={uri}&{query}
log {
output file /var/log/caddy/access.log
format console
}
}
$ sudo systemctl restart caddy
$ curl -L -O http://wordpress.org/latest.tar.gz
$ tar xf latest.tar.gz
$ mv wordpress/* /var/www/html/domain
$ nano /etc/nginx/sites-available/domain.conf
server {
listen 80;
server_name domain.com;
root /var/www/html/domain;
index index.php index.html;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ =404;
}
location ~* \.php$ {
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include snippets/fastcgi-php.conf;
}
}
$ ln -s /etc/nginx/sites-available/domain.conf /etc/nginx/sites-enabled/
$ sudo nginx -t
$ systemctl restart nginx
$ cp /var/www/html/domain/wp-config-sample.php /var/www/html/domain/wp-config.php
$ nano /var/www/html/domain/wp-config.php
Insert db name, passwd, localhost
$ chown -R www-data:www-data /var/www/html/domain
$ chmod -R 755 /var/www/html/domain
$ sudo rm /etc/nginx/sites-enabled/default
$ sudo rm /etc/nginx/sites-available/default
$ sudo nginx -t
http://domain1.com
=OR==
$ wget -O /tmp/wordpress.tar.gz https://wordpress.org/latest.tar.gz
$ tar -xzvf /tmp/wordpress.tar.gz -C /var/www/html
$ chown -R www-data:www-data /var/www/html/wordpress
$ chmod -R 755 /var/www/html/wordpress
Create a Virtual Host (Server Blocks) for WordPress website on the Nginx server.
$ nano /etc/nginx/conf.d/wordpress.conf
Add the content to file.
server {
listen 80;
listen [::]:80;
server_name website1.com;
root /var/www/html/wordpress;
index index.php index.html index.htm;
error_log /var/log/nginx/wordpress_error.log;
access_log /var/log/nginx/wordpres_access.log;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
$ sudo nginx -t
$ systemctl restart nginx