Applies to: LifeinCloud Cloud VPS • Ubuntu 22.04 LTS
The LAMP stack (Linux, Apache, MySQL, PHP) is the classic open-source web hosting environment. While LifeinCloud provides a 1-click LAMP image, this guide shows how to install and configure it manually.
Requirements
- LifeinCloud VPS running Ubuntu 22.04
- Root SSH access
Step 1 — Update System
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
Step 2 — Install Apache
apt install -y apache2
systemctl enable apache2
systemctl start apache2
Once installed, visit http://YOUR_SERVER_IP
in your browser to confirm Apache is running.
Step 3 — Install MySQL
apt install -y mysql-server
mysql_secure_installation
The mysql_secure_installation
script helps configure root password, remove test databases, and secure your installation.
Step 4 — Install PHP
apt install -y php libapache2-mod-php php-mysql
This installs PHP along with Apache and MySQL integration modules.
Step 5 — Test PHP Processing
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
Open http://YOUR_SERVER_IP/info.php
in your browser. If PHP is working correctly, you will see the PHP information page.