Apache2 PHP MariaDB Debian 10

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

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

Increase SSH Connection Timeout in Linux

#vim /etc/ssh/sshd_config
ClientAliveInterval 60
ClientAliveCountMax 3

Enable vim cut paste

Install Iptables

Setup Fail2ban

Install Apache2

#apt install apache2

Enable and load mod_rewrite Apache2

nano /etc/apache2/apache2.conf and replace “AllowOverride None” to “AllowOverride All”

#a2enmod rewrite
#a2enmod headers
#a2enmod expires

Install MariaDB

#apt install mariadb-server -y
#mysql_secure_installation

Instal PHP

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

Check PHP Version to install Addons

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

Install PHP Module Addons

#apt-get install php7.3-gd -y && apt-get install php-pear php7.3 -y

Install Postfix for email

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

Install SSL Certificate

https://vpshelpdesk.com/2017/11/18/install-ssl-certificate-apache-debian

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

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

Then follow the command below

#a2enmod ssl
#a2enmod http2
#a2ensite default-ssl
#systemctl restart apache2
#service restart apache2