Skip to content

Deployment Overview of WordPress with OpenLiteSpeed on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the following requirements must be met:

  • Operating System: Ubuntu (latest stable version).

  • Privileges: Root or sudo access is required for package installation and Docker management.

  • Ports:

  • 80 (HTTP) - Used by Certbot/Nginx for SSL verification.

  • 443 (HTTPS) - Standard secure web traffic.

  • 7080 (OpenLiteSpeed Admin) - Access to the OpenLiteSpeed WebAdmin console.

  • 8080 (Internal HTTP) - Used by the application container internally.

FQDN of the final panel on the hostkey.in domain

The following table describes the domain template used for accessing the WordPress installation:

Parameter Value
Prefix wp
Domain hostkey.in
Full template wp{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The deployment utilizes several specific directories for configuration and data persistence:

  • /root/ols-docker-env: Contains the application environment, Docker Compose files, and installation scripts.

  • /root/nginx: Stores the Nginx-Certbot orchestration files.

  • /data/nginx/user_conf.d: Location of custom Nginx proxy configurations for SSL termination.

  • /data/nginx/nginx-certbot.env: Environment file for Certbot configuration.

Application installation process

The application is installed using a combination of package management, Docker orchestration, and specialized setup scripts:

  1. System Preparation: The system packages are updated, and the Docker engine is installed on the host.

  2. Environment Setup: The ols-docker-env repository is cloned to /root/ols-docker-env.

  3. Version Configuration: The environment file (.env) is modified to use OpenLiteSpeed version 1.9.3 and PHP version lsphp84.

  4. Container Orchestration: Docker Compose is used to launch the application stack. Port mapping is adjusted so that OpenLiteSpeed listens on internal port 8080 instead of standard ports, allowing Nginx to handle external traffic on 80/443.

  5. Virtual Host Creation: A script (bin/domain.sh) is executed to configure the OpenLiteSpeed virtual host for the specific domain.

  6. Database Provisioning: A database named wordpress_db is created via a dedicated script.

  7. WordPress Installation: The application is initialized using the ./bin/appinstall.sh script, which performs the core WordPress setup for the configured domain.

Access Rights and Security

  • Firewall: Ensure that ports 80, 443, and 7080 are open to allow web traffic and administrative access.

  • SSL/TLS: SSL certificates are managed via a dedicated Nginx container using Certbot, ensuring all external traffic is encrypted over HTTPS.

  • Proxy Headers: The configuration automatically injects X-Forwarded-Proto $scheme and Host $host headers to ensure the application correctly recognizes secure connections behind the proxy.

Databases

The application uses a MySQL/MariaDB database managed within the Docker environment:

  • Database Name: wordpress_db

  • User: admin

  • Connection Method: The application connects via the internal Docker network.

Docker Containers and Their Deployment

OpenLiteSpeed Stack

This stack is deployed from /root/ols-docker-env/docker-compose.yml.

Service Image Ports Volumes Environment Variables Restart Policy
OpenLiteSpeed litespeedtech/openlitespeed (customized) 8080:80 N/A OLS_VERSION, PHP_VERSION Default
phpMyAdmin phpmyadmin N/A N/A N/A Default

Nginx-Certbot Proxy

This container is deployed from /root/nginx/compose.yml.

Service Image Ports Volumes Environment Variables Restart Policy
nginx jonasal/nginx-certbot:latest 80/tcp, 443/tcp, 443/udp (host mode) nginx_secrets:/etc/letsencrypt, /data/nginx/user_conf.d:/etc/nginx/user_conf.d CERTBOT_EMAIL unless-stopped

Custom Scripts and Additional Setup

The following scripts are used during the installation process to configure the environment:

  • bin/domain.sh: Configures the OpenLiteSpeed virtual host for the assigned domain.

  • bin/database.sh: Creates the required database and user credentials.

  • ./bin/appinstall.sh: Performs the automated installation of the WordPress core files.

  • docker-certbot prepare config: Prepares the Nginx configuration to handle SSL termination and proxying.

Application Update Instructions

To update the main application, navigate to the deployment directory and perform a pull of the latest images:

cd /root/ols-docker-env
docker compose pull && docker compose up -d

Location of configuration files and data

  • Application Data: Managed within the Docker volumes defined in ols-docker-env.

  • Nginx Proxy Configs: /data/nginx/user_conf.d/

  • Certbot Certificates: Managed via the nginx_secrets volume.

Available ports for connection

Port Service Protocol
80 HTTP (Proxy) TCP
443 HTTPS (SSL) TCP/UDP
7080 OpenLiteSpeed Admin TCP

Starting and Stopping the application

To manage the application services, use the following commands:

Starting the application:

cd /root/ols-docker-env && docker compose up -d

Stopping the application:

cd /root/ols-docker-env && docker compose down

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×