WordPress on Plesk and LiteSpeed: safe updates and 503 fixes, CloudyWP guide
Luke Anderson WordPress

WordPress on Plesk and LiteSpeed: How to Update Safely and Fix 503 Errors

On a Plesk server running LiteSpeed behind Cloudflare, a 503 after a plugin or WordPress update almost always comes from one of five places: WordPress’s own maintenance file, PHP (LiteSpeed’s lsphp) crashing or hitting a limit, LiteSpeed not running or handing the server back to Apache, the server itself running out of memory, disk or CPU, or Cloudflare cutting off a long request part way. Each of those layers writes to a different log. Once you know which log belongs to which layer, a 503 takes minutes to trace instead of hours.

This guide is for anyone who looks after WordPress sites on that kind of stack: several sites on one AWS EC2 instance, managed through Plesk, served by LiteSpeed Web Server with the LiteSpeed Cache plugin, and Cloudflare in front. It covers how the setup differs from ordinary hosting, what plugin updates and WordPress core updates can break, a six-check runbook for a 503, the exact commands at each layer, and the update routine that stops most of these problems happening at all.

We wrote it after a WordPress core update on exactly this setup returned a 503. The error page looked like it came from Apache, and for a while it was not obvious where to start looking. Restoring the previous version brought the site back. This is the guide we would have wanted open on the second screen that day.

How this setup differs from ordinary WordPress hosting

Most WordPress sites sit on a simple chain: Cloudflare, then the site, then a hosting company. The hosting company owns the server. When something goes wrong below WordPress, you open a ticket and they look at the web server and PHP logs for you.

On a Plesk server on EC2, you are the hosting company. The chain has more links, each link can fail on its own, and nobody else is watching them.

Typical managed hostingPlesk + LiteSpeed on EC2
Who runs the serverThe hostYou
Web serverWhatever the host chose; you rarely see itLiteSpeed Web Server, in place of Apache
PHPSet by the hostSet per domain in Plesk, run by LiteSpeed as lsphp
Page cacheHost’s cache or a pluginLiteSpeed’s server-level cache, driven by the LSCache plugin
LogsIn the host’s dashboard, if at allFive different places on the server (see the diagram)
Other sitesOn someone else’s serverOn your server, sharing the same CPU, RAM and disk
BackupsHost’s daily backupWhatever you set up: Plesk, WP Toolkit, EBS snapshots
Who fixes a 503Host supportYou
Diagram of a Plesk and LiteSpeed server on AWS EC2 behind Cloudflare, with the log file for each layer
Each layer can fail on its own, and each one logs in a different place.

Plesk: the control panel that owns the accounts

Plesk is the management layer. For WordPress it matters in five ways:

  • Each subscription is a system user. The files of each site belong to that user. If you upload or edit files as root, they become owned by root, WordPress can no longer write to them, and the next update fails with “Could not create directory” or asks for FTP details. plesk repair fs example.com.au puts ownership and permissions back.
  • PHP version is set per domain in Websites & Domains → PHP Settings. Two sites on the same server can run different PHP versions, and the PHP you get in an SSH shell is often not the one the site uses.
  • WP Toolkit lists every WordPress install, runs updates, creates restore points, clones sites to staging and can switch on automatic updates. It is the safest way to update from the panel.
  • Security tools sit in front of WordPress: Fail2ban can ban an IP address after repeated failed requests, and ModSecurity (the Web Application Firewall) can block requests that look like attacks, including some admin and update requests.
  • Per-site logs are in /var/www/vhosts/system/example.com.au/logs/ and in the panel under Websites & Domains → Logs.

LiteSpeed Web Server: Apache’s replacement, not Apache

LiteSpeed Web Server (LSWS) is a drop-in replacement for Apache. It reads Apache’s configuration and your .htaccess files, so sites move across without changes. Underneath, it behaves differently in ways that matter during updates:

  • PHP runs as lsphp, LiteSpeed’s own PHP process manager, not PHP-FPM or mod_php. On Plesk, LiteSpeed follows Plesk’s PHP settings, and its documentation asks for the PHP handler to be set to FastCGI so the two agree.
  • One PHP handler per subscription. LiteSpeed keeps a group of PHP workers per account, and they stay running between requests. That is fast, but it also means OPcache can hold old compiled code after files change, until those workers restart.
  • LiteSpeed has its own limits on PHP processes: memory limits, process limits and connection timeouts set in the WebAdmin console (port 7080). When PHP hits one of them, the visitor gets a 503, not a PHP error.
  • LiteSpeed kills PHP when the visitor disconnects, unless told not to. A long update run from wp-admin can be stopped half way if the browser connection drops.
  • If its licence cannot be verified, LiteSpeed switches the server back to Apache. LiteSpeed’s documentation describes this fallback. Apache may then serve your sites with a different configuration, and the error pages say Apache. If you ever see an Apache error on a LiteSpeed server, check this first.
  • Plesk’s nginx reverse proxy must be off. LiteSpeed takes over ports 80 and 443 directly.
  • Logs: /usr/local/lsws/logs/error.log for the web server and /usr/local/lsws/logs/stderr.log for anything PHP printed when it crashed.

LiteSpeed Cache: a page cache inside the web server

The LiteSpeed Cache plugin does not store pages itself; it tells the web server what to cache and when to purge it. Two consequences after an update: cached pages can still point at old CSS and JavaScript files that the update removed, and the plugin writes its own rules into .htaccess between # BEGIN LSCACHE and # END LSCACHE. If an update breaks the layout but not the site, a cache purge is usually the fix.

Cloudflare in front

Cloudflare hides your server’s IP address, caches static files and filters traffic. During updates it matters for three reasons:

  • It waits 125 seconds for a response, then shows error 524. A slow update run through wp-admin can hit that limit; the browser shows an error while the server may still be working, or may stop.
  • Every visitor’s IP looks like a Cloudflare IP unless LiteSpeed is set to read the real one from Cloudflare’s header. Without that, Fail2ban can ban a Cloudflare address and take a site offline for a whole region.
  • Its error pages are branded with a Ray ID. If you see one, Cloudflare is describing your server, not causing the problem.

AWS EC2: one machine for every site

All the sites share one instance’s CPU, memory and disk. Burstable instances (the t3 and t4g families) run on CPU credits: when the credits run out, the CPU slows to its baseline and every site slows with it. Most EC2 images have no swap, so when memory runs out the Linux OOM killer stops a process, often lsphp or the database. EBS snapshots are the one backup that captures the whole server in one step, and they take minutes.

What can go wrong when you update plugins

Each of these has a different symptom. The symptom tells you which layer to look at.

A fatal error in the new version

Symptom: “There has been a critical error on this website” (HTTP 500), or a 503 if the error crashes the PHP process itself. WordPress usually emails the admin address with the plugin name.

Why: the new version calls a function that does not exist on your PHP version, clashes with another plugin, or simply has a bug.

Fix: find the plugin name in the site’s error_log, deactivate it with WP-CLI, then install the last version that worked. Commands are in the runbook below.

The plugin now needs a newer PHP version

Symptom: WordPress refuses the update (“requires PHP 8.1”), or, if the update was forced or automatic, a fatal error about syntax or a missing function.

Fix: check the plugin’s “Requires PHP” line before updating. Change the domain’s PHP version in Plesk on a staging copy first, test, then change it on the live site. Never change PHP and update plugins in the same step; you will not know which one broke the site.

The update ran out of memory or time

Symptom: a 503, or the update stops half way. Large plugins (WooCommerce, page builders, security suites) unpack thousands of files.

Why: PHP’s memory_limit or max_execution_time, or LiteSpeed’s own memory limit for the PHP process, was hit. LiteSpeed enforces its limit by ending the process, which the visitor sees as a 503.

Fix: raise memory_limit to 256M or 512M in Plesk’s PHP settings for that domain, and check LiteSpeed’s PHP memory limits in WebAdmin. Better still, run the update over SSH with WP-CLI, where the web server’s limits do not apply.

The update was interrupted

Symptom: “Briefly unavailable for scheduled maintenance” (a 503 sent by WordPress), a plugin that has vanished from the list, or a plugin folder with only some of its files.

Why: the browser tab was closed, Cloudflare gave up at 125 seconds, or LiteSpeed killed PHP when the connection dropped. WordPress had already written its .maintenance file and replaced some files.

Fix: delete .maintenance from the site’s root folder, then reinstall the plugin cleanly with WP-CLI. On LiteSpeed, set the noabort rule (shown in the prevention section) so updates and cron jobs finish even if the connection drops.

File ownership or permissions

Symptom: WordPress asks for FTP credentials, or shows “Could not create directory” or “Installation failed”.

Why: some files are owned by root or another user, usually after someone uploaded files over SFTP as root or ran WP-CLI as root.

Fix: plesk repair fs example.com.au, and from then on run WP-CLI as the site’s own system user.

Old cached pages and assets

Symptom: the site loads but the layout is broken, buttons do nothing, or the page looks different logged in and logged out.

Why: LiteSpeed Cache or Cloudflare is still serving pages that point at CSS or JavaScript files the update replaced, often combined and minified copies.

Fix: purge LiteSpeed Cache (wp litespeed-purge all), then purge Cloudflare. In that order: if Cloudflare is purged first, it can fill itself again from the old LiteSpeed copies.

A broken .htaccess

Symptom: a 500 error on every page, straight after updating a cache, security or redirect plugin.

Why: the plugin rewrote .htaccess with a rule the server cannot read.

Fix: rename .htaccess to .htaccess.broken, check the site loads (permalinks will 404), then save Settings → Permalinks to write a clean file and add back the plugin’s rules one block at a time.

ModSecurity or Fail2ban blocks you

Symptom: a 403 Forbidden on the update request, or the whole site times out for you but works on your phone’s mobile data.

Fix: in Plesk, Tools & Settings → Web Application Firewall shows which rule fired; switch that one rule off for the domain rather than disabling ModSecurity. In Tools & Settings → IP Address Banning (Fail2ban), unban your IP address and add it to the trusted list.

A database upgrade is waiting

Symptom: a notice asking you to update the database (WooCommerce, Elementor and others), or errors until you do.

Fix: run it straight after the plugin update: wp wc update for WooCommerce, or the button in wp-admin. On a large shop, run it outside busy hours: it can slow the shared database server for every site on the instance.

What can go wrong when you update WordPress core

A core update works in stages: WordPress downloads the new version, unpacks it into wp-content/upgrade, writes .maintenance to put the site into maintenance mode, copies the new files over the old ones, upgrades the database if needed, then deletes .maintenance. A failure at any stage leaves a different mess.

Stopped half way: maintenance mode or mixed files

If the update stops after .maintenance is written, every visitor gets WordPress’s own 503: “Briefly unavailable for scheduled maintenance. Check back in a minute.” WordPress ignores a .maintenance file older than ten minutes, so if the 503 page changes to a fatal error after ten minutes, the files are half old and half new. The fix is the same either way: reinstall the core files cleanly, keeping wp-content and wp-config.php.

cd /var/www/vhosts/example.com.au/httpdocs
rm -f .maintenance
wp core download --version=X.Y.Z --skip-content --force
wp core verify-checksums

Use the version you were updating to, or the version you were on, whichever you want to end up with. wp core verify-checksums compares every core file with the official copy and lists anything that does not match.

Not enough memory, disk or time

The core update unpacks the whole of WordPress. On a server with little free disk, or a PHP process with a low memory limit, it fails part way. If PHP was killed by LiteSpeed’s memory limit, stderr.log says so, and the visitor sees a 503 rather than a PHP error. Check df -h before every core update; keep at least a few gigabytes free on the partition that holds /var/www and /tmp.

PHP is too old (or too new) for the new version

Each WordPress release states the PHP versions it supports. A site still on an old PHP version may update but then fail in a plugin that assumed newer PHP. Check the domain’s PHP version in Plesk before a major update.

OPcache still holds the old code

LiteSpeed keeps PHP workers running for each subscription. After the core files change, those workers can keep using compiled copies of the old files for a short time, which shows up as odd, inconsistent errors that come and go. LiteSpeed’s documentation names zend_mm_heap corrupted in stderr.log as a sign of an OPcache problem. Restart the PHP workers:

sudo touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt
sudo /usr/local/lsws/bin/lswsctrl restart

lswsctrl restart is a graceful restart: requests in progress finish first. It still affects every site on the server for a moment, so do it deliberately.

Every site updates at once

With automatic updates switched on for every site, WordPress can update several sites on the same instance within minutes of each other. Each unpacks files, runs database upgrades and rebuilds caches at the same time. On a small instance that can use up the memory or the CPU credits, and the 503s then appear on sites that were not even being updated. Stagger updates, or run them yourself one site at a time.

The 503 runbook: find the failing layer in six checks

Work through these in order and stop at the first one that explains the error. Note the time the error started before you change anything: every log below is ordered by time.

Six checks to find which layer caused a WordPress 503 after an update on Plesk and LiteSpeed
Stop at the first check that answers yes.

Check 1: is it Cloudflare or your server?

Ask your server directly, skipping Cloudflare. Replace the address with your server’s public IP from the EC2 console:

curl -sI https://example.com.au/ --resolve example.com.au:443:203.0.113.10
  • If this works (200) but the public site fails, the problem is between Cloudflare and the server: the security group, the SSL mode, or a Cloudflare rule.
  • If this also fails, look at the server: line. LiteSpeed means LiteSpeed answered; Apache means Apache answered (go to check 3). Through Cloudflare the header always says cloudflare, which is why you test directly.
  • Cloudflare’s own codes describe your server: 521 means it refused the connection, 522 means the connection timed out, 524 means it connected but did not answer within 125 seconds.

If your security group only accepts traffic from Cloudflare’s IP ranges, run the curl from the server itself, or allow your own IP for the test.

Check 2: is WordPress in maintenance mode?

curl -s https://example.com.au/ --resolve example.com.au:443:203.0.113.10 | grep -i "briefly unavailable"
ls -la /var/www/vhosts/example.com.au/httpdocs/.maintenance

If either finds something, WordPress itself sent the 503 because an update did not finish. Check what state the files are in, then remove the flag:

cd /var/www/vhosts/example.com.au/httpdocs
wp core verify-checksums
wp plugin verify-checksums --all
rm .maintenance

If the checksums show modified or missing files, reinstall core or the plugin named in the output (commands in check 5) before removing .maintenance.

Check 3: is LiteSpeed running, or did Apache take over?

sudo /usr/local/lsws/bin/lswsctrl status
sudo ss -lntp | grep -E ':(80|443) '
sudo tail -n 100 /usr/local/lsws/logs/error.log

ss shows which program is listening on ports 80 and 443: litespeed or lshttpd is what you want; httpd or apache2 means Apache is serving. If LiteSpeed fell back to Apache, the error log usually says why (most often the licence check). Fix the cause, then switch back:

sudo /usr/local/lsws/admin/misc/cp_switch_ws.sh lsws

If LiteSpeed is stopped and will not start, its error.log has the reason on the last lines.

Check 4: did PHP crash or hit a LiteSpeed limit?

sudo tail -n 100 /usr/local/lsws/logs/stderr.log
sudo grep -iE "memory|fork|too many open files|zend_mm_heap|timeout" /usr/local/lsws/logs/error.log | tail -n 50

LiteSpeed’s 503 troubleshooting guide lists the messages to look for:

  • “Allowed memory size … exhausted”: PHP’s own memory_limit. Raise it in Plesk → PHP Settings for the domain.
  • “fork() failed … Cannot allocate memory”: the server or LiteSpeed’s process limit is out of memory. Check free -m, and the PHP memory limits in WebAdmin.
  • “Too many open files”: raise the open-files limit for LiteSpeed.
  • “zend_mm_heap corrupted”: an OPcache problem. Restart lsphp with the two commands in the OPcache section above.
  • Timeouts or “reached max children” style messages: all PHP workers were busy. Either one site is stuck (look at its access log for a flood of requests) or the limit is too low for the number of sites.

Check 5: is there a PHP fatal error for this site?

sudo tail -n 50 /var/www/vhosts/system/example.com.au/logs/error_log

A fatal error names the file and line, and the path tells you which plugin or theme it came from, for example wp-content/plugins/some-plugin/.... Switch that plugin off without loading it:

cd /var/www/vhosts/example.com.au/httpdocs
wp plugin deactivate some-plugin --skip-plugins --skip-themes

If WP-CLI itself cannot load, rename the folder instead: mv wp-content/plugins/some-plugin wp-content/plugins/some-plugin.off. Then roll back to the version that worked, and only then switch it back on:

wp plugin install some-plugin --version=X.Y.Z --force
wp plugin activate some-plugin

For a theme, switch to a default theme with wp theme activate twentytwentyfive and roll the theme back the same way. For WordPress core, wp core update --version=X.Y.Z --force installs a specific earlier version over the current one.

If the log is empty, switch on WordPress’s own log for a few minutes in wp-config.php, reproduce the error, then switch it off again:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Errors then go to wp-content/debug.log. Delete that file afterwards: it can contain file paths and data you do not want public.

Check 6: is the whole server short of something?

df -h
df -i
free -m
sudo dmesg -T | grep -iE "out of memory|killed process" | tail
uptime
  • Disk full (df -h near 100%) or no inodes left (df -i): updates cannot unpack. Clear old backups, logs and the wp-content/upgrade folder.
  • OOM killer lines in dmesg: Linux stopped a process to free memory. If it stopped the database, every site shows “Error establishing a database connection”; if it stopped lsphp, you get 503s. Restart the stopped service, then add swap or memory.
  • High load in uptime on a burstable instance: open CloudWatch for the instance and look at CPUCreditBalance. If it is at zero, the CPU is throttled until credits build up again.

If nothing points anywhere: restore first, debug later

When all six checks come back clean and the site is still down, restore and investigate on a copy. In order of speed: the WP Toolkit restore point made before the update, then a Plesk backup of the subscription, then the EBS snapshot (restore it as a new volume and copy the site folder and database across, rather than replacing the server’s disk). Once the site is back, clone it to staging and repeat the update there with WP_DEBUG_LOG on.

Example: a 503 after a WordPress core update, worked through

Here is how the incident that started this guide would go through the runbook today. The setup: four WordPress sites on one EC2 instance, Plesk, LiteSpeed with LSCache on every site, Cloudflare in front. WordPress core was updated from wp-admin on one site, and the site returned a 503 page that looked like Apache’s.

  1. Note the time and open a terminal on the server.
  2. Check 1. The curl --resolve request to the server’s own IP also returns 503, so it is not Cloudflare. The server: header is the deciding clue: if it says Apache, LiteSpeed is not the one answering.
  3. Check 2. Search the page for “briefly unavailable” and look for .maintenance. If it is there, the core update stopped part way, perhaps because the browser waited too long through Cloudflare or LiteSpeed stopped PHP when the connection closed.
  4. Check 3. If Apache answered, lswsctrl status and the LiteSpeed error.log show whether LiteSpeed stopped or fell back, and why.
  5. Check 4 and 5. stderr.log and the site’s error_log around the noted time show whether PHP crashed on memory, or a plugin failed against the new core files.
  6. Fix or roll back. Remove .maintenance, reinstall core cleanly with wp core download --skip-content --force and wp core verify-checksums, purge LSCache and Cloudflare. If that does not bring the site back within a few minutes, restore the restore point and repeat the update on staging.

Restoring the old version, as we did that day, was the right call for the visitors. The runbook is what turns “it came back” into “we know why”, so the next update does not fail the same way.

How to update plugins and WordPress safely on this setup

This is the routine we recommend for several sites on one Plesk server. It takes longer than clicking “Update all” in WP Toolkit, and it is the difference between a quiet update night and a morning of 503s.

Eight-step routine for updating WordPress plugins and core safely on a shared Plesk and LiteSpeed server
One site at a time, with a backup and a staging test before anything changes live.

Step 1: take an inventory of every site

List what each site runs and what is waiting to update. Run WP-CLI as each site’s own user, so no file ends up owned by root:

for dir in /var/www/vhosts/*/httpdocs; do
  [ -f "$dir/wp-config.php" ] || continue
  owner=$(stat -c %U "$dir")
  echo "=== $dir ($owner)"
  sudo -u "$owner" wp --path="$dir" core version
  sudo -u "$owner" wp --path="$dir" core check-update --fields=version,update_type
  sudo -u "$owner" wp --path="$dir" plugin list --update=available --fields=name,version,update_version
  sudo -u "$owner" wp --path="$dir" theme list --update=available --fields=name,version,update_version
done

Two Plesk details: the php in your SSH shell may not be the version the site runs, so call WP-CLI with the site’s PHP when it matters, for example /opt/plesk/php/8.3/bin/php /usr/local/bin/wp .... And WP Toolkit can run WP-CLI for you against a specific install with plesk ext wp-toolkit --wp-cli -instance-id 3 -- plugin list (list the IDs with plesk ext wp-toolkit --list).

Also note the free disk space (df -h) and each domain’s PHP version.

Step 2: read before you update

For each update, check three things on its wordpress.org page or changelog: is it a major version (2.x to 3.0), does it raise “Requires PHP”, and does it mention a database upgrade. Those are the updates to do one at a time, on staging first. Minor and patch releases of well-kept plugins can go together.

Step 3: back up

  • Every update: a WP Toolkit restore point (tick the option when you update from WP Toolkit), or a database export and file copy as described in our manual WordPress backup guide.
  • Before a core update, a PHP change or anything server-wide: an EBS snapshot of the instance’s volume as well. It covers every site at once and takes minutes:
aws ec2 create-snapshot --volume-id vol-0123456789abcdef0 --description "before updates 2026-11-22"

Check that the backup actually finished before you go on.

Step 4: test on staging

Clone the site to a staging subdomain with WP Toolkit (Clone), make sure the clone is not indexed by search engines, run the same updates there and click through the pages that earn money: home page, contact form, checkout, booking. If staging breaks, you have learned it for free.

Step 5: update the live site over SSH, one site at a time

Run updates from a terminal on the server, not from wp-admin through Cloudflare. WP-CLI on the server is not subject to Cloudflare’s 125-second limit or LiteSpeed’s connection handling, and it prints exactly what failed.

cd /var/www/vhosts/example.com.au/httpdocs
sudo -u example_user wp plugin update contact-form-7
sudo -u example_user wp plugin update --all --exclude=woocommerce,elementor
sudo -u example_user wp plugin update woocommerce
sudo -u example_user wp wc update
sudo -u example_user wp theme update --all
sudo -u example_user wp core update
sudo -u example_user wp core update-db
sudo -u example_user wp language core update

Update the heavy plugins on their own lines so a failure points at one plugin. Leave several minutes between the plugin updates and the core update, and check the site in between.

If you must update from wp-admin, use WP Toolkit’s update screen in Plesk rather than WordPress’s own, and do it while connected to the server directly, not through a slow connection.

Step 6: purge the caches

sudo -u example_user wp litespeed-purge all

Then purge Cloudflare (Caching → Configuration → Purge Everything, or a purge by URL for the main pages). LiteSpeed first, Cloudflare second.

Step 7: verify

Check the response codes of the important pages straight from the server, then read the logs:

for path in / /contact/ /shop/ /wp-login.php; do
  printf "%s %s\n" "$(curl -s -o /dev/null -w '%{http_code}' https://example.com.au$path --resolve example.com.au:443:203.0.113.10)" "$path"
done
sudo tail -n 20 /var/www/vhosts/system/example.com.au/logs/error_log
sudo -u example_user wp core verify-checksums

Then do the human checks: log in, send the contact form, add something to the cart. Compare against how the site behaved before the update.

Step 8: wait, then do the next site

Watch the error log for the next hour. Real visitors find problems that test clicks do not. Only then start the next site on the same instance. If something does break, restore from step 3, write down what broke, and try that update again on staging later.

Settings that prevent most of these problems

LiteSpeed

  • Let updates and cron finish. LiteSpeed’s documentation describes a noabort setting that stops it killing PHP when the connection drops. Add it for the scripts that need it, inside the site’s .htaccess, above the WordPress block:
<IfModule Litespeed>
RewriteEngine On
RewriteRule (wp-cron|update-core|update|admin-ajax)\.php - [E=noabort:1,E=noconntimeout:1]
</IfModule>
  • Size the PHP limits for the number of sites. In WebAdmin, check the PHP memory limits and the number of PHP processes allowed per account. Four sites each allowed to use all the memory is a 503 waiting to happen.
  • Read the real visitor IP from Cloudflare. In WebAdmin → Configuration → Server → General, set “Use Client IP in Header” to trust the header from Cloudflare’s IP ranges, so logs, Fail2ban and security plugins see the visitor, not Cloudflare.
  • Watch the licence. A licence problem quietly hands the server to Apache. If you would rather LiteSpeed stayed in charge, its documentation describes how to stop the automatic fallback.

Plesk

  • Keep each domain’s PHP handler on FastCGI, as LiteSpeed’s Plesk documentation requires, and set memory_limit to 256M or more and max_execution_time to 300 for WordPress sites.
  • In WP Toolkit, turn off automatic updates for major versions, or set the sites to update on different days.
  • Add your office IP address to Fail2ban’s trusted list, and keep ModSecurity on, switching off single rules per domain when they block legitimate requests.
  • Schedule Plesk backups to remote storage (for example Amazon S3), not only to the same server.
  • Keep Plesk’s nginx reverse proxy stopped while LiteSpeed is the web server.

WordPress

  • Move WP-Cron to a real schedule. Add define( 'DISABLE_WP_CRON', true ); to wp-config.php, then in Plesk → Scheduled Tasks run wp cron event run --due-now --path=/var/www/vhosts/example.com.au/httpdocs every 5 minutes, at different minutes for each site, so the cron jobs of four sites do not start together.
  • Set define( 'WP_MEMORY_LIMIT', '256M' ); so WordPress asks PHP for enough memory.
  • Keep the number of plugins down. Every plugin is another thing to update and another thing that can fail.

Cloudflare

  • Do not cache wp-admin or pages for logged-in users. Let LiteSpeed Cache handle HTML; use Cloudflare for static files, unless you have set up the two to purge together.
  • Run long jobs (updates, imports, backups) over SSH, never through Cloudflare.
  • If you restrict the security group to Cloudflare’s IP ranges, keep a rule for your own IP so you can test the server directly.

AWS EC2

  • Add swap so a short memory spike slows the server down instead of killing PHP or the database:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
  • Set CloudWatch alarms for CPU credit balance, disk space and status checks.
  • Automate EBS snapshots with Amazon Data Lifecycle Manager, for example daily with a week kept.
  • If the sites regularly run out of CPU credits, move to a larger instance rather than tuning around it.

Monitoring

Monitor each site from outside with an uptime check, and if you can, one check through Cloudflare and one straight to the server. When only the direct check fails, you know it is the server; when only the Cloudflare one fails, you know where to look before you open a terminal.

Quick reference: commands by layer

# Cloudflare or server?
curl -sI https://example.com.au/ --resolve example.com.au:443:SERVER_IP

# WordPress
rm -f .maintenance
wp core verify-checksums
wp plugin verify-checksums --all
wp plugin deactivate PLUGIN --skip-plugins --skip-themes
wp plugin install PLUGIN --version=X.Y.Z --force
wp core download --version=X.Y.Z --skip-content --force
wp litespeed-purge all

# LiteSpeed
sudo /usr/local/lsws/bin/lswsctrl status
sudo /usr/local/lsws/bin/lswsctrl restart
sudo touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt
sudo /usr/local/lsws/admin/misc/cp_switch_ws.sh lsws
sudo tail -n 100 /usr/local/lsws/logs/error.log
sudo tail -n 100 /usr/local/lsws/logs/stderr.log

# Plesk
sudo tail -n 50 /var/www/vhosts/system/DOMAIN/logs/error_log
sudo plesk repair fs DOMAIN
sudo plesk ext wp-toolkit --list

# Server
df -h; df -i; free -m; uptime
sudo dmesg -T | grep -iE "out of memory|killed process"

Further reading

Common questions

Why does my WordPress site show a 503 after an update?

Usually because the update did not finish (WordPress’s maintenance file is still there), because PHP ran out of memory or hit a LiteSpeed limit while unpacking files, or because the server itself ran short of memory, disk or CPU. A fatal error in a plugin normally gives a 500 instead, unless it crashes the PHP process.

Is a 503 on LiteSpeed a server problem or a WordPress problem?

Either. If the page says “Briefly unavailable for scheduled maintenance”, WordPress sent it. If it is LiteSpeed’s or Apache’s error page, the web server sent it because PHP did not answer, and stderr.log usually says why.

Why did the error page say Apache when the server runs LiteSpeed?

Either Plesk’s Apache was answering because LiteSpeed had stopped, or LiteSpeed had switched the server back to Apache after a failed licence check. Check lswsctrl status and which program is listening on ports 80 and 443.

Should I update WordPress from wp-admin or WP-CLI on a Plesk server?

WP-CLI over SSH, run as the site’s own system user. It avoids Cloudflare’s timeout and LiteSpeed’s connection limits, and shows the exact error if something fails. WP Toolkit in Plesk is the next best option.

Do I need both LiteSpeed Cache and Cloudflare caching?

LiteSpeed Cache for the pages, Cloudflare for static files, is the simplest setup that stays correct after updates. If Cloudflare also caches HTML, purge both after every update, LiteSpeed first.

How do I roll back a plugin or WordPress update on Plesk?

From WP Toolkit’s restore point if you made one; otherwise with WP-CLI: wp plugin install name --version=x.y.z --force for a plugin, or wp core update --version=x.y.z --force for WordPress core.

Is it safe to leave automatic updates on for every site?

For minor security releases, generally yes. For major versions of WordPress and large plugins on several sites sharing one server, no: they can all update at the same time and use up the server together. Stagger them, or run them yourself with the routine above.

If you would rather hand this to someone, our WordPress maintenance plans include weekly off-site backups, uptime and SSL monitoring, and regular core, theme and plugin checks.

Discussion

Be the first to comment

Leave a comment

Get in touch