Synology Set Up
話說 Synology 的 Set up 真的非常繁複,尤其是對於只有薄弱網絡知識的我。 本來已經很多事情要處理,本著「時間就像乳溝」的精神, 我慢慢地一邊爬文一邊學。當中有兩條link 我認為需要比credit 的,分別是:
- NAS備份功能詳細教學! (CC中文字幕)
- How To Install Multiple WordPress Sites On Synology NAS
https://mariushosting.com/how-to-install-multiple-wordpress-sites-on-synology-nas/
這兩個網基本上滿足晒我backup 及整網頁的願望,超有心的。
值得一記的就是,我學會了在電腦上設定網絡磁碟區,很簡單,只要在本機選擇「連線至網絡磁碟機」,然後選擇你喜歡的英文字母作為Drive,再填上Synology 的ip + path 即可。這讓我想起在觀塘幫人做IT SUPPORT時,有人問我佢搵唔返個Drive, 當時我唔識,要remote control 比senior 搞,望住佢三兩下搞掂左,就係做E樣野,不過path 係佢地內部既folder咁解。
Synology 的wordpress plugin是超級不user-friendly,不但file path 是default to www.domainname.com/wordpress, 而且只可有一個。這令我在用Synology的公司十分頭痛,佢地仲要炒port,理論上其實synology 係同local host既XAMPP 一樣,我應該可以擺多於一個既wordpress 上去的,皇天不負有心人,終於比我搵到,這網頁有詳細教學,很好,正值我為自己既github 既file 寫緊MarkDown,所以我絕對明白他的effort,儘管我未有能力課金比佢,但仍呼籲更多人捐錢比他,因為真的很詳盡同清楚(最緊要清楚!!!)
最後,整個Synology 仲有野未set好,let’s say NAS SSL, email系統,DMS 系統,wordpress 的subpath,有待下一次解決。
跋:
由於試過死link開唔到第二條連結,我希望固中知識真的能比有心人自己起一個wordpress 出黎,所以先將內容在這裡留底。
How To Install Multiple WordPress Sites On Synology NAS
29 May 2020 by Marius Bogdan Lixandru
I have recently purchased a Synology DS718+ and found out that amongst the many great things we can do with it, one is installing a WordPress site using the Web Station package. But it only lets us install one instance of WordPress. It is possible to manually install and run multiple WordPress sites on Synology NAS. But first of all, you have to read my introduction article “How to speed up WordPress on Synology NAS“.
If you use multiple computers in your house running any OS (Windows 10, Mac or Linux Ubuntu) and would like to pick up WordPress development on your localhost that you have left off on another computer in your home network without dealing with Dropbox, Onedrive, sync for files and a plugin like WP Migrate DB Pro for the database, read on.
After following these steps you should be able to create multiple websites on your localhost like this: local.dev, showcase-pro.dev which are accessible from any device on your network (that you can add a hosts entry in).
In this article I am not going to cover what’s required to make these sites accessible from outside your local WiFi/home network. You can find this information on host from home article. So, let’s start:
- STEP 1
Please Support My work by Making a Donation.
- Log into your NAS LAN. In my case, it is at http://10.0.0.60:5000/.
- Go to Package Center, search for Web Station and install it. This will create a “web” folder in your NAS’s root.
- Also, install WordPress package and set it up. While we are not going to use the website created by this package (you may, if you wish), we take this step so that the needed dependencies like PHP, MariaDB 10 can get installed.
- Install the latest phpMyAdmin and Apache HTTP Server 2.4 packages. These are the relevant packages that I have running: Apache HTTP Server 2.2, Apache HTTP Server 2.4, MariaDB 10, PHP 5.6, PHP 7.0, PHP 7.2 phpMyAdmin, Web Station and WordPress. Some of these may not be needed. You might want to experiment with them.
- From the Main Menu, launch File Station. Navigate to web folder and create a folder for your site, say, “wordpress-latest”. Go inside the folder. Download WordPress on your computer, extract the zip, drag all the content and drop inside “wordpress-latest”. Alternatively, if you have Download Station package installed you can simply enter https://wordpress.org/latest.zip for the URL and have the file downloaded to “wordpress-latest”, then extract using the option from context menu.
- Create a folder for your website. Ex. showcase-pro.
- Copy all the content from “wordpress-latest” into the site’s folder.
- Right click on the folder and click Properties. Go to Permissions tab. Create a new permission for “http” user granting all Write permissions.
- Log into your phpMyAdmin (at http://10.0.0.60/phpMyAdmin/ for me) using “root” as the username (password is blank/empty) or use the one you have set up when you installed MariaDB10. After logging in, change the password if you wish. Create a new database for your site. Ex.: showcasepro. During my experiments, the database connection wasn’t working because the database name had a hyphen in it, so I had to change the database name from “showcase-pro” to “showcasepro”.
- In Windows Explorer/Finder, navigate to your Synology’s network drive and then into your website’s folder.
Rename wp-config-sample.php
to wp-config.php
and edit it. Set your database name, enter root
as username and your password.
- STEP 2
Above
/* That's all, stop editing! Happy blogging. */ paste define('FS_METHOD', 'direct'); If you are using MariaDB 10, edit wp-config.php parameter for hostname as follows: /** MySQL hostname */ define(‘DB_HOST’, ‘localhost:/run/mysqld/mysqld10.sock’); Set new unique keys and salts generated at https://api.wordpress.org/secret-key/1.1/salt/ define('AUTH_KEY', 'put your unique phrase here'); define('SECURE_AUTH_KEY', 'put your unique phrase here'); define('LOGGED_IN_KEY', 'put your unique phrase here'); define('NONCE_KEY', 'put your unique phrase here'); define('AUTH_SALT', 'put your unique phrase here'); define('SECURE_AUTH_SALT', 'put your unique phrase here'); define('LOGGED_IN_SALT', 'put your unique phrase here'); define('NONCE_SALT', 'put your unique phrase here'); Save and close the file.
1. Launch Web Station. General Settings: Set HTTP back-end server to Apache HTTP Server 2.4 and PHP to 7.2. 2. PHP Settings: Set PHP version to 7.2. Leave PHP Cache enabled. Select these extensions: curl, exif, ftp, gd, gettext, iconv, mcrypt, mysqli, openssl, posix, soap, sockets, xmlrpc, zip. Press Apply. 3. Virtual Host: Click Create, enter “showcase-pro.dev” for the Hostname, browse your site’s folder for Document root, select Apache HTTP Server 2.4 and PHP 7.2. Press OK. 4. In your hosts file enter 10.0.0.60 showcase-pro.dev Do this for every computer from which you’d like to work on your local site. 5. Visit http://showcase-pro.dev in your browser and complete the WordPress installation. 6. Log into your WordPress site’s admin, go to Settings > Permalinks and press Save to generate the .htaccess or otherwise pretty permalinks will not work. That’s it. Now you should be able to administer and access your newly created local WordPress site on any computer in your LAN network. Note: If you have a https problems when accessing your .dev website try to change or reinstall using .local domain instead of .dev domain This post was updated on Monday / October 5th, 2020 at 7:09 AM