Deploying a WordPress Blog on OpenLiteSpeed: Full Setup Guide

WordPress blog connected to OpenLiteSpeed server

Creating a WordPress blog on OpenLiteSpeed is a powerful way to get high performance with full control over your server. While the setup involves several technical steps, each part follows a clear and repeatable pattern. Once completed, you’ll have a fast, secure WordPress blog ready for production.

This guide walks through the entire process step by step, from server preparation to a live WordPress blog.


Step 1: Point Your Domain to the Server

Before configuring OpenLiteSpeed, your domain must resolve to the server.

At your DNS provider, create the following records:

  • An A record pointing the root domain to your server IP
  • (Optional) An A record for www pointing to the same IP

Wait until DNS propagation completes before continuing.


Step 2: Create the Website Directory

Each WordPress site should live in its own directory.

Create the directory structure:

/var/www/yourdomain/html

Set correct ownership and permissions so OpenLiteSpeed can read and write files:

chown -R lsadm:lsadm /var/www/yourdomain
chmod -R 755 /var/www/yourdomain

Create a temporary test file:

echo "Site works" > /var/www/yourdomain/html/index.html

Step 3: Create the Virtual Host Configuration File

OpenLiteSpeed requires a dedicated configuration file for each virtual host.

Create the folder and file:

/usr/local/lsws/conf/vhosts/yourdomain/vhconf.conf

Add the following content:

docRoot $VH_ROOT/html/

index {
  useServer 0
  indexFiles index.php, index.html
}

Ensure the file is owned by OpenLiteSpeed:

chown -R lsadm:lsadm /usr/local/lsws/conf/vhosts/yourdomain

Step 4: Add the Virtual Host in OpenLiteSpeed

In the OpenLiteSpeed Admin panel:

  • Go to Virtual Hosts
  • Click Add
  • Set the Virtual Host Name
  • Set the Virtual Host Root to /var/www/yourdomain/
  • Set the Config File to conf/vhosts/yourdomain/vhconf.conf

Save the configuration.


Step 5: Configure the Document Root

Inside the Virtual Host settings:

  • Set Document Root to:
$VH_ROOT/html

Save the changes.


Step 6: Map the Domain to the Virtual Host

This step tells OpenLiteSpeed which domain should use this virtual host.

In Listeners → Default → Virtual Host Mappings:

  • Add your domain and optional www domain
  • Assign them to the Virtual Host
  • Set the context to /

Save the mapping.


Step 7: Enable Scripts and Add Context

WordPress requires PHP execution.

Enable Scripts

In Virtual Hosts → Security:

  • Enable Scripts/ExtApps

Add Static Context

Add a context with:

  • URI: /
  • Location: $VH_ROOT/html/

Save the changes.


Step 8: Restart OpenLiteSpeed

Apply all configuration changes with a graceful restart:

  • Go to Actions
  • Click Graceful Restart

Then test the site in your browser using HTTP.


Step 9: Create the WordPress Database

Log in to MariaDB:

sudo mariadb

Create the database and user:

CREATE DATABASE blog_db CHARACTER SET utf8mb4;
CREATE USER 'blog_user'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON blog_db.* TO 'blog_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Save these credentials for the WordPress setup.


Step 10: Install WordPress Files

Navigate to the site directory:

cd /var/www/yourdomain/html

Download and extract WordPress:

wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz

Set ownership:

chown -R lsadm:lsadm .

Step 11: Complete WordPress Installation

Open your domain in a browser.

Follow the WordPress installer:

  • Enter database name, user, and password
  • Create an admin account
  • Set your blog title

After completion, your WordPress blog will be live.


Step 12: Secure the Blog with SSL

Create the Let’s Encrypt challenge directory:

mkdir -p /var/www/yourdomain/html/.well-known/acme-challenge

Issue the certificate:

certbot certonly --webroot -w /var/www/yourdomain/html -d yourdomain.com -d www.yourdomain.com

Configure SSL in OpenLiteSpeed by setting the certificate and private key paths, then perform another graceful restart.


Conclusion

Setting up a WordPress blog on OpenLiteSpeed follows a logical sequence: prepare the domain, configure the virtual host, install WordPress, and secure it with SSL. While the process is technical, it becomes straightforward once you understand the flow.

With OpenLiteSpeed and WordPress working together, you get a fast, efficient blog platform that’s ready to scale and easy to replicate for future sites.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *