LEMP Script WordOps Guide

wordops is the best automated LEMP script at present. From the POV of ease of installation, it is much better than Centminmod and Easy Engine. The documentation and guides are also excellent. The site is https://wordops.net/

It requires Ubuntu Server 18.04/20.04/22.04 or Debian 10/11.

(1) Install wordops

 wget -qO wo wops.cc && sudo bash wo

(2) Create a wordpress site

wo site create mydomain.com --wp --php74 --user=joe --pass=joe1234 --email=joe@gmail.com --letsencrypt

(Before using letsencrypt, ensure that the domain is pointing to the IP Address of the VPS and that the same has propogated.)

(3) If site is not accessible, check on yougetsignal if Port 80 is blocked by UFW

sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
22 (v6)                    ALLOW       Anywhere (v6)

root@wordops:~# sudo ufw allow 80
Rule added
Rule added (v6)
root@wordops:~# sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
80                         ALLOW       Anywhere
22 (v6)                    ALLOW       Anywhere (v6)
80 (v6)                    ALLOW       Anywhere (v6)

root@wordops:~# sudo ufw allow 443
Rule added
Rule added (v6)
root@wordops:~# sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
22 (v6)                    ALLOW       Anywhere (v6)
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)

(4) To get SSL certificate for existing site

wo site update mydomain.com --letsencrypt

(4A) To renew the certificate

All certificates are automatically renewed every 60 days by acme.sh using a cronjob. However, if you really need to renew your certificates, you can directly use acme.sh to renew all certificates with the following command (link):

acme.sh --renew-all --ecc

(5) Install phpmyAdmin and other fancy tools

 wo stack install --admin

These can be accessed through https://IPAddress:22222 A screenshot of the panel is given at the bottom of this page.

If the Port is blocked by UFW open it with

sudo ufw allow 22222

Set up username and password for HTTP authentication to access the admin tools

wo secure --auth

(6) Mysql password

cat /etc/mysql/conf.d/my.cnf

(6A) Change the root password

 mysql -u root -p
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEWPASSWORD';
flush privileges;
exit;

(7) Dump Database & Files on transferor site

All databases

mysqldump --all-databases -uuser -ppassword >all-database-backup-date.sql

Single database

mysqldump -uUSERNAME -p DATABASE > single-database-backup-date.sql

Files

tar -cpzf files-backup-date.tar.gz *

From the transferee site, pull the files in

wget http://www.myolddomain.com/files-backup-date.tar.gz

or

scp root@ IP-address-of-old-VPS:/path/.../home/nginx/domains/name-of-backupfile-.tar.gz
/home/nginx/domains/-path-of-new-VPS

If the old vps is not accessible from the default Port 22, add Port number

scp -P Portnumber root@ IP-address-of-old-VPS:/path/.../home/nginx/domains/name-of-backupfile-.tar.gz /home/nginx/domains/-path-of-new-VPS

Unzip the tar file

tar -xzf files-backup-date.tar.gz

The ownership of all files has to be changed to www-data using the command

 chown www-data:www-data -R *

Put all databases into mysql

mysql -uuser -ppassword < all-database-backup-date.sql

or

Put a single database

mysql -uUSERNAME -p NEWDATABASE < single-database-backup-date.sql

(Create the NEWDATABASE in PhpMyAdmin)

(8) Allow zip & gzip files download

There is no restriction for downloading pdf files. However downloading zip files are not permitted. They can be permitted as stated here (link).

 

(9) Change WordPress Admin password:

wo site update site.tld --password

(10) To get information about a site (such as php version)

wo site info [<site_name>]

(11) List of all commands:

https://docs.wordops.net/commands/

(12) Enable permalinks for wordpress in sub-directory

A location directive has to be created in the nginx configuration file for the permalinks in a directory to work.

Create a file called “locations-wo.conf.custom” in /etc/nginx/common.

Add the directive

location /name-of-the-directory {
        try_files $uri $uri/ /name-of-the-directory/index.php?q=$uri$is_args$args;

}

Go to the site’s configuration in /etc/nginx/sites-enabled and add the include statement

 include common/locations-wo.conf.custom;

Restart nginx

wo stack restart --nginx

In

Wordops

2 thoughts on “LEMP Script WordOps Guide

Leave a Reply

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