Multiple WordPress Installs on Synology NAS

  General, Software

Do you find this page interesting or helpful? Do you have comments or suggestions or corrections? If so please post a comment to this blog article.

Source: https://www.oppedahl.com/wordpress/

Steps to construct a WordPress site on a Synology box

You can use a WordPress “package” on Synology, but if you do, you can only set up one WordPress package on the box. Suppose you want to set up multiple WordPress sites on the Synology box. Then you need to do it yourself. Here are the steps. You will repeat these steps for each of the WordPress sites that you are setting up.

This tutorial assumes:

  • you already know how to use WordPress generally
  • you already know generally how to administer a Synology box including these skills:
    • how to install packages on the Synology box
    • how to create users and pick their permissions
    • how to FTP files onto the box
    • how to edit files
    • how to use Synology Web Station to configure web sites
    • how to use Control-Panel/Security/Certificates/Letsencrypt on the Synology box to implement SSL for a web site on the Synology box
  • you already know how to register a domain name and how to set up DNS someplace for a domain name of your choice

Generally what you need to do is the following.

  • Make sure your Synology box has the most recent version of DSM
  • If you have not already done so, install the following to the Synology box:
    • Web Station
    • PHP (probably PHP 7.0) 
    • Apache (probably version 2.4)
    • install MariaDB (probably version 10) 
    • PHPmyadmin
  • Pick (register) a domain name for the new site
    • You will need DNS hosting somewhere
      • maybe the DNS hosting is provided by the domain name registration service provider
      • maybe you are doing the DNS hosting on your Synology box
  • Set up DNS for the domain name to point to the Synology box
    • for example if the box is called “synology-2.something.com” and if the blog will be “blog.something.com”
    • then you will want to set up a CNAME so that “blog” maps to “synology-2.something.com”
  • Create a subfolder for the web site
  • Create a user which will be an FTP user for the folder. The user needs to have read/write permissions to the folder
  • Make sure that the http user has “write” permissions for the web folder
    • go into file station pick the web folder, right-click on “properties”,
    • click on “permission”,
    • find user “http”
    • right now the http user has only “read” permissions,
    • you need to add “write” permissions
  • Set up Web Station so that it maps that domain name to that subfolder.
    • Click on “virtual host” and “create”
    • and the web site will be “name-based”
    • in the “document root” browse to and select the subfolder
    • pick a back-end server (probably Apache 2.4)
    • pick a PHP version (probably PHP 7.0)
    • click okay
  • obtain an SSL certificate for the domain name
    • go to control panel/security/certificate
      • click add
      • pick “add a new certificate” and next
      • get a certificate from letsencrypt and next
      • enter the domain name for the wordpress site, enter an email, apply
      • now you have the SSL certificate from Letsencrypt
      • click on configure
      •  find the service which is the domain for the wordpress site, to the right is the certificate it will use which is certainly incorrect
      • use the drop-down for the certificate and find the new SSL certificate that you just now created, and pick it, and click OK
  • Obtain the standard WordPress install package
  • unzip it
  • FTP the entire WordPress package to the subfolder
  • Using PHPmyadmin, create a database in the MariaDB system
  • the default login is “root” and a blank password
  • probably the password will be screwed, if so:
    • run the MariaDB app, click on “change MariaDB password”
    • leave the password field blank
    • click on “reset MariaDB password”
    • now you can run PHPmyadmin
  • create a database for the wordpress instance
  • Run the WordPress software by visiting the web page https:// and domain name slash wp-admin
  • it will ask you for a database name, database user name, database password, database host, the table prefix
  • the database name is easy, it is the database that you just created
  • he user name might be “root”
  • the password might be blank
  • the host is probably “localhost” which you can leave as the default
  • leave the default table prefix of “wp_” the way it is
  • you might encounter “Sorry, but I can’t write the wp-config.php file.”
    • if so, go back and give the http user write access as instructed above, then go back and try again
  • now you need to do the wordpress install
  • specify the site title
  • pick a user name maybe “admin”
  • pick a password
  • enter your email
  • click “install wordpress”
  • You reach the Dashboard “welcome to wordpress”.
  • Now you have a “wp-config.php” file, right?
  • Open it using the editor in Synology file station
  • recall the FTP user and password which you created earlier
  • add the following four lines in the “wp-config” file:
    • define( ‘FTP_USER’, ‘ftp-user-name-goes-here’ );
    • define( ‘FTP_PASS’, ‘ftp-user-password-goes-here’ );
    • define( ‘FTP_HOST’, ‘127.0.0.1’ );   
    • define( ‘FTP_SSL’, true );
  • save the file
  • create a couple of administrators on the WordPress site
  • Typical plug-ins
    • Google authentication
    • Jetpack
    • Akismet
  • test the instance of WordPress
    • visit the web page like a normal user
    • visit the web site again using “https://”
    • you should see the normal first default wordpress web site
    • visit the “wp-admin” page using https://
    • you should be able to “add” a new theme without having to enter an FTP user ID or password
    • you should be able to “add” a new plugin without having to enter an FTP user ID or password

IN Many cases: The issue of not being able to create folders with the WordPress install is a result of the http user only having read permissions. Change this from FileStation on the Synology NAS for each of your websites’ root directories.