How to Install LAMP Stack Linux on Ubuntu 24.04

MivoCloudMivoCloud Shared Hoster

Hi, I made a video that will help you install this tool on your server

The LAMP Stack (Linux, Apache, MySQL/MariaDB, and PHP) is a bundle of open-source technologies for building websites and web applications. Each component of LAMP Stack is free, and you can install it for both development and production environments.

Commands Used:
sudo apt update sudo apt upgrade -y
sudo apt install apache2
sudo systemctl is-enabled apache2
sudo systemctl status apache2
sudo ufw allow 'Apache Full'
sudo ufw status
sudo apt install mariadb-server
sudo systemctl is-enabled mariadb
sudo systemctl status mariadb
sudo mariadb-secure-installation
sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-json php-intl php-bcmath php-opcache php-apcu php-mbstring php-fileinfo php-xml php-soap php-tokenizer php-zip
sudo nano /etc/php/8.3/apache2/php.ini
sudo systemctl restart apache2
echo "?php phpinfo(); ?" /var/www/html/info.php
mkdir -p /var/www/mysite/public_html
echo "Welcome to mysite.com" /var/www/mysite/public_html/index.html
sudo chown -R www-data:www-data /var/www/mysite
sudo nano /etc/apache2/sites-available/mysite.conf

VirtualHost *:80

ServerAdmin admin@mysite.com

ServerName mysite.com
ServerAlias www.mysite.com

DocumentRoot /var/www/mysite/public_html

ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
CustomLog ${APACHE_LOG_DIR}/mysite-access.log combined

/VirtualHost

sudo a2ensite mysite.conf
sudo apachectl configtest
sudo systemctl restart apache2

Tagged:
Sign In or Register to comment.