MikeDre
2/22/2019 - 1:08 PM

Setting up a new Digital Ocean - OpenLiteSpeed Wordpress Droplet

Droplet Setup

  • Login and change the server password
  • Add ssh key to server
  • cat ~/.ssh/id_rsa.pub | ssh root@68.183.46.73 'cat >> ~/.ssh/authorized_keys'
  • Run the following commands and securely save the output:
  • sudo cat .db_password
  • sudo cat .litespeed_password

LiteSpeed Configuration

  • Run the following command to allow access to :7080
  • ufw allow 7080
  • Go to https://your_IP_here:7080
  • Username is admin
  • Password is the output of: sudo cat .litespeed_password
  • In the admin dashboard go to 'Listeners'
  • Click wordpress and edit the domains to add all other relative addresses

LiteSpeed Configuration - Enabling SSL redirects

  • Go to Virtual Hosts and click wordpress
  • Click the Rewrite tab at the top and edit 'Rewrite Rules'
  • Add the following rule replacing example.com with your domain:
RewriteCond %{SERVER_PORT} 80  
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
  • When complete restart LiteSpeed with this icon:
  • Disable access to :7080
  • ufw delete allow 7080

PHP Configuration

  • Navigate to cd /usr/local/lsws/lsphp73/etc/php/7.3/litespeed/cd and open the file (this path may differ due to php versions)
  • Change short_open_tag = Off to On and save
  • Restart server to enable changes /usr/local/lsws/bin/lswsctrl restart

MySQL Monitor