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

WordPress with Lighttpd


Install Lighttpd, MariaDB, and PHP

Configure PHP-FPM to Work with Lighttpd
Next, you will need to configure PHP-FPM to work with Lighttpd. To do so, edit the www.conf file:

$ nano /etc/php/8.2/fpm/pool.d/www.conf
listen = /run/php/php8.2-fpm.sock
And, replace it with the following line:
listen = 127.0.0.1:9000

$ nano /etc/lighttpd/conf-available/15-fastcgi-php.conf

"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php.socket",
And, replaced them with the following lines:

"host" => "127.0.0.1",
"port" => "9000",
Save and close the file, then enable the required modules with the following command:

$ lighty-enable-mod fastcgi
$ lighty-enable-mod fastcgi-php
Next, restart the Lighttpd and PHP-FPM service to apply the changes:

$ systemctl restart lighttpd
$ systemctl restart php8.2-fpm
Step 3 – Create a Database for WordPress
Next, log in to the MariaDB with the following command:

$ mysql
Once you are log in, create a database and user with the following command:

CREATE DATABASE wpdb;
GRANT ALL PRIVILEGES on wpdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'password';
Next, flush the privileges and exit from the MariaDB:

FLUSH PRIVILEGES;
EXIT;
Step 4 – Install WordPress
Next, change the directory to the Lighttpd web root directory and download the latest version of WordPress using the following command:

$ cd /var/www/html
wget https://wordpress.org/latest.tar.gz
Once the download is completed, extract the downloaded file with the following command:

$ tar -xvzf latest.tar.gz
Next, change the directory to WordPress and rename the sample configuration file:

$ cd wordpress
mv wp-config-sample.php wp-config.php
Next, edit the configuration file and define your database settings:

$ nano wp-config.php
Change the following lines:

/** The name of the database for WordPress */
define( 'DB_NAME', 'wpdb' );

/** MySQL database username */
define( 'DB_USER', 'wpuser' );

/** MySQL database password */
define( 'DB_PASSWORD', 'password' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
Save and close the file, then set proper permissions and ownership with the following command:

$ chown -R $USER:$USER /var/www/html/wordpress
$ chmod -R 755 /var/www/html/wordpress

Step 5 – Configure Lighttpd for WordPress
First, create a directory to store the virtual host configuration file:

$ mkdir -p /etc/lighttpd/vhosts.d/
Next, edit the Lighttpd configuration file:

$ nano /etc/lighttpd/lighttpd.conf
Add mod_rewrite in the following block:

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite",
)
And define the path of your virtual host configuration directory:

include_shell "cat /etc/lighttpd/vhosts.d/*.conf"
Save and close the file. Then, create a new virtual host configuration file for WordPress:

$ nano /etc/lighttpd/vhosts.d/wordpress.conf
Add the following lines:

$HTTP["host"] =~ "(^|.)wordpress.example.com$" {
server.document-root = "/var/www/html/wordpress"
server.errorlog = "/var/log/lighttpd/wordpress-error.log"

}
Save and close the file, then restart the Lighttpd service to apply the changes:

$ systemctl restart lighttpd
Step 6 – Access WordPress Dashboard
Now, open your web browser and access the WordPress installation wizard using the URL http://wordpress.example.com. You should see the following page:

WordPress with Caddy


Open webmin, go to desired domain, upload wordpress.zip and extract wordpress.zip. OR

$ cd /tmp
$ wget https://wordpress.org/latest.zip
$ sudo mkdir /usr/share/caddy/domain
$ sudo unzip /tmp/latest.zip   //it will unzip in the directory wordpress.
$ sudo mv /tmp/wordpress/* /usr/share/caddy/domain  //it will transfer all the files to domain.
$ cd /usr/share/caddy/domain
$ ls //see if all the files there
$ sudo chown -R $USER:$USER /usr/share/caddy/domain

mysql -u root -p
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL ON wordpress.* TO 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
exit;

$ nano /etc/caddy/Caddyfile
domain:80 {    
    tls your@email.com
        log {
        output file /var/log/caddy/your.domain
        format console
    }
    root * /usr/share/caddy/domain
    encode gzip
    file_server
    php_fastcgi unix//run/php/php8.2-fpm.sock
      @disallowed {
        path /xmlrpc.php
        path *.sql
        path /wp-content/uploads/*.php
                  }
     rewrite @disallowed '/index.php'

        if {path} not_match ^\/wp-admin
        to {path} {path}/ /index.php?_url={uri}
}
$ sudo systemctl restart caddy
$ cd /usr/share/caddy/domain
  rename wp-config-sample.php to wp-config.php
$ mv wp-config-sample.php wp-config.php
$ sudo nano /usr/share/caddy/domain/wp-config.php
define('DB_NAME', 'wp_site');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'StrongPassword');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
Go to https://Domain, it will setup Wordpress.

GRAV with NGINX, Debian 12


Install, PHP, DB, Nginx first.

$ adduser nginx
$ adduser nginx sudo
$ su - nginx
$ exit

$ 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

Nginx Config File

$ 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 you find 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


Virtualmin


apt-get update --allow-releaseinfo-change  
apt-get install --reinstall ca-certificates  
apt-get upgrade --fix-missing
apt-get install nano wget perl sudo -y

sudo apt dist-upgrade
sudo apt --purge autoremove
sudo apt update && sudo apt upgrade
apt -y purge Apache2* bind* exim* ufw* firewalld*

wget http://software.virtualmin.com/gpl/scripts/install.sh
chmod +x install.sh
sudo /bin/sh install.sh --minimal
sudo /bin/sh install.sh --bundle LEMP --minimal
wget https://raw.githubusercontent.com/virtualmin/virtualmin-install/master/virtualmin-install.sh
(Good for Debian 10, 11, Ubuntu 18,20,22 Alma, RockyLinux) 
chmod a+x virtualmin-install.sh 
sudo ./virtualmin-install.sh --minimal

apt -y remove bind* fail2ban* clamav* firewalld* proftpd* spamassassin* usermin* Quota* ufw
➔iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 10000 -j ACCEPT
dpkg --get-selections | grep -i php //important!!
(see if php7.3-mysql is installed, if not sudo apt -y install php7.3-mysql)    

sudo apt -y update && sudo apt -y upgrade
$ 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 
$ sudo apt -y install 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
sudo apt -y install php8.2-soap php8.2-zip php8.2-cgi
apt -y update && apt -y upgrade
apt -y autoremove
sudo a2enmod rewrite or
sudo a2dismod rewrite
systemctl restart apache2

**if it doesn't have space, check */var/cache/* and **/var/log(except Apache2)** clean crap!**

# sudo /etc/init.d/networking restart
or
# sudo /etc/init.d/networking stop
# sudo /etc/init.d/networking start
else
# sudo systemctl restart networking
Install php5.6 among other versions

apt -y install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | 
sudo tee /etc/apt/sources.list.d/php.list

in Ubuntu: LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
apt -y update && apt -y upgrade
pecl install timezonedb zip
apt -y install libmcrypt-dev libreadline-dev mcrypt php-pear libapache2-mod-fcgid

//"! Very Important"
apt -y install php5.6 php5.6-cgi php5.6-mysql php5.6-mbstring php5.6-gd php5.6-dom php5.6-common
apt -y install php5.6-json php5.6-curl libapache2-mod-php5.6

sudo apt -y install php5.6-cli php5.6-pdo php5.6-fpm php5.6-mcrypt php5.6-imap php5.6-intl 
sudo apt -y install php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip
sudo apt -y install php5.6-opcache php5.6-readline php5.6-xml php5.6-imagick php5.6-pspell 
php5.6-soap

systemctl restart apache2
sudo systemctl start php5.6-fpm
sudo systemctl status php5.6-fpm
systemctl restart apache2
sudo apt-get -y purge php8.*
sudo apt-get -y purge php7.3*
sudo apt-get -y autoclean
sudo apt-get -y autoremove   
systemctl restart apache2
php5.6 is a metapackage that can be used to run PHP applications.
php5.6-fpm provides the Fast Process Manager interpreter receives Fast/CGI requests.
php5.6-mysql connects PHP to the MySQL database.
libapahce2-mod-php5.6 provides the PHP module for the Apache webserver.
libapache2-mod-fcgid contains a mod_fcgid starts CGI programs to handle concurrent requests.
Set Default PHP Version

sudo update-alternatives --set php /usr/bin/php5.6 
sudo update-alternatives --set php /usr/bin/php7.4
php -v

php -i | grep "Loaded Configuration File"

a2dismod php5.6
a2enmod php5.6
systemctl restart apache2
Install Node.js via Debian Repository

apt show nodejs
apt-get update -y
apt-get install nodejs npm -y
node --version
v12.22.5
uninstall the Node.js:

apt-get remove nodejs npm --purge
apt-get autoremove
apt-get clean
Upgrade Ubuntu 20 to 22

sudo apt update -y && sudo apt upgrade -y && sudo apt dist-upgrade -y
sudo apt autoremove -y && sudo apt autoclean -y
sudo reboot
apt install update-manager-core
do-release-upgrade -d
reboot

sudo apt autoremove --purge

sudo apt install software-properties-commonsudo 
sudo add-apt-repository ppa:ondrej/php

    sudo apt -y install php5.6
    sudo apt -y install php5.6-fpm php5.6-common php5.6-mysql php5.6-xml php5.6-xmlrpc php5.6-curl 
    sudo apt -y install hp5.6-gd php5.6-cli php5.6-dev php5.6-imap php5.6-mbstring php5.6-cgi 
    sudo apt -y install php5.6-soap php5.6-zip php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc 
sudo apt -y installphp8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap 
sudo apt -y installphp8.2-opcache php8.2-soap php8.2-zip php8.2-redis php8.2-intl php8.2-mbstring 

Verify PHP Version
You can easily verify PHP version using the below command.

php -v
Output
PHP 8.2.0 (cli) (built: Jan 04 2023 09:13:42) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.0, Copyright (c), by Zend Technologies

    systemctl restart apache2
Set Permanent DNS Nameservers On Debian 11.3

apt install resolvconf
systemctl start resolvconf.service
systemctl enable resolvconf.service
systemctl status resolvconf.service 

nano /etc/resolvconf/resolv.conf.d/head
 nameserver 8.8.4.4
 nameserver 8.8.8.8

resolvconf -u
nano /etc/resolv.conf

Sources.List


Upgrade from Debian 10 to 11 to 12:  Always start from lowest and upgrade and ALWAYS choose 1st.Y

do debian 10 source list change and update
change debian 11,12 source list, update & upgrade.

Start from Debian 10,
sudo apt update && sudo apt upgrade

$ cat /proc/cpuinfo 
$ sudo dpkg --configure -a
$ sudo nano /etc/hosts
$ sudo hostnamectl set-hostname new-one
$ newgrp

ChangeLanguage
# env | grep LANG
# export LANG=en_EN.UTF-8
# dpkg-reconfigure locales
# sudo reboot
# fdisk -l df -h resize2fs /dev/vda df -h You should see the storage as expected.

$ nano /etc/apt/sources.list for debian 11

deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main
deb http://security.debian.org/debian-security bullseye-security main
deb-src http://security.debian.org/debian-security bullseye-security main
deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main
deb http://deb.debian.org/debian bullseye-backports main
deb-src http://deb.debian.org/debian bullseye-backports main

$ nano /etc/apt/sources.list for debian 12

deb http://deb.debian.org/debian bookworm main
deb-src http://deb.debian.org/debian bookworm main
deb http://security.debian.org/debian-security bookworm-security main
deb-src http://security.debian.org/debian-security bookworm-security main
deb http://deb.debian.org/debian bookworm-updates main
deb-src http://deb.debian.org/debian bookworm-updates main
deb http://deb.debian.org/debian bookworm-backports main
deb-src http://deb.debian.org/debian bookworm-backports main

From CD Rom version

deb http://ftp.debian.org/debian bookworm main non-free-firmware
deb-src http://ftp.debian.org/debian bookworm main non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware

deb http://ftp.debian.org/debian bookworm-updates main non-free-firmware
deb-src http://ftp.debian.org/debian bookworm-updates main non-free-firmware

For Ubuntu, start from Ubuntu20 to 22LTS

$ nano /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu jammy main restricted
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted
deb http://archive.ubuntu.com/ubuntu jammy universe
deb http://archive.ubuntu.com/ubuntu jammy-updates universe
deb http://archive.ubuntu.com/ubuntu jammy multiverse
deb http://archive.ubuntu.com/ubuntu jammy-updates multiverse
deb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu jammy partner
deb http://archive.ubuntu.com/ubuntu jammy-security main restricted
deb http://archive.ubuntu.com/ubuntu jammy-security universe
deb http://archive.ubuntu.com/ubuntu jammy-security multiverse

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

$ sudo apt dist-upgrade
$ sudo apt --purge autoremove
$ sudo apt update && sudo apt upgrade
$ apt -y purge Apache2* bind* exim* ufw* firewalld*

$ wget http://software.virtualmin.com/gpl/scripts/install.sh
$ chmod +x install.sh
$ sudo /bin/sh install.sh --minimal
$ sudo /bin/sh install.sh --bundle LEMP --minimal

$ wget https://raw.githubusercontent.com/virtualmin/virtualmin-install/master/virtualmin-install.sh
(Good for Debian 10, 11, Ubuntu 18,20,22 Alma, RockyLinux) 
$ chmod a+x virtualmin-install.sh 
$ sudo ./virtualmin-install.sh --minimal

$ apt -y remove bind* fail2ban* clamav* firewalld* proftpd* spamassassin* usermin* Quota* ufw
➔iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 10000 -j ACCEPT
$ dpkg --get-selections | grep -i php //important!!
(see if php7.3-mysql is installed, if not sudo apt -y install php7.3-mysql)    

$ sudo apt -y update && sudo apt -y upgrade
$ 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
$ sudo apt -y install php-imap php-mbstring php-opcache php-soap php-dev php-cgi php-zip php-intl
$ sudo apt -y install libmcrypt-dev libreadline-dev mcrypt php-pear libapache2-mod-fcgid

$ 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 php8.2-mbstring
$ sudo apt -y install php8.2-soap php8.2-zip php8.2-cgi

$ apt -y update && apt -y upgrade
$ apt -y autoremove
$ sudo a2enmod rewrite or
$ sudo a2dismod rewrite
$ systemctl restart apache2

**if it doesn't have space, check */var/cache/* and **/var/log(except Apache2)** clean crap!**

# sudo /etc/init.d/networking restart
or
# sudo /etc/init.d/networking stop
# sudo /etc/init.d/networking start
else
# sudo systemctl restart networking
Install php5.6 among other versions

apt -y install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | 
sudo tee /etc/apt/sources.list.d/php.list

in Ubuntu: LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
apt -y update && apt -y upgrade
pecl install timezonedb zip
apt -y install libmcrypt-dev libreadline-dev mcrypt php-pear libapache2-mod-fcgid

//"! Very Important"
apt -y install php5.6 php5.6-cgi php5.6-mysql php5.6-mbstring php5.6-gd php5.6-dom php5.6-common
apt -y install php5.6-json php5.6-curl libapache2-mod-php5.6

sudo apt -y install php5.6-cli php5.6-pdo php5.6-fpm php5.6-mcrypt php5.6-imap php5.6-intl 
sudo apt -y install php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip
sudo apt -y install php5.6-opcache php5.6-readline php5.6-xml php5.6-imagick php5.6-pspell 
php5.6-soap

systemctl restart apache2
sudo systemctl start php5.6-fpm
sudo systemctl status php5.6-fpm
systemctl restart apache2
sudo apt-get -y purge php8.*
sudo apt-get -y purge php7.3*
sudo apt-get -y autoclean
sudo apt-get -y autoremove   
systemctl restart apache2
php5.6 is a metapackage that can be used to run PHP applications.
php5.6-fpm provides the Fast Process Manager interpreter receives Fast/CGI requests.
php5.6-mysql connects PHP to the MySQL database.
libapahce2-mod-php5.6 provides the PHP module for the Apache webserver.
libapache2-mod-fcgid contains a mod_fcgid starts CGI programs to handle concurrent requests.
Set Default PHP Version

sudo update-alternatives --set php /usr/bin/php5.6 
sudo update-alternatives --set php /usr/bin/php7.4
php -v

php -i | grep "Loaded Configuration File"

a2dismod php5.6
a2enmod php5.6
systemctl restart apache2
Install Node.js via Debian Repository

apt show nodejs
apt-get update -y
apt-get install nodejs npm -y
node --version
v12.22.5
uninstall the Node.js:

apt-get remove nodejs npm --purge
apt-get autoremove
apt-get clean
Upgrade Ubuntu 20 to 22

sudo apt update -y && sudo apt upgrade -y && sudo apt dist-upgrade -y
sudo apt autoremove -y && sudo apt autoclean -y
sudo reboot
apt install update-manager-core
do-release-upgrade -d
reboot

sudo apt autoremove --purge

sudo apt install software-properties-commonsudo 
sudo add-apt-repository ppa:ondrej/php

    sudo apt -y install php5.6
    sudo apt -y install php5.6-fpm php5.6-common php5.6-mysql php5.6-xml php5.6-xmlrpc php5.6-curl 
    sudo apt -y install hp5.6-gd php5.6-cli php5.6-dev php5.6-imap php5.6-mbstring php5.6-cgi 
    sudo apt -y install php5.6-soap php5.6-zip php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc 
sudo apt -y installphp8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap 
sudo apt -y installphp8.2-opcache php8.2-soap php8.2-zip php8.2-redis php8.2-intl php8.2-mbstring 

Verify PHP Version
You can easily verify PHP version using the below command.

php -v
Output
PHP 8.2.0 (cli) (built: Jan 04 2023 09:13:42) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.0, Copyright (c), by Zend Technologies

    systemctl restart apache2
Set Permanent DNS Nameservers On Debian 11.3

apt install resolvconf
systemctl start resolvconf.service
systemctl enable resolvconf.service
systemctl status resolvconf.service 

nano /etc/resolvconf/resolv.conf.d/head
 nameserver 8.8.4.4
 nameserver 8.8.8.8

resolvconf -u
nano /etc/resolv.conf

L.L.L.P


$ 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 lighttpd:lighttpd /home/lighttpd/domain1  // don't forget!!!
OR chown -R lighttpd:lighttpd /var/www/html/domain1
# chmod -R 755 /home/lighttpd/domain   OR chmod -R 755 /var/www/html/domain1
# systemctl restart lighttpd
================================================
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")

$HTTP["host"] =~ ".*" {
    server.document-root = "/var/www/html/grav"
    url.rewrite-if-not-file = ( "" => "/index.php" )
}
  at bottom add    include "domain1.conf" 

$ chown -R www-data:www-data /var/www/html/grav
$ chmod -R 755 /var/www/html/grav

$ 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"
    }

$ systemctl restart lighttpd
=======================================
Install Ghost

$ sudo useradd -m -s /bin/bash ghostadmin
$ passwd ghostadmin
$ sudo su - ghostadmin

$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ node -v
$ sudo apt-y install.npm
$ sudo npm install npm@latest -g
$ npm -v

$ sudo mysql -u root -p
    CREATE DATABASE ghost;
    CREATE USER 'ghostadmin'@'localhost' IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON ghost.* TO 'ghostadmin'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

$ sudo npm install ghost-cli@latest -g
$ ghost --version

$ sudo mkdir -p /var/www/html/domain
$ sudo chown $USER:$USER /var/www/html/domain
$ sudo chmod 775 /var/www/html/domain
$ sudo su - ghostadmin
$ cd /var/www/html/domain
$ ghost install

    Blog URL (e.g., https://force.youreyesonly.xyz)
    MySQL hostname (localhost)
    MySQL username and password (ghost andibutt1986)
    Ghost database name (ghost)

6. =========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 PhpMyadmin on Debian($ sudo apt-get purge adminer)====
sudo apt install phpmyadmin -y
sudo dpkg --configure -a
sudo apt -y autoremove
$ sudo ln -s /usr/share/phpmyadmin/ /home/lighttpd/
($ sudo ln -s /usr/share/phpmyadmin/ /var/www/html/)
$ cd /home/lighttpd/phpmyadmin
($ cd /var/www/html/phpmyadmin)
$ ls
$ sudo cp config-example.inc.php config.inc.php
$ sudo nano config.inc.php
  $cfg['blowfish_secret'] = '';
$ sudo rm -rf /setup
$ chown -R www-data:www-data /home/lighttpd/phpmyadmin  // don't forget!!! # 
(chown -R www-data:www-data /var/www/html/phpmyadmin )
http://i.p addr/phpmyadmin
OR
$ sudo mv /usr/share/phpmyadmin/* /home/lighttpd/domain  //it will transfer all the files to domain.
$ cd /home/lighttpd/domain
$ ls //see if all the files there
  $cfg['blowfish_secret'] = '';
http://domain
$ chown -R www-data:www-data /home/lighttpd/domain  // don't forget!!! # 
$ systemctl restart lighttpd
mysql -u root -p
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL ON wordpress.* TO 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
exit;
============Getting different version of PHP=========================
$ apt -y install apt-transport-https lsb-release ca-certificates
$ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
$ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | 
sudo tee /etc/apt/sources.list.d/php.list

$ sudo apt -y upgrade
$ sudo apt-get -y purge php8.*
$ sudo apt-get -y purge php5.6*
$ sudo apt-get -y autoclean
$ sudo apt-get -y autoremove   

Set Default PHP Version
$ sudo update-alternatives --set php /usr/bin/php7.4
$ php -v
$ php -i | grep "Loaded Configuration File"

$ a2dismod php5.6
$ a2enmod php5.6