1. Home
  2. Docs
  3. Infrastructure
  4. CloudPages

CloudPages

We use CloudPages to manage WordPress websites.

Restart LiteSpeed

I don’t know yet, how to restart LiteSpeed from CloudPages. But from SSH:

sudo systemctl restart lshttpd

Purge/Clear LiteSpeed Cache

sudo rm -rf /usr/local/lsws/cachedata
# Then restart LiteSpeed
sudo systemctl restart lshttpd

How to Change WordPress Site URL using WP CLI

In CloudPages-managed server, to use WP CLI you need to specify PHP binary path. Example:

sudo -u USERNAME bash
cd /home/SITE_ID
/usr/local/lsws/lsphp80/bin/php /usr/bin/wp search-replace 'https://next.garudasystrain.co.id' 'https://www.garudasystrain.co.id' --skip-columns=guid
/usr/local/lsws/lsphp80/bin/php /usr/bin/wp option get siteurl
/usr/local/lsws/lsphp80/bin/php /usr/bin/wp option get home
/usr/local/lsws/lsphp80/bin/php /usr/bin/wp option set siteurl 'https://www.garudasystrain.co.id'
/usr/local/lsws/lsphp80/bin/php /usr/bin/wp option set home 'https://www.garudasystrain.co.id'
/usr/local/lsws/lsphp80/bin/php /usr/bin/wp cache flush

ModSecurity WAF and OWASP Rules

Be aware that some OWASP Rules may interfere with Elementor page builder editor functionality. But Hendy has not found out which specific rule(s).

Troubleshooting/Diagnosing “Serious Error”

Flush cache:

/usr/local/lsws/lsphp80/bin/php /usr/bin/wp cache flush

Edit wp-config.php:

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

Now you see the reason, usually a broken plugin.

Turn off the WP_DEBUG_* again.

You can then disable the plugin using CLI:

/usr/local/lsws/lsphp80/bin/php /usr/bin/wp plugin deactivate blog2social

PHP Error Logging

Edit wp-config.php:

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

In CloudPages, go to the WordPress site > LiteSpeed Settings > Current Configuration, then put:

phpIniOverride  {
   php_value error_log "$VH_ROOT/logs/php_errors.log"
}

Now you’ll get errors there, which you can ingest with Filebeat and ship to Elasticsearch. Example:

[09-Feb-2022 17:40:20 UTC] woy coba dong

How can we help?

Leave a Reply

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