Skip to main content
50% off all plans, limited time. Starting at $2.48/mo
LAMP

LAMP

LAMP is the classic Linux + Apache + MySQL + PHP stack, pre-configured. The web stack that powered most of the internet through the 2000s and still runs WordPress, Joomla, Drupal, and 80% of shared-hosting sites. The default for traditional PHP applications.

At a glance

2.9k

GitHub stars

44

Page views

320

Active installs

License GPL-3.0 Version Latest OS Ubuntu Server 24.04 LTS, Ubuntu Server 22.04 LTS Min RAM 1 GB IP IPV4,IPV6

Active installs is sample data (staging preview); real metric wires in before launch.

Installed Services

  • Apache Web Server → /var/www/html
  • MySQL Server (secured) → Root credentials stored at /root/.cloudzy-creds
  • PHP & Extensions → Includes php-fpm, php-mysql, php-opcache, php-cli, php-curl, php-mbstring, php-xml, php-zip, php-gd

Important Files & Directories

  • Stored MySQL root password: /root/.cloudzy-creds
  • Apache web root directory: /var/www/html
  • Apache configuration files: /etc/apache2
  • MySQL configuration files: /etc/mysql
  • MySQL database files: /var/lib/mysql
  • Apache logs: /var/log/apache2
  • MySQL logs: /var/log/mysql
  • PHP-FPM socket: /run/php/php-fpm.sock

Access MySQL

Login as root:

mysql -u root -p

Password is stored in /root/.cloudzy-creds.

Common commands:

SHOW DATABASES;                                              -- List all databases
USE <database>;                                              -- Switch to a specific database
CREATE DATABASE mydb;                                        -- Create a new database
CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'password';  -- Create a new user
GRANT ALL PRIVILEGES ON mydb.* TO 'appuser'@'localhost';     -- Grant privileges
EXIT;                                                        -- Quit MySQL shell

Access Apache

Web root: /var/www/html

Configuration test:

sudo apache2ctl configtest

Access in browser: http://<SERVER_IP>

Use PHP

Create a file /var/www/html/hello.php with:

<?php

echo "Hello World!";

?>

View in browser: http://<SERVER_IP>/hello.php

Service Management

Apache:

sudo systemctl status apache2    # Check status
sudo systemctl restart apache2   # Restart service

MySQL:

sudo systemctl status mysql      # Check status
sudo systemctl restart mysql     # Restart service

PHP-FPM:

PHP_FPM_VERSION=$(ls /etc/php | grep -E '^[0-9]+\.[0-9]+$')
PHP_FPM_SERVICE="php${PHP_FPM_VERSION}-fpm"
systemctl status ${PHP_FPM_SERVICE}
systemctl restart ${PHP_FPM_SERVICE}

More in Web Hosting

Related apps.

Deploy LAMP now. From $2.48/mo.