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