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 encrypted web traffic. -
8080(Internal HTTP) - OpenLiteSpeed internal service port. -
7080(OLS Admin) - Access to the OpenLiteSpeed administration panel.
FQDN of the final panel on the hostkey.in domain¶
The application uses a specific subdomain template for access and SSL certificate management.
| Parameter | Value |
|---|---|
| Prefix | wp |
| Domain | hostkey.in |
| Full template | wp{Server_ID_from_Invapi}.hostkey.in |
File and Directory Structure¶
The deployment utilizes several directories for configuration, data, and SSL management:
-
/root/ols-docker-env: Contains the core application files, including Docker Compose configurations and installation scripts. -
/data/nginx/user_conf.d: Stores Nginx reverse proxy configuration files for SSL termination. -
/data/nginx/nginx-certbot.env: Environment file used by the Certbot container. -
/root/nginx: Directory containing the Nginx-Certbot Docker Compose setup.
Application installation process¶
The application is installed using a combination of system package management, Git repository cloning, and specialized installation scripts:
-
System Preparation: The system packages are updated via
apt, and the Docker engine is installed on the host. -
Repository Retrieval: The
ols-docker-envrepository is cloned from GitHub to/root/ols-docker-env. -
Environment Configuration:
-
The
.envfile is modified to set specific versions: OpenLiteSpeed version1.9.3and PHP versionlsphp84. -
Port mapping is adjusted in
docker-compose.ymlto rebind the internal OpenLiteSpeed ports (moving them from standard 80/443 to port8080) to allow the Nginx proxy to occupy the standard web ports. -
Container Deployment: The Docker containers for OpenLiteSpeed and phpMyAdmin are started using
docker compose up -d. -
Virtual Host Creation: A script
bin/domain.shis executed to configure a new virtual host within OpenLiteSpeed based on the generated domain name. -
Database Provisioning: A database named
wordpress_dbis created via thebin/database.shscript with an administrative user. -
WordPress Installation: The application files and core configuration are deployed using the
./bin/appinstall.shscript, targeting the newly created database and domain. -
SSL Configuration: A Nginx-based proxy is deployed via Docker to handle SSL certificates through Certbot and provide reverse proxying to the OpenLiteSpeed container.
Access Rights and Security¶
-
Firewall: The system relies on standard port availability for web traffic (80/443).
-
Internal Routing: OpenLiteSpeed is isolated from direct external access on ports 80/443; it listens on port
8080, while Nginx handles the public-facing encrypted traffic. -
Proxy Headers: Security and routing headers (
HostandX-Forwarded-Proto) are automatically injected into the Nginx configuration to ensure WordPress correctly identifies HTTPS requests.
Databases¶
The application uses a MySQL/MariaDB database managed within the Docker environment.
| Parameter | Value |
|---|---|
| Database Name | wordpress_db |
| Connection Method | Localhost (via container network) |
| Storage Location | Managed via Docker volumes |
Docker Containers and Their Deployment¶
The deployment consists of two primary container groups: the application stack and the SSL proxy.
OpenLiteSpeed Stack¶
Located in /root/ols-docker-env/docker-compose.yml.
-
OpenLiteSpeed Container
-
Image:
litespeedtech/openlitespeed(version specified viaOLS_VERSION) -
Ports: Internal port
80mapped to host8080. -
Environment: PHP version set to
lsphp84. -
phpMyAdmin Container
-
Image:
phpmyadmin(official library image)
SSL Proxy Stack¶
Located in /root/nginx/compose.yml.
-
Nginx-Certbot Container
-
Image:
jonasal/nginx-certbot:latest -
Ports:
80,443(Host mode). -
Volumes:
-
nginx_secrets:/etc/letsencrypt -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d -
Environment:
CERTBOT_EMAILset to the administrator's email. -
Restart Policy:
unless-stopped
Custom Scripts and Additional Setup¶
The following scripts are used during the installation process located in /root/ols-docker-env/bin/:
-
domain.sh: Configures the OpenLiteSpeed virtual host for the specific domain. -
database.sh: Initializes the MySQL database, user, and permissions. -
appinstall.sh: Performs the final WordPress application installation and configuration.
Application Update Instructions¶
To update the main application components:
-
OpenLiteSpeed/PHP Stack: Navigate to
/root/ols-docker-envand run: -
Nginx Proxy: To refresh SSL certificates or proxy settings, navigate to
/root/nginxand run:
Location of configuration files and data¶
-
Application Data: Managed within the Docker volumes associated with the OpenLiteSpeed container.
-
Nginx Proxy Configs:
/data/nginx/user_conf.d/ -
SSL Certificates: Stored in the
nginx_secretsDocker volume.
Available ports for connection¶
| Service | Port | Protocol |
|---|---|---|
| HTTP (Proxy) | 80 | TCP |
| HTTPS (Proxy) | 443 | TCP |
| OpenLiteSpeed Admin | 7080 | TCP |
Starting and Stopping the application¶
The application is managed via Docker Compose.
-
Starting all services:
-
Stopping all services: