LAMP Stack

Complete Guide

Evans

Last Update 24 dage siden

What is LAMP Stack?
Short Description
LAMP Stack is a pre-configured, self-hosted web server environment running Linux, Apache, MySQL, and PHP. Deploy a fully functional web server with phpMyAdmin database management, automatic SSL via Caddy, and a custom branded landing page; all provisioned automatically on order.

More details on Lamp Stack

LAMP Stack gives you a complete, ready-to-use web hosting environment on your own VPS.

Built on Ubuntu 22.04 LTS, it combines Apache (web server), MySQL (database), and PHP (scripting); all secured behind Caddy with automatic SSL certificates and phpMyAdmin for easy database management.

Your server is provisioned and ready within 3–5 minutes of ordering.
Key Features
Apache 2.4 web server; pre-configured and running
MySQL 8.0 with phpMyAdmin control panel
PHP 8.x with common extensions (curl, gd, mbstring, xml, zip, bcmath, json)
Caddy reverse proxy with automatic Let's Encrypt SSL
Custom branded landing page per deployment
Unique credentials generated per order
Full root SSH access
Use Cases
  • Host PHP-based applications (WordPress, Laravel, CodeIgniter)
  • Database-driven web applications
  • Development and staging environments
  • Custom web hosting for clients
Implementation on HostAfrica
Deployment Method
LAMP Stack is deployed via our automated provisioning system:
  • Template-Based: Pre-configured Ubuntu 22.04 LTS template with full LAMP stack pre-installed
  • Automation: Domain, SSL, MySQL password, and phpMyAdmin configured automatically
  • Zero Manual Setup: Server is ready within 3–5 minutes of ordering

Minimum Requirements

ComponentRequirement
OSUbuntu 22.04 LTS
RAM1GB minimum (2GB recommended)
CPU1 vCPU minimum (2 recommended)
Storage20GB minimum
NetworkPublic IPv4 + domain
Included Components
  • Apache 2.4 — Web server on port 8080 (internal)
  • MySQL 8.0 — Database server with password authentication
  • PHP 8.x — With curl, gd, mbstring, xml, zip, bcmath, json extension
  • phpMyAdmin — Web-based database management at /phpmyadmin/
  • Caddy — Reverse proxy handling HTTPS on port 443 with auto SSL


How It Works (Architecture)

Caddy handles all external HTTPS traffic on port 443 and proxies requests through to Apache, which runs internally on port 8080. MySQL is only accessible from localhost — it's never exposed to the internet.
Security Architecture
  • Caddy handles all external traffic on port 443 (HTTPS only)
  • Apache bound to port 8080 — not directly internet-accessible
  • MySQL accessible from localhost only
  • phpMyAdmin secured behind HTTPS via Caddy proxy
  • Unique MySQL password generated per deployment
Security Features
Automatic SSL Certificates
  • Let's Encrypt certificates obtained automatically by Caddy
  • Auto-renewal before expiration
  • HTTPS enforced for all connections

Service Isolation
  • Apache runs on localhost:8080 only — not exposed to internet
  • MySQL binds to 127.0.0.1 — no remote database access by default
  • Only Caddy is internet-facing on port 443

Authentication
  • Unique MySQL root password generated per deployment
  • phpMyAdmin accessible only via HTTPS
  • Full root SSH access with password or SSH key
Getting Started
Setup Time: 3–5 minutes for automatic provisioning

What You'll Receive

DetailValue
Application URLhttps://your-domain-lampstack.hcloud.app
phpMyAdmin URLhttps://your-domain-lampstack.hcloud.app/phpmyadmin/
Application Loginroot
Application PasswordAuto-generated (shown in client area)
SSH Accessssh [email protected]
Credentials File/root/credentials.txt
Accessing Your Server
Via Browser:
  1. Navigate to your Application URL from the client area
  2. The default LAMP Stack landing page will load
  3. Click the phpMyAdmin link or navigate to /phpmyadmin/
  4. Login with username root and the password from the client area

Via SSH:

View Deployment Credentials:
Configuration
Deploying a Website
Upload your website files to the Apache document root:
Changing the Domain Name
If you need to update the domain after deployment:
SSL certificate for the new domain will be obtained automatically.


Update phpMyAdmin:
Important: If you skip this step, phpMyAdmin will redirect to the old domain and may append the wrong port.
Changing MySQL Password
Creating a New Database
Useful Commands
Service Management
CommandDescription
systemctl status apache2Check Apache status
systemctl restart apache2Restart Apache
systemctl status mysqlCheck MySQL status
systemctl restart mysqlRestart MySQL
systemctl status caddyCheck Caddy/SSL status
systemctl restart caddyRestart Caddy (after domain changes)
Apache
MySQL
Caddy (Web Server)
Configuration Files
FilePurpose
/var/www/html/Website document root
/etc/caddy/CaddyfileCaddy reverse proxy config
/etc/apache2/Apache configuration
/etc/phpmyadmin/config.inc.phpphpMyAdmin config
/root/credentials.txtDeployment credentials
/var/log/lampstack-deploy.logDeployment log
Troubleshooting
phpMyAdmin Not Loading
SSL Certificate Issues
Note: DNS must be pointed to the server IP before SSL can be obtained.

MySQL Access Denied

Check System Resources
Updates
System Updates
PHP Updates

Was this article helpful?

1 out of 1 liked this article

Still need help? Message Us