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.

  • Domain: A valid FQDN pointing to the server IP is required for SSL certificate issuance via Certbot.

  • Ports:

  • 80 (HTTP/TCP) - Required for Let's Encrypt validation.

  • 443 (HTTPS/TCP) - For secure web traffic.

  • 7080 (OpenLiteSpeed Admin) - Access to the server management interface.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a dynamically generated subdomain based on the server ID.

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 reverse proxy configuration and Certbot orchestration files.

  • /data/nginx/user_conf.d: Location of custom Nginx virtual host configurations.

  • /data/nginx/nginx-certbot.env: Environment file for the Nginx container.

Application installation process

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

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

  2. Environment Setup: The ols-docker-env repository is cloned to /root/ols-docker-env. The environment configuration is modified to use OpenLiteSpeed version 1.9.2 and PHP version lsphp84.

  3. Container Orchestration: Docker Compose is used to launch the OpenLiteSpeed container, with ports remapped to avoid conflicts with the reverse proxy (internal port 8080).

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

  5. Database Provisioning: A database named wordpress_db is created via a dedicated script (bin/database.sh).

  6. WordPress Installation: The WordPress application is installed and configured using the ./bin/appinstall.sh script, which links the web files to the newly created database.

  7. SSL Configuration: A reverse proxy container is deployed to handle SSL termination and automatic certificate renewal via Certbot.

Access Rights and Security

  • Firewall: Ensure ports 80, 443, and 7080 are open in the system firewall.

  • Reverse Proxy: An Nginx container acts as a security layer, handling SSL/TLS termination and forwarding traffic to the OpenLiteSpeed container.

  • Headers: Security headers such as X-Forwarded-Proto https and Host are configured to ensure correct routing and secure communication between the proxy and the backend.

Databases

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

  • Database Name: wordpress_db

  • Connection Method: Local connection via the OpenLiteSpeed container network.

  • Storage Location: Managed by the Docker volume associated with the OpenLiteSpeed service.

Docker Containers and Their Deployment

The deployment consists of two primary containers:

OpenLiteSpeed Container

  • Image: litespeedtech/ols-docker-env (Version 1.9.2)

  • Ports: 8080:80 (Internal mapping), 7080:7080

  • Environment Variables:

  • PHP_VERSION: lsphp84

  • Restart Policy: Default Docker restart policy.

Nginx Certbot Container

  • Image: jonasal/nginx-certbot:latest

  • Ports: Uses network_mode: host to bind directly to system ports 80 and 443.

  • Volumes:

  • nginx_secrets:/etc/letsencrypt: For SSL certificate storage.

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d: For custom proxy configurations.

  • Environment Variables:

  • CERTBOT_EMAIL: Configured via the admin email address.

  • Restart Policy: unless-stopped

Custom Scripts and Additional Setup

Several scripts are used during the deployment process to automate complex configurations:

  • bin/domain.sh: Configures OpenLiteSpeed virtual hosts for the target domain.

  • bin/database.sh: Automates the creation of the WordPress database and user.

  • ./bin/appinstall.sh: Performs the core WordPress installation, including file extraction and configuration.

Application Update Instructions

To update the main application, perform the following steps:

  1. Navigate to the application directory: cd /root/ols-docker-env.

  2. Pull the latest images and restart the services:

    docker compose pull && docker compose up -d
    

Location of configuration files and data

  • WordPress Files: Located within the OpenLiteSpeed container volumes.

  • Nginx Proxy Configs: /data/nginx/user_conf.d/{domain}.conf

  • SSL Certificates: Managed via the nginx_secrets Docker volume.

Available ports for connection

Service Port Protocol
Web Application (HTTPS) 443 TCP
Web Application (HTTP) 80 TCP
OpenLiteSpeed Admin 7080 TCP
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×