About

This is a brief description of yourself or your site, to change this text go to the admin panel, settings, plugins, and configure the plugin "about".

Static Pages

FlatPress with NGINX


$ 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

C.P, Htmly, Bludit, PhpMyAdmin with Nginx


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

Ghost, Wordpress, Grav, Webmin, w/ NGINX


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 -y

Install NodeJs, npm

$ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - $ sudo apt install nodejs -y $ node --version $ npm --version

Install 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

Belows are already installed by Ghost installer, but in case.

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

WordPress with Nginx



$ 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


L.E.M.P


Before anything begins; first thing first;

$ apt-get update --allow-releaseinfo-change
$ apt-get install --reinstall ca-certificates
$ apt-get upgrade -y
$ apt-get upgrade --fix-missing
$ apt-get install nano wget perl curl sudo -y
$ sudo apt -y dist-upgrade
$ sudo apt --purge autoremove
$ sudo apt update && sudo apt upgrade

$ adduser nginx
$ adduser nginx sudo
$ su - nginx
$ exit
$ apt -y purge Apache2* bind* exim* ufw firewalld libapache2-mod-php* postfix

Step 1. Install Nginx

$ sudo apt-get install nginx -y
$ systemctl start nginx
$ systemctl enable nginx
$ systemctl status nginx
  http://i.p address 
$ chown www-data:www-data /var/www/html -R

Step 2. Install DB

$ apt install mariadb-server mariadb-client -y
$ systemctl start mariadb
$ systemctl status mariadb
$ systemctl enable mariadb

$ mysql_secure_installation
  type y to set the root password
$ mariadb -u root
  exit;  

Step 3. 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 
$ sudo apt -y install php8.2-curl php8.2-gd php8.2-cli php8.2-dev php8.2-imap 
$ sudo apt -y install 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
$ apt -y purge Apache2* bind* exim* ufw firewalld libapache2-mod-php* postfix
$ sudo nano /etc/php/8.2/fpm/pool.d/www.conf
user = nginx
group = nginx
listen.owner = nginx
listen.group = nginx
$ systemctl start php8.2-fpm
$ systemctl enable php8.2-fpm
$ systemctl status php8.2-fpm

Step 4. Configure Nginx to use PHP Processor

$ 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;
                       }
     }
$ sudo nginx -t 
$ sudo systemctl reload nginx 
http://server_IP/

=============Create Website=======================================

Use full domain name or whatever word!
$ sudo mkdir -p /var/www/html/website1
$ sudo nano /var/www/html/website1/index.html
$ sudo nano /etc/nginx/sites-available/website1.conf
server {
    listen 80;
    server_name website1.com;
    root /var/www/html/website1;
    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;
                  }
    access_log /var/log/nginx/website1-access.log;
    error_log /var/log/nginx/website1-error.log;
}

------------OR------------------------------------------------

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;
    root /var/www/html/website1;
    index index.php index.html index.htm;
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
   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;
    fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    include fastcgi_params;
}
    access_log /var/log/nginx/website1-access.log;
    error_log /var/log/nginx/website1-error.log;
    location ~ /\.ht {
        deny all;
    }
}

Make other website by copying first one.

$ sudo cp /etc/nginx/sites-available/website1 /etc/nginx/sites-available/website2
$ sudo nano /etc/nginx/sites-available/website2
  paste same as above website1.com.
$ sudo ln -s /etc/nginx/sites-available/website1.conf /etc/nginx/sites-enabled/ 
$ sudo nginx -t 
$ sudo systemctl restart nginx

Step 5. Automatic restart of Nginx

$ systemctl restart nginx
$ mkdir -p /etc/systemd/system/nginx.service.d/
$ nano /etc/systemd/system/nginx.service.d/restart.conf
 Add the following lines to the file
 [Service]
Restart=always
RestartSec=5s

$ systemctl daemon-reload
$ pkill nginx
$ systemctl status nginx

Step 6. Install Memcached

Memcached allows server side caching for faster data retrieval.
$ sudo apt -y install memcached
$ sudo apt -y install php8.2-memcached
$ sudo service php8.2-fpm restart
$ sudo service nginx restart

Step 7.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

Step 8 .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 )
Reduce the size of the initramfs
$ nano /etc/initramfs-tools/conf.d/compress COMPRESS=xz reduce it further with sed -i s,MODULES=most,MODULES=dep,g /etc/initramfs-tools/initramfs.conf update-initramfs -u
Install Let’s Encrypt on Your Domain
$ add-apt-repository ppa:certbot/certbot $ apt-get update -y $ apt-get install python-certbot-nginx -y $ certbot --nginx -d example.com Set Up Let’s Encrypt SSL Certificate Auto-Renewal $ crontab -e Add the following line: 12 8 * * * root /usr/bin/certbot renew >/dev/null 2>&1 Renew the SSL certificate manually: $ certbot renew --dry-run