Installing LAMP Webserver In Debian 11
In this video, I show you how to install Apache, MariaDB, PHP 7/8, and phpMyAdmin in Debian 11. Iβll also show you how to configure virtualhosts, configure port forwarding, and setting up a domain to use with your server.
Chapters:
00:00 Intro
00:34 Installing Apache
01:11 Installing Curl
01:39 Installing MariaDB
02:40 Stopping and Starting Apache and MariaDB
03:51 Installing PHP 7.4 and 8
06:14 Installing phpMyAdmin
08:28 Setting Up Virtualhosts
12:37 Accessing Webserver Over The Internet
Installing Apache
ππΎ apt install apache2
Starting, Stopping, and Reloading Apache
ππΎ systemctl start apache2
ππΎ systemctl stop apache2
ππΎ systemctl reload apache2
Checking Apache Status
ππΎ systemctl status apache2
Installing Curl
ππΎ apt install curl
Installing MariaDB
ππΎ apt install mariadb-server
Setting MariaDB Secure Credentials
ππΎ sudo mysql_secure_installation
Starting and Stopping MariaDB
ππΎ systemctl start mariadb
ππΎ systemctl stop mariadb
Re-creating Database Root User
mysql -u root
DROP USER βrootβ@βlocalhostβ;
CREATE USER βrootβ@β%β IDENTIFIED BY βenter_password_for_root_hereβ;
GRANT ALL PRIVILEGES ON *.* TO βrootβ@β%β WITH GRANT OPTION;
FLUSH PRIVILEGES;
Login To Database
mysql -u username -p
Installing PHP 7.4
apt install php
apt install php libapache2-mod-php php-mysql
Installing PHP 8
apt install -y lsb-release ca-certificates apt-transport-https software-properties-common
echo βdeb https://packages.sury.org/php/ $(lsb_release -sc) mainβ | sudo tee /etc/apt/sources.list.d/sury-php.list
wget -qO β https://packages.sury.org/php/apt.gpg | sudo apt-key add β
apt update
apt install php8.0
If PHP Is Not Executing, Try The Following Command Change the PHP Version To Your Version You Install
sudo a2dismod mpm_event && sudo a2enmod mpm_prefork && sudo a2enmod php8.0
Installing phpMyAdmin
apt install phpmyadmin
Original article which was used to help make this video ππΎ https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-debian-10