Apache2 PHP MariaDB Debian 10

Change Hostname, Update, Upgrade, Install Zip Unzip and VIM

#apt-get update -y
#apt-get upgrade -y
#nano /etc/hostname
#apt-get install zip -y #apt-get install unzip -y #apt-get install vim -y

Enable vim cut paste

Enable vim cut paste Debian 9

If needed “Add Swap Memory on Debian 10”

Add Swap Memory on Debian 10

If needed “Increase SSH Connection Timeout in Linux”

#vim /etc/ssh/sshd_config
ClientAliveInterval 1200
ClientAliveCountMax 3
Configure Iptables Firewall Rules

Set up iptables On Debian 8 Debian 9

Configure UFW Firewall Rules

UFW Firewall Basic Rules and Commands

Setup and Configure Fail2ban

Setup Fail2ban on Debian 9

Install Apache2

#apt install apache2 -y

Replace “AllowOverride None” to “AllowOverride All”

#vim /etc/apache2/apache2.conf

Enable and load mod_rewrite Apache2

#/usr/sbin/a2enmod rewrite
#/usr/sbin/a2enmod headers
#/usr/sbin/a2enmod expires

Install MariaDB

#apt install mariadb-server -y

Instal PHP

#apt install php libapache2-mod-php php-mysql -y

Note: If you plan to host a WordPress server, install additional PHP modules

#apt install php-gd php-mbstring php-xml php-xmlrpc

Check PHP Version to install Addons

#php -v
PHP 7.3.31-1~deb10u1 (cli) (built: Oct 24 2021 15:18:08) ( NTS )

Important to Install PHP GD Addons

#apt-get install php7.3-gd -y

Install Postfix for email

#apt-get purge --auto-remove exim4
#apt-get install postfix libsasl2-modules ca-certificates mailutils -y

If needed configure Crontab job auto restart server on memory low 

Crontab job auto restart server on memory low CentOS 6 server

Install SSL Certificate

Install SSL Certificate Apache Debian 7

SSL test on Qualys SSL Labs Rating A Configuration

SSL test on Qualys SSL Labs Rating A Configuration

Activate HTTP/2 protocol on default-ssl.conf

Insert Protocols h2 h2c http/1.1 after on /etc/apache2/sites-available/default-ssl.conf

#vim /etc/apache2/sites-available/default-ssl.conf

Then follow the command below

#/usr/sbin/a2enmod ssl
#/usr/sbin/a2enmod http2
#/usr/sbin/a2ensite default-ssl
#systemctl restart apache2
#service restart apache2