When Migrating from a Previous PST (2.x) - Setup by PST Commands(3.0.0)

PST (3.x) has changed configuration from the previous PST (2.x). Therefore, a configuration migration is required. You cannot update PST by using "yum update".

Updating from the PST (2.x) Module

Before migrating to PST (3.x), update PST (2.x) to the latest version. Root privileges are necessary to update.

$ sudo yum update kusanagi-prem

or

$ su -
[root@kusanagi8 ~]# yum update kusanagi-prem

Updating PST (2.x) Profiles

Before migrating to PST (3.x), update all PST (2.x) enabled profiles to the latest version. You can find PST enabled profiles in PST Manager. Or, you can find them with the following root privilege commands.

[root@kusanagi8 ~]# for i in /home/kusanagi/*; do test -f $i/wexal/pst.config.yaml && echo $i; done
/home/kusanagi/%PROFILE-NAME%

Update profiles with the PST (2.x) "pst" command. Note, root privileges are required to execute the PST (2.x) "pst" command.

[root@kusanagi8 ~]# cd /home/kusanagi/%PROFILE-NAME%
[root@kusanagi8 %PROFILE-NAME%]# pst -v

When the Profile Version is the same as the the Global Version:

No update is required.

When the Profile Version is earlier than v2.4.4:

[root@kusanagi8 %PROFILE-NAME%]# test -f /etc/httpd/conf.d/ssl.conf && mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak
[root@kusanagi8 %PROFILE-NAME%]# pst init --rebuildconf

If the Profile Version is v2.4.4 or later:

[root@kusanagi8 %PROFILE-NAME%]# pst init

If you use a reverse proxy, "--reverseproxy" and "--origin options" must also be specified in the "pst init" command.

Uninstalling the PST (2.x) Module

First, uninstall the PST (2.x) module. You must have root privileges to uninstall.

[root@kusanagi8 ~]# yum erase kusanagi-prem kusanagi-nodejs-prem kusanagi-lua-prem

Installing the PST (3.x) Module

Install the PST (3.x) module. You must have root privileges to install.

[root@kusanagi8 ~]# yum install kusanagi-prem3

Configuring Initial Profile Settings

Setup the initial profile settings to all enabled PST (2.x) profiles. The initial settings are executed with the "pst init" command. The profile is specified at the end of the "pst" command. Or, the command can be executed from the profile directory (as the current directory.) To execute the "pst" command,"kusanagi" user or root privileges are required.

[kusanagi@kusanagi8 ~]$ pst init %PROFILE-NAME%

or

[kusanagi@kusanagi8 ~]$ cd /home/kusanagi/%PROFILE-NAME%
[kusanagi@kusanagi8 %PROFILE-NAME%]$ pst init

Once the initial PST settings are complete, the PST Manager URL will be displayed.

pst watch stopped.
pst watch started.
Info: open WEXAL manager form http://xxx.xxx.xxx.xxx:61000

The following steps can also be performed through PST Manager. If you use PST Manager, refer to "When Migrating from a Previous PST (2.x) - Setup in PST Manager" for more information.

Enabling PST

Enable PST for a profile that has completed the initial setup. PST is enabled with the "pst on" command. The profile is specified at the end of the "pst" command. Or, the command can be executed from the profile directory (as the current directory.) To execute the "pst" command,"kusanagi" user or root privileges are required.

[kusanagi@kusanagi8 ~]$ pst on %PROFILE-NAME%

or

[kusanagi@kusanagi8 ~]$ cd /home/kusanagi/%PROFILE-NAME%
[kusanagi@kusanagi8 %PROFILE-NAME%]$ pst on

Note that if PST has been enabled in PST (2.x), the settings will be the same.

Checking PST Status

First, check if PST is enabled. Run the "pst status" command to display PST status. The profile is specified at the end of the "pst" command. Or, the command can be executed from the profile directory (as the current directory.) To execute the "pst" command,"kusanagi" user or root privileges are required.

[kusanagi@kusanagi8 ~]$ pst status %PROFILE-NAME%
WEXAL Page Speed Technology = on
Watch = on

or

[kusanagi@kusanagi8 ~]$ cd /home/kusanagi/%PROFILE-NAME%
[kusanagi@kusanagi8 %PROFILE-NAME%]$ pst status
WEXAL Page Speed Technology = on
Watch = on

Modifying PST Configurations

You can change PST settings by editing the configuration file. The format is YAML. The configuration file is "wexal/pst.config.yaml" in the profile directory. Refer to the "PST Configuration File" for more information.

Optimizing Resources

PST Resource Monitoring Service ("watch") monitors changes to resources in profiles and generates optimized resource files for images, scripts, and style sheets in response to updates. However, for resources that existed in a profile before executing the initial PST configuration, an optimized resource file will not be generated until the resource is updated. Therefore, it is necessary to generate an optimized resource file for the resources in the profile.

Run the "pst opt all" command to perform resource optimization. The profile is specified at the end of the "pst" command. Or, the command can be executed from the profile directory (as the current directory.) To execute the "pst" command,"kusanagi" user or root privileges are required.

Resource optimization will take time if the number of resource files is large. By limiting the number of target directories to be optimized, optimization time can be shortened. The optimization time can also be shortened by using the "pst opt image", "pst opt js", and "pst opt css" commands instead of the "pst opt all" command to limit the resources to be optimized. Refer to "PST Commands" for more information.

Note that optimized resource files from PST (2.x) can be used. If already optimized resource files exist, optimization will not be executed.

[kusanagi@kusanagi8 ~]$ pst opt all %PROFILE-NAME%

or

[kusanagi@kusanagi8 ~]$ cd /home/kusanagi/%PROFILE-NAME%
[kusanagi@kusanagi8 %PROFILE-NAME%]$ pst opt all

You can check the progress of resource optimization with the "pst queue" command. To execute the "pst" command,"kusanagi" user or root privileges are required.

[kusanagi@kusanagi8 ~]$ pst queue

If the value of the Resource Optimization Service "optimizer" queue is 0, resource optimization is complete. Also, you can check if there are optimized resource files under the "wexal/optdir" directory in the profile. Below is an example of checking optimized resources for images uploaded in August 2021.

[kusanagi@kusanagi8 ~]$ ls -l /home/kusanagi/%PROFILE-NAME%/wexal/optdir/wp-content/uploads/2021/08
-rw-r--r--. 1 root root 106707  August  3 09:50 img1-1024x640.jpg
-rw-r--r--. 1 root root  44520  August  3 09:50 img1-1024x640.jpg.webp
-rw-r--r--. 1 root root 137492  August  3 09:50 img1-1200x750.jpg
-rw-r--r--. 1 root root  57288  August  3 09:50 img1-1200x750.jpg.webp
-rw-r--r--. 1 root root   7489  August  3 09:50 img1-150x150.jpg
-rw-r--r--. 1 root root   3782  August  3 09:50 img1-150x150.jpg.webp
-rw-r--r--. 1 root root 204712  August  3 09:50 img1-1536x960.jpg
-rw-r--r--. 1 root root  82396  August  3 09:50 img1-1536x960.jpg.webp
-rw-r--r--. 1 root root  14863  August  3 09:50 img1-300x188.jpg
-rw-r--r--. 1 root root   6956  August  3 09:50 img1-300x188.jpg.webp
-rw-r--r--. 1 root root  66012  August  3 09:50 img1-768x480.jpg
-rw-r--r--. 1 root root  27914  August  3 09:50 img1-768x480.jpg.webp
-rw-r--r--. 1 root root 252283  August  3 09:50 img1.jpg
-rw-r--r--. 1 root root 103324  August  3 09:50 img1.jpg.webp