Skip to content

WordPress

The OpenLiteSpeed WordPress One-Click app is based on a standard WordPress image, but includes several great performance enhancements, including LiteSpeed's popular LSCache optimization plugin. This Wordpress + OpenLiteSpeed + LSCache image tends to be more than 300 times faster than a regular WordPress image!

OpenLiteSpeed WordPress One-Click automatically installs OpenLiteSpeed, LSCache, WordPress and any dependences. It also automates initial setup for components like Object Cache and PHP OPCache to reduce the time it takes to optimize a web server.

Quick Start

Step 1.

Use the "OpenLiteSpeed WordPress 1-Click app" to create a Droplet with any plan you want. Click here to create an account and get a $100 Digital Ocean credit.

Use the "OpenLiteSpeed WordPress app" to create a server with any plan you want. Click here to create an account and get a $100 Vultr credit.

Use the "Deploy OpenLiteSpeed WordPress" to create a server with any plan you want. Click here to create an account

  1. Login to the Google Cloud Platform and click Launch a VM instance on Compute Engine.
    gcp 1
Method 1. Through Subscribe
  1. Subscribe to WordPress with LiteSpeed Cache
  2. Click Continue to Launch and Launch
Method 2. Through EC2 console
  1. Open the Amazon EC2 console
  2. Locate the product by searching for "WordPress with OpenLiteSpeed and LiteSpeed Cache" from AWS Marketplace
  3. Click Select,Continue,Preview and launch (the default is the most recent version)
  1. Login to the Azure Portal and click Image Link.
  2. Click the GET IT NOW and Create buttons
  3. Choose any server plan you'd like to use, and create the server

Use the "OpenLiteSpeed WordPress" from Marketplace to create an ECS instance with any plan you want.

Use the "Deploy OpenLiteSpeed WordPress" Simply go to hPanel and navigate to your VPS dashboard, select the Applications tab to create a VPS template with the desired CMS.

Use the "Deploy OpenLiteSpeed WordPress" to create a server with any plan you want. Click here to create an account

Step 2.

From a terminal on your local computer, connect to the server as root, like so:

ssh root@use_your_server_ip
ssh username@use_your_server_ip

# Instead of using "username" to SSH with, you can find the right username here: 
# Google Cloud Platform > Project > Compute Engine > Metadata > SSH Keys > Username
ssh ubuntu@use_your_server_ip
ssh azureuser@use_your_server_ip

Be sure to substitute the server’s public IP address for use_your_server_ip. You can also use Cloud Console if the platform is supported.

Note

If you try to visit the server's IP address before you SSH to the server, you’ll see a LiteSpeed landing page.

Step 3.

An interactive script that runs will prompt you for your domain or subdomain:

Please input a valid domain:
Please verify it is correct. [y/N]

Enter your root domain only. The system will automatically add the www subdomain as well.

Note

You can press CTRL+C and continue to SSH, but the prompt will open again the next time you log in. It will continue to do so until you finish the whole setup.

If your domain is already pointed to this server, you will have the option of automatically applying Let's Encrypt SSL. Enter y and your email address to complete the process:

Do you wish to issue a Let's encrypt certificate for this domain? [y/N]
Please enter your E-mail:
Please verify it is correct: [y/N]

Once finished, you should see Certificate has been successfully installed...

You can force HTTPS rules to be applied:

Do you wish to force HTTPS rewrite rule for this domain? [y/N]

Complete the process by pressing Y:

Do you wish to update the system which include the web server? [Y/n]

You should not be prompted to initiate this setup again.

Step 4.

Visit the Server’s IP or Domain in your browser to finish the wordpress installation

wpapp 1

wpapp 2

Your system is installed and ready to use!

Tip

OpenLiteSpeed and LSCache are a powerful combination for your WordPress site, right out of the box. In addition, LSCache offers a variety of optimization features that can contribute to a superior PageSpeed score for your site. These features are disabled by default, but we encourage you to explore and experiment! Learn more about the LSCache plugin's settings.

Components

The OpenLiteSpeed One-Click Image installs several packages and performs other actions on your system.

Package Installation

Component Version
Linux Ubuntu 22.04
OpenLiteSpeed Latest from LiteSpeedtech Repo
MariaDB Latest from APT
PHP Latest from LiteSpeedtech Repo
phpMyAdmin Latest from phpMyAdmin
LiteSpeed Cache Latest from WordPress.org
memcached Latest from APT
redis Latest from APT
Certbot Latest from Certbot
Postfix Latest from APT

Other Actions

  • Enables the UFW firewall to allow only SSH (port 22, rate limited), HTTP (port 80) and HTTPS (port 443) access.
  • Sets the Unix Socket to Object Cache for better performance.
  • Sets the MySQL root password, runs mysql_secure_installation, and creates a WordPress user with the necessary permissions.
  • Creates the initial WordPress configuration file to set up salt keys and allow the WordPress instance to connect to the database.
  • Modifies some PHP settings to increase the maximum filesize and execution time.
  • Enables the OpenLitespeed context to rewrite the .htaccess file so the WordPress permalink feature will work.

How to Access the Installed Software

phpMyAdmin Access

wpapp 3

Connect to phpMyAdmin at the following URL:

https://example.com/phpmyadmin

Get the MySQL root password:

sudo sed -n 1p .db_password
sudo sed -n 1p /home/ubuntu/.db_password
sudo sed -n 1p /home/ubuntu/.db_password

Get the MySQL WordPress user password:

sudo sed -n 2p .db_password
sudo sed -n 2p /home/ubuntu/.db_password
sudo sed -n 2p /home/ubuntu/.db_password

Web Server Control Panel Access

Get the WebAdmin admin password:

cat .litespeed_password
cat /home/ubuntu/.litespeed_password
cat /home/ubuntu/.litespeed_password

Visit https://use_your_droplet_ip:7080 to access WebAdmin in a browser.

By default, WebAdmin uses port 7080. To allow access to 7080 from your IP(e.g. 1.2.3.4):

ufw allow from 1.2.3.4 to any port 7080
You can also allow all IPs access to port 7080:
ufw allow 7080

wpapp 6

We suggest turning this port off once you've finished setup:

ufw delete allow 7080

Benchmark Comparison

Use the following command to test from a $5 plan server(ab) to a $5 plan server(DOMAIN)

ab -n 10000 -k -H "Accept-Encoding: gzip,deflate" -c 10 http://DOMAIN/

Requests per Second (The larger the number, the better)

Apache Openlitespeed+LSCache
47 14750

Use the following command to test from a t2.micro server(ab) to a t2.micro plan server(DOMAIN)

ab -n 10000 -k -H "Accept-Encoding: gzip,deflate" -c 10 http://DOMAIN/

Requests per Second (The larger the number, the better)

Apache Openlitespeed+LSCache
34 6780

Optional Setup

Enable HTTPS

Setting up an SSL certificate enables HTTPS on the web server, which secures the traffic between the server and the clients connecting to it. Certbot is a free and automated way to set up SSL certificates on a server.

Step 1. Register Domain

To use Certbot, you’ll need a registered domain name and DNS records:

  • An A record from the domain (e.g., example.com) to the server’s IP address

  • An A record from the domain prefaced with www (e.g., www.example.com) to the server’s IP address.

Step 2. Add Domain to Listener

Navigate to OpenLiteSpeed WebAdmin Console > Listeners, and add Your Domain to HTTP/HTTPS.

listener 1

Step 3. Certbot

Once the DNS records are set up, you can generate the SSL certificate. Be sure to substitute the correct domain name in the following command:

certbot certonly --webroot -w /var/www/html/ -d example.com -d www.example.com
If certificate verification is a success, you should find your certificate files stored in /etc/letsencrypt/

Step 4. Set SSL for HTTPS

wpapp 7

Navigate to OpenLiteSpeed WebAdmin Console > Listeners > SSL, and edit the following three items:

  • Private Key File = /etc/letsencrypt/live/example.com/privkey.pem
  • Certificate File = /etc/letsencrypt/live/example.com/fullchain.pem
  • Chained Certificate = Yes

Save and perform a Graceful Restart.

Now your server should support TLS1.1, TLS 1.2, and TLS 1.3.

Step 5. Redirect HTTP to HTTPS

wpapp 8

HTTPS traffic on port 443 is already allowed through the firewall. After you set up HTTPS, you can optionally rewrite all HTTP traffic to HTTPS.

Add the following rules to OpenLiteSpeed WebAdmin Console > Virtual Hosts > Rewrite > Rewrite Rules

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

Uploading Files

You can serve files from the web server by adding them to the web root using SFTP or other tools.

The directory is owned by the www-data user and group, but it's not recommended to log in or run as a www-data user. Instead, there are three ways that you can upload files more safely:

  1. Change the document root directory permissions temporarily
  2. Change the document root directory owner temporarily
  3. Change the document root directory group permanently (recommended if you need to SFTP from time to time)

Tip

If you set something wrong along the way, you can always run following commands to reset the directory owner and permissions back to their original settings:

sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod 0755 {} \;
sudo find /var/www/html -type f -exec chmod 0644 {} \;

Change permissions

  1. SSH to the server and change directory permissions:
    sudo chmod -R 770 /var/www/html
    
  2. Upload your files.
  3. Change the directory permissions back:
    sudo find /var/www/html -type d -exec chmod 0755 {} \;
    sudo find /var/www/html -type f -exec chmod 0644 {} \;
    

Change user

  1. SSH to the server and change the directory owner to your user (we use ubuntu as an example here):
    sudo chown -R ubuntu /var/www/html
    
  2. Upload your files.
  3. Change the directory owner back:
    sudo chown -R www-data /var/www/html
    

Change group

  1. Create a user account named sftpuser for SFTP, or choose your own preferred username.
    sudo adduser sftpuser
    
  2. Create a new wordpress group for both sftpuser and www-data users.
    groupadd wordpress
    
    Add sftpuser and www-data to the wordpress group.
    usermod -aG wordpress sftpuser
    usermod -aG wordpress www-data
    
  3. Change the document root folder group to wordpress
    chown -R www-data:wordpress /var/www/html
    
  4. Grant write permission to file's and folder's group.
    sudo find /var/www/html -type d -exec chmod 0775 {} \;
    sudo find /var/www/html -type f -exec chmod 0664 {} \;
    

Now you can SFTP to the server as sftpuser, and upload files.

Migrating Wordpress

If you already have a WordPress site elsewhere, you can migrate it using one of the following methods.

Single-Site by Duplicator Plugin

  1. Install and activate the Duplicator plugin on the WordPress site you’re copying from.
  2. Navigate to Duplicator > Packages, then click the Create New button.
  3. Go through the wizard. When you see "Package Completed," click the One-Click Download link to download two files.
  4. Move the two files (installer.php and a zip file) into the folder you’ll want the WordPress site in.
  5. Visit installer.php in a web browser and you should see a wizard screen.
  6. Click I have read and accept all terms & notices and Next
  7. You’ll need to have a database ready. Enter the database name, user, and password.
  8. Click the Site Login button and log in to your WordPress site using the same username and password as you have on the remote site.

Multi-Site by Duplicator Plugin

  1. Install plugin.
  2. Network activate plugin.
  3. On site 1, perform the backup. That will capture the entire site into a package.
  4. Restore the site in the new location just as in the Single Site procedure.

Manually by WordPress

  1. Back up WordPress
  2. Back up the database
  3. Move the directories

Install LSCache After Migration

This step is only necessary if you have migrated a WordPress installation or it's a fresh WordPress installation.

jelastic 21

To benefit from high performance and a nice page score, don't forget to install the LSCache Plugin

Improve Your Page Score

Switch Object Cache Method

wpapp 9

By default we have Memcached enabled. To swich to Redis is easy. Just copy the Redis socket path to LSCache Plugin > Settings > Advanced > Object Cache and save:

  • Memcached: /var/www/memcached.sock
  • Redis: /var/run/redis/redis-server.sock

Frequently Asked Questions

How do I Reset my Web Server WebAdmin Password?

If you forget your password, you may run the following command to reset it:

/usr/local/lsws/admin/misc/admpass.sh

It will ask for the WebAdmin username, which should be admin. Then, enter your new password.

How do I Create Additional Virtual Hosts?

This method will automatically set up Listener/VirtualHost/Force SSL/Let's Encrypt/WordPress.

Interactive mode

wget https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh
chmod +x vhsetup.sh
bash vhsetup.sh
Or just run the script without downloading it:
/bin/bash <( curl -sk https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh )

CLI mode

wget https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh
chmod +x vhsetup.sh
bash vhsetup.sh -d www.example.com -le admin@example.com -f -w
Or just run the script without downloading it:
/bin/bash <( curl -sk https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/vhsetup.sh ) -d www.example.com -le admin@example.com -f -w

  • Please be sure that your domain is already pointing to the server when using -le YOUR_EMAIL

  • Please be sure that your environment has php/sql service/sql root password when using -w

By default, OpenLiteSpeed has an example virtual host already created. You can create more virtual hosts if you like. See Create Virtual Hosts on OpenLiteSpeed.

How do I upgrade OpenLiteSpeed to latest stable version?

OpenLiteSpeed was installed from the LiteSpeed repository, so you can simply use the system update to update OpenLiteSpeed to the latest stable version.

$ sudo apt update && sudo apt upgrade openlitespeed -y

How do I upgrade to LiteSpeed Enterprise?

This script will:

  1. Generate LiteSpeed Enterprise config file from OpenLiteSpeed config

  2. Backup OpenLiteSpeed config and uninstall OpenLiteSpeed

  3. Install LiteSpeed and load the config file

/bin/bash <( curl -sk https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/Setup/ols2ent-v2.sh )

Note

We recommend you to run and test this script on a test server first. Get help by using the -H parameter for more information including how to revert back to OpenLiteSpeed if needed.

How do I Verify if Cache is Working?

There's a simple way to see if a URL is cached by LiteSpeed: the LSCache Check Tool.

Or visit your website using Chrome. Navigate to Chrome menu > More tools > Developer tools > Network, or simply use the shortcut Ctrl+Shift+I to bring it up. The test page may contain many requests, but you can just click your main domain to check the header. You might see X-LiteSpeed-Cache: miss or X-LiteSpeed-Cache: hit. Normally the first visit to a page is a miss, but subsequent visits should be a hit.

How Does Certbot's Auto Renew Script Work?

The image comes with automatic certificate renewal by default in /etc/cron.d/certbot. An example of the cron job is:

0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew

Once you finish the Let's Encrypt apply by prompt script, it will auto apply the server hook to the cronjob rule. An example of the cron job is:

0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew --deploy-hook "systemctl restart lsws"

This cron job is triggered twice every day to renew the certificate. The certbot -q renew command will check if the certificate is expiring in the next 30 days. If it is, then certbot will auto renew the certificate quietly without generating output, and auto restart the web server by hook. If the certificate is not expiring, then no action will be performed. When renewing the certificate, the same information provided during certificate creation (such as email address, domain name, web server root path etc.) will be used.

What if the Certbot Deploy Hook is not Triggered?

If your certificate renewal is successful, but for some reason the deploy hook is not being triggered, you can run the following command. This will insert a restart lsws command into the Certbot cronjobs.

echo '0 0 * * 3 root systemctl restart lsws' | sudo tee -a /etc/cron.d/certbot > /dev/null

This particular example triggers a web server restart every Wednesday at Midnight. You can modify the 0 0 * * 3 part of the command to adjust the schedule, if needed.

How do I Fix the Object Cache Test Failed Issue?

Sometimes a system upgrade may cause the config file to be updated. The first thing you can do is to check user permissions.

For Memcached:

vi /etc/memcached.conf  
Verify -u www-data.

For Redis:

vi /lib/systemd/system/redis-server.service
Verify Group=www-data.

How Do I Set Up the PageSpeed Module?

You should not need to install the PageSpeed Module if the LiteSpeed Cache plugin for WordPress is already in use. Enabling both may degrade performance by 10% or more.

To install the module, please see the OpenLiteSpeed PageSpeed Module knowledgebase article.

How do I Create Additional Databases?

Log into MySQL as root:

mysql -u root -p
Add a new database wordpress2 and user newuser with password password:
create database wordpress2;
grant all privileges on wordpress2.* to 'newuser'@'localhost' identified by "password";
Flush priveleges;
exit

How do I Install Postfix?

DEBIAN_FRONTEND=noninteractive apt -y \
-o Dpkg::Options::='--force-confdef' \
-o Dpkg::Options::='--force-confold' install postfix
yum -y install postfix

How do I Reconfigure Postfix?

Run the following command:

dpkg-reconfigure postfix 

Configure the settings as follows:

  • General type of mail configuration? Internet Site

  • System mail name: example.com (not mail.example.com)

  • Root and postmaster mail recipient: ubuntu (your user name)

  • Other destinations to accept mail for: <OK> (to use default value)

  • Force synchronous updates on mail queue? No

  • Local networks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

  • Mailbox size limit: 0

  • Local address extension character: +

  • Internet protocols to use: all

Configure Postfix to Send Mail Using Gmail

How do I Rename the Database from phpMyAdmin?

  1. Log into phpMyAdmin
  2. Click the Operations tab
  3. Under the field Rename database to: enter the new database name.
  4. Click the Go button and press OK.

How do I secure phpMyAdmin?

  • Navigate to WebAdmin > Virtual Hosts > Context
  • Change URI from /phpmyadmin to (for example) /secure
  • Navigate to WebAdmin > Virtual Hosts > Context > phpmyadmin
  • Change Access Allowed from * to (for example) 1.2.3.4 and set Access Denied to *

Please substitute 1.2.3.4 with your IPs/subnets

  • Log into SSH console and create a password file:

    $ sudo touch /usr/local/lsws/conf/PASS
    $ sudo chown lsadm:lsadm /usr/local/lsws/conf/PASS
    
  • Navigate to WebAdmin > Virtual Hosts > Security

  • Click + under Realm List then set Realm Name = example, and User DB Location = /usr/local/lsws/conf/PASS

  • Click /usr/local/lsws/conf/PASS to create a user/password

  • Navigate to WebAdmin > Virtual Hosts > Context > phpmyadmin

  • Set Realm to example

How do I Update phpMyAdmin?

The image comes with the latest phpMyAdmin version already, so you shouldn't need to update it. If you do need to update it, you can run the following commands:

cd /var/www/; mv phpmyadmin phpmyadmin.bak
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.zip
unzip phpMyAdmin-*.zip; rm -f phpMyAdmin-*.zip
mv phpMyAdmin-* phpmyadmin
cp phpmyadmin.bak/config.inc.php phpmyadmin
chown -R www-data:www-data phpmyadmin

How do I Update MariaDB?

The only reliable way to update MariaDB to a new version is to make a full backup, restore from that backup, and start the new version of MariaDB.

Back up the DB:

mysqldump -u root -p --all-databases > databasedump.sql

Update /etc/apt/sources.list.d/mariadb_repo.list with the version you want to install.

Reinstall MariaDB:

apt update && apt upgrade
apt remove mariadb-server
apt install mariadb-server -y

How do I Change PHP Parameters?

Edit the following file to configure PHP parameters:

vi /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini

NOTE: We are using LSPHP 7.4 as example. If you are using a different version, please adjust the number in the URL accordingly. To increase the allowed file size, for example, you would make the following edits:

upload_max_filesize = 64M
post_max_size = 64M

Other parameters in the file may also be changed, if needed.

OpenLiteSpeed come with php detached mode by default, so need to restart php with command killall -9 lsphp to make settings take effect

How do I Apply a Wildcard Certificate?

Please refer to this guide, click the Wildcard tab, and start from the 5. Install correct DNS plugin section.

You cannot simply get a wildcard certificate (with *.domain.com) by simply typing commands. It requires DNS verification no matter where your DNS nameserver is.

How do I Apply an ECC certificate?

Download the script to the /opt folder:

cd /opt/; wget -q  https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/scripts/generate_ecc.sh
chmod +x generate_ecc.sh

Run the script with parameters. Once the DNS records are set up, you can generate the SSL certificate. Be sure to substitute the correct domain name, email and document root in the following command:

bash generate_ecc.sh -d 'example.com' -e 'john@email.com' -w '/var/www/html/'
If certificate verification is a success, you should find your certificate files stored in /etc/letsencrypt/.

Add the certificate to the virtual host. Navigate to OpenLiteSpeed WebAdmin Console > VirtualHost > SSL, and edit the following three items:

  • Private Key File = /etc/letsencrypt/live/example.com/ecc.key
  • Certificate File = /etc/letsencrypt/live/example.com/0001_chain.pem
  • Chained Certificate = Yes

Save and perform a Graceful Restart.

Add a cronjob to run/renew the certificate automatically:

0 0 1 */2 * bash /opt/generate_ecc.sh -d 'example.com' -e 'john@email.com' -w '/var/www/html/'

How do I send email if port 25 is blocked?

Some cloud providers like Google Cloud Platform may block port 25 by default to prevent SPAM email.

We can use a Mail plugin, e.g. WP Mail SMTP, to set a specific port easily.

How do I Update the OS Name in the MariaDB Repo?

The MariaDB Package Repository is located at /etc/apt/sources.list.d/mariadb.list with the OS name specified. Once you upgrade the OS system (e.g. from Ubuntu 20.04 to Ubuntu 22.04), then you might want to update the OS name as well (i.e. from focal to jammy). You can do so manually or you can run the following script:

/bin/bash <( curl -sk https://raw.githubusercontent.com/litespeedtech/ls-cloud-image/master/scripts/fix-repo-os-name.sh )

How do I Fix a Too Many Open Files Issue?

The default system value is 1024. To increase the value to e.g. 65535, please append following content to the /etc/security/limits.conf file:

* soft     nproc          65535    
* hard     nproc          65535   
* soft     nofile         65535   
* hard     nofile         65535
root soft     nproc          65535    
root hard     nproc          65535   
root soft     nofile         65535   
root hard     nofile         65535
Then, add the following to the /etc/pam.d/common-session file:
session required pam_limits.so
To verify, run the ulimit -n command. Output should read 65535.

NOTE: 65535 is an example. Feel free to use a different value.

How do I use lsphp81?

Install PHP 8.1 and commonly used PHP extensions:

apt install lsphp81 lsphp81-common lsphp81-mysql lsphp81-memcached lsphp81-redis lsphp81-opcache lsphp81-curl lsphp81-imagick -y

Navigate to WebAdmin Console > Server Configuration > External App > lsphp, then update the following value:

  • Command: lsphp81/bin/lsphp

OpenLiteSpeed comes with PHP detached mode enabled by default. Restart PHP with command killall -9 lsphp to make these settings take effect.

How do I Set Up Virtual-Host-Specific PHP?

By default virtual hosts inherit the version of PHP that is set at the server level. You may wish to use a different PHP version for certain virtual hosts. Follow the steps below to set up virtual-host-level PHP. Here we will use the PHP version 7.4 as an example.

Install PHP 7.4 and commonly used PHP extensions:

apt install lsphp74 lsphp74-common lsphp74-curl lsphp74-imagick lsphp74-imap lsphp74-json lsphp74-memcached lsphp74-mysql lsphp74-opcache lsphp74-redis -y

Navigate to WebAdmin console > Server Configuration > External App > Add > Type > LiteSpeed SAPI App to set up a server-level external application. Set the following values:

  • Name: lsphp74
  • Address: uds://tmp/lshttpd/lsphp74.sock
  • Max Connections: 35
  • Environment: LSAPI_AVOID_FORK=200M
  • Initial Request Timeout (secs): 60
  • Retry Timeout (secs): 0
  • Command: /usr/local/lsws/lsphp74/bin/lsphp
  • Instances: 1

Navigate to WebAdmin console > Virtual Hosts > your vhost > Script Handler > Add to add a virtual-host-level PHP handler. Set the following values:

  • Suffixes: php
  • Handler Type: LiteSpeed SAPI
  • Handler Name: [Server Level]:lsphp74

OpenLiteSpeed comes with PHP detached mode enabled by default. Restart PHP with command killall -9 lsphp to make these settings take effect.

API Creation

In addition to creating a Droplet from the Openlitespeed WP 1-Click application using the control panel, you can also use the DigitalOcean API.

The following example creates an Openlitespeed WP 22.04 Droplet called “My-Droplet” in the NYC3 datacenter, with 1 GB RAM:

curl -X POST "https://api.digitalocean.com/v2/droplets" \
    -d'{"name":"My-Droplet","region":"nyc3","size":"s-1vcpu-1gb","image":"litespeedtechnol-openlitespeedwor-20-04"}' \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"

In addition to creating an instance from the WordPress with LiteSpeed Cache using the AWS Management Console, you can also use the AWS Command Line Interface.

The following example creates an t2.micro Instance with WordPress+LiteSpeed Cache AMI:

aws ec2 run-instances --image-id ami-06667d7d3b4568571 \
                        --subnet-id subnet-XXXXXXX \
                        --security-group-ids sg-XXXXXXXXXXXXXX \
                        --count 1 \
                        --instance-type t2.micro \
                        --key-name XXXXXX \
                        --query "Instances[0].InstanceId"
Please replace XXX to your own settings.

Get the exact name of the WordPress image from LiteSpeed's project, gc-image-pub:

gcloud compute images list --project=gc-image-pub --filter="name ~ 'openlitespeed-with-wordpress'"

Create an instance, replacing INSTANCE_NAME with the name of your choice, and IMAGE_NAME with the name obtained from the previous command:

gcloud compute instances create INSTANCE_NAME --image-project=gc-image-pub --image=IMAGE_NAME

The first time you launch, you may need to accept the marketplace terms using the following command:

Get-AzureRmMarketplaceTerms \
    -Publisher "litespeedtechnologies" \
    -Product "openlitespeed-wordpress" \
    -Name "openlitespeed-wordpress" \
    | Set-AzureRmMarketplaceTerms -Accept
Find the release version you prefer:
az vm image list \
    --location westus \
    --publisher litespeedtechnologies \
    --offer openlitespeed-wordpress \
    --all \
    --output table
Launch VM from that image:
az vm create \
    --resource-group your-group \
    --image litespeedtechnologies:openlitespeed-wordpress:wordpress-v2:6.3.1 \
    --name myVM \
    --admin-username azure

Feel free to replace resource-group, image version, name, admin name, --generate-ssh-keys and more options with your own preferences.


Last update: October 24, 2023