Simply Fast WordPress [15] - Enabling Always-On SSL and HTTP/2 on an existing HTTP WordPress site (Part 1: Preparation)

9: Set ownership and permissions

We will now set ownership and permissions. The settings are as follows (Table 2).

Table 2: Ownership and permissions settings
Owner Permissions
wp-config.php kusanagi.kusanagi 0644
Below DocumentRoot kusanagi.kusanagi File: 0644、Directory: 0755
Below wp-content/uploads httpd.www File: 0644、Directory: 0755
wp-content/uploads/.htaccess kusanagi.kusanagi 0644

Example settings commands are as follows:

cd /home/kusanagi/example.com
chown kusanagi.kusanagi wp-config.php
chmod 0644 wp-config.php
chown -R kusanagi.kusanagi DocumentRoot
chmod 0755 DocumentRoot
cd DocumentRoot
find ./ -type d | xargs chmod 0755
find ./ -type f | xargs chmod 0644
chmod wp-content 0777
cd wp-content
rm advanced-cache.php
chown -R httpd.www uploads
chown kusanagi.kusanagi uploads/.htaccess

In the example above, the permissions for the wp-content directory are set to 0777. This is to allow files like advanced-cache.php for page caching and replace-class.php for replacing, to be put directly under the wp-content directory from the KUSANAGI menu of the dashboard. The files’ owner is http.www, and permissions are 0644. Remember to set the permissions for the wp-content directory back to 0755 before running in production.

10: Log in to the dashboard, confirm the settings and test run

We will now log in to the dashboard, update the plugins and theme, confirm the settings and do a test run.

To update, connect through ftp. At the dashboard > update menu, use the information from Table 3 to connect.

Table 3: Login information
Item Contents
Hostname localhost
FTP Username kusanagi
FTP Password (kusanagi user password)

If the settings were correct and the site is operational, return permissions for the wp-content directory that we changed in (9) to 0755.

Migration of the HTTP WordPress site to KUSANAGI will be complete after you switch the DNS to the new environment.

Next time, we will explain how to switch an HTTP WordPress site running on KUSANAGI to HTTP/2 and enable Always-On SSL.