Rather than installing WordPress using the Synology Package Center, this post will show you how to install WordPress from the installation file downloaded from WordPress.org. The advantage of doing so is that individuals have total control over the version of WordPress utilized, both at the start and during the life of the website.
Preparation
- Go to https://wordpress.org/download/ to get the latest version of the WordPress.
- Sign in to DSM using an administrator user account, then navigate to Package Center.
- Install PHP 7.4.
- install Web Station.
- Install Apache HTTP Server 2.4.
- Install MariaDB 10 and configure it with a complex password.
- Install phpMyAdmin.
- Install Text Editor.
- Install an SSL certificate on the NAS.
- Create a new A or CNAME record on DNS server and point it to the IP address of the NAS.
Despite the fact that WordPress may operate on NGINX, Apache HTTP Server 2.4 can resolve the WordPress permalink issue.
Upload the WordPress Installation File to the NAS
- Go to File Station > web and erase all existing files in the /web directory.
- Make a new folder under /web and call it something other than “wordpress,” such as “wpfox.” The term “wordpress” refers to the Synology WordPress package.
- Transfer the WordPress installation file to /web/wpfox.
- With Text Editor, add the following lines at the end of the wp-config-sample.php file:
//** The next line allows direct downloads. */
define('FS_METHOD', 'direct');
Setup Web Station
- To create a new profile, navigate to Web Station > Script Language Settings > PHP and click the Create button.
- Fill in the blanks with “wordpress” for both the Profile name and the Description. Then choose the “Enable PHP cache” option.
- Navigate to Extensions and enable the following options:
- curl
- exif
- ftp
- gd
- iconv
- imagick
- intl
- mysqli
- openssl
- zip
- Modify the following values in Core:
- max_execution_time=120
- max_input_vars=3000
- post_max_size=64M
- upload_max_filesize=64M
Create a WordPress Database
- Open phpMyAdmin and connect in to the MariaDB 10 database using the username root and the password you created during the MariaDB 10 installation.
- Select New from the left-hand menu, and then select the User Accounts tab.
- Click Add User Account, then enter the following information:
- User name: wpfox
- Host name: select Local from the drop down list
- Password: (fill with a complex password)
- Check the box next to “Create database with same name and grant all privileges.”
- Click Go to build the database for WordPress.
Create Virtual Hosts for none-www and www Domains
- Open Web Station > Web Service Portal, then click Create. Select Virtual Host and fill in the values:
- Portal type: Name-based
- Hostname: pikabay.com
- Port: 80/443
- HTTPS Settings: HSTS
- Next, pick the following options:
- Document root: web/wpfox
- HTTP back-end server: Apache HTTP Server 2.4
- Script Language Settings: PHP > wordpress (PHP 7.4)
- To finish, click Next.
- Repeat the preceding steps to set up another Virtual Host for www.pikabay.com.
Set the Proper Web Folder Permissions
- Navigate to File Station, right-click on web folder, and then select Properties > Permission.
- Click Edit after selecting the http user account. The symbol for a http user account differs from that of a http group account.
- Select SYSTEM from the User or Group drop down menu, then click Done.
SYSTEM > Read administrators > Read & Write http > Read
Do not check the “Apply to this folder, sub-folders, and files” box.
Set the Proper WordPress Folder Permissions
- Right-click on /web/wpfox and choose Properties > Permission.
- Select Make inherited permissions explicit from the Advanced options menu.
- Select the SYSTEM user and then Edit. Allow the SYSTEM user to write but not delete.
SYSTEM > Custom administrators > Read & Write http > Read
The “Apply to this folder, sub-folders, and files” box must be checked.
Set Up WordPress
- Navigate to www.pikabay.com and choose “Let’s go!”
- Fill out the database information:
- Database Name: wpfox
- Username: wpfox
- Password: (Created in Step 3)
- Database Host: localhost
- Table Prefix: wp_
- Submit the form and run the installation.
- Fill out the basic website information and generate a login credential.
- Log in to WordPress and look for the latest update.
Uninstall phpMyAdmin
For security reasons, phpMyAdmin should be removed.
Simply navigate to the Package Center, locate phpMyAdmin, and uninstall. Enter the password you set up for MariaDB 10 in the pop-up window. Don’t worry, the database will not be erased.