Skip to content

Deployment Overview of WordPress with OpenLiteSpeed on Server

Prerequisites and Basic Requirements

To deploy the WordPress application with OpenLiteSpeed, the following environment requirements must be met:

  • Operating System: Ubuntu (as indicated by the ubuntu.yml task file).

  • Privileges: Root access is required to install Docker, manage system services, and configure network interfaces.

  • Network Access: The server must have internet access to clone repositories and pull Docker images.

  • Ports: Port 443 is configured as the external port for HTTPS traffic.

  • Domain Configuration: A valid domain name following the pattern wp<server_id>.hostkey.in is required.

FQDN of the Final Panel

The fully qualified domain name (FQDN) for accessing the WordPress installation follows a specific structure based on the server identifier. The format is:

wp<Server ID>.hostkey.in:443

Where <Server ID> is replaced by the actual unique identifier of the server instance.

File and Directory Structure

The application is deployed using a Docker-based environment cloned from a specific repository. The primary directories and files include:

  • Repository Location: /root/ols-docker-env

    • Contains the Docker Compose configuration and deployment scripts.
  • Scripts Directory: /root/ols-docker-env/bin/

    • domain.sh: Script for adding virtual hosts.

    • database.sh: Script for creating database instances.

    • appinstall.sh: Script for installing the WordPress application.

    • acme.sh: Script for managing SSL certificates.

  • Data Storage: Application data, logs, and configuration files are managed within the Docker volume structure created by the docker compose command in /root/ols-docker-env.

Application Installation Process

The deployment is executed via a Docker Compose setup using the OpenLiteSpeed Docker environment. The process includes the following steps:

  1. Update System Packages: Ensure the operating system has the latest available packages.

  2. Install Docker: Docker is installed to manage the containerized environment.

  3. Clone Repository: The OpenLiteSpeed Docker environment is cloned to /root/ols-docker-env.

  4. Start Containers: The docker compose up -d command launches the required containers (OpenLiteSpeed, MySQL, etc.).

  5. Add Virtual Host: The domain is added to the OpenLiteSpeed configuration using bin/domain.sh.

  6. Create Database: A database named wordpress is created with the user admin.

  7. Install WordPress: The application is deployed to the container environment using bin/appinstall.sh.

  8. Install SSL Certificate: The ACME client is installed, and a certificate is issued for the domain.

Docker Containers and Their Deployment

The application runs within Docker containers orchestrated by Docker Compose. The deployment relies on the docker-compose.yml file located in the /root/ols-docker-env directory.

To manage the containers, the following command is used:

docker compose up -d

The command must be executed from within the /root/ols-docker-env directory. The containers are configured to run in detached mode (-d) to start automatically and run in the background.

Proxy Servers and SSL Configuration

The deployment utilizes OpenLiteSpeed as the web server, which acts as the proxy and serves the content directly. SSL/TLS encryption is handled via the ACME protocol to ensure secure connections.

  • SSL Management: The acme.sh script is used to install the ACME client and issue certificates for the domain wp<server_id>.hostkey.in.

  • Domain: The certificate is issued for the specific domain generated by the prefix and server_id variables.

  • Protocol: Traffic is served over HTTPS on the external port.

Databases

The WordPress application is configured to use a MySQL database. The connection parameters are defined as follows:

Parameter Value
Database Name wordpress
Database User admin
Password Inherited from the SSH password
Connection Method Internal Docker network communication

The database is created using the database.sh script with the command structure: --domain wp<server_id>.hostkey.in --user admin --password <password> --database wordpress_db

Location of Configuration Files and Data

All configuration management and data persistence are handled within the Docker environment at /root/ols-docker-env.

  • Configuration: Managed via the Docker Compose definitions and scripts in the bin/ subdirectory.

  • Web Root: The document root for the WordPress installation is defined internally by the OpenLiteSpeed container configuration.

  • Certificates: SSL certificates issued by ACME are stored within the container volume structure.

Available Ports for Connection

The application exposes specific ports for external and internal communication:

Port Protocol Description
443 TCP External HTTPS access for the WordPress site.
80 TCP Typically used for HTTP redirection and ACME challenge validation (implied by ACME usage).

Starting, Stopping, and Updating

Service management for the Dockerized application is performed using Docker Compose commands executed from the /root/ols-docker-env directory.

  • Start Services:

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

  • Stop Services:

    docker compose down
    

  • Restart Services:

    docker compose restart
    

Note: Updating the application typically involves pulling the latest images and restarting the containers:

docker compose pull
docker compose up -d

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