LAMP Deployment Overview on Server¶
Prerequisites¶
The following parameters are required for the application to function correctly:
| Parameter | Value |
|---|---|
| Operating System | Ubuntu (Jammy) |
| Domain | hostkey.in |
| External port (HTTPS) | 443 |
| Internal port | 8080 |
FQDN of the final panel on the hostkey.in domain¶
| Parameter | Value |
|---|---|
| Prefix | lamp |
| Domain | hostkey.in |
| Full template | lamp{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
The system uses the following paths for storing configurations and data:
-
/var/www/html/— Apache web server root directory. -
/data/nginx/user_conf.d/— Nginx user configurations. -
/data/nginx/nginx-certbot.env— Environment variables file for Certbot. -
/etc/letsencrypt— Certificate storage (inside thenginx_secretsvolume).
Application Installation Process¶
The application is deployed by installing a standard LAMP stack (Linux, Apache, MariaDB, PHP) and an Nginx container with SSL support:
-
Updating system packages via
apt. -
Installing the Apache web server.
-
Adding the repository and installing MariaDB version 10.11.
-
Adding the Ondrej PPA to install PHP 8.2 and required modules (
php8.2,libapache2-mod-php8.2,php8.2-mysql,php8.2-curl,php8.2-cgi). -
Creating a test file
/var/www/html/info.php.
Databases¶
MariaDB version 10.11 is used as the database management system. Data is stored locally on the server. The root account is used to access the database, and its password corresponds to the value of the ansible_ssh_pass variable.
Docker Containers and Execution¶
An Nginx container with Certbot is used for SSL certificate management:
services:
nginx:
image: jonasal/nginx-certbot:latest
restart: unless-stopped
network_mode: host
volumes:
- nginx_secrets:/etc/letsencrypt
- /data/nginx/user_conf.d:/etc/nginx/user_conf.d
Application Update Instructions¶
Updates are performed by updating system packages and restarting services. To update PHP, Apache, and MariaDB components, use the command:
apt update && apt upgrade -y
To update the Nginx container, you must run:
docker compose pull && docker compose up -d
Permissions Settings¶
Files in the web server directory have the following access permissions:
/var/www/html/info.php:0644.