Synology NAS Server – Inspecting L(E)AMP stack environment for hosting your WordPress site(s)
210111
There is no doubt that a Synology NAS server is quite a good choice to host on your own, your WordPress site(s) for the real world. Here, we make a quick-pass tour of the key tools and their environment in a Synology NAS server.
I suppose that you already know that the ‘LAMP‘ stands for Linux Apache Mysql Php (The M is also used for MariaDB, which is what we use here).
Similarly, the ‘LEMP‘ stands for Linux EnginX MariaDB Php, where Engine X is nothing but the NGINX.
In a Synology NAS server, the NGINX comes preinstalled, and in most cases, it coexists with the Apache server. So this is why I used the ‘L(E)AMP‘ in the title of this post.
If you haven’t done it yet, use the Package Center on your Synology NAS server and install (or update) the following packages (those with a red square):
- PHP 5.6
- PHP 7.2
- PHP 7.4
- Apache HTTP Server 2.2
- Apache HTTP Server 2.4
- MariaDB
- phpMyAdmin
- Web Station
- WordPress
After Web Station installation you can put all your websites under the /web folder in the NAS server volume you installed it e.g. /volume1/web.
You can use the Web Station web GUI of the Synology NAS server (via our browser) and check the Back-end Packages installed:
You can continue navigating and checking other settings such as active Apache HTTP server, Virtual Host(s) settings, active PHP profile and its settings and extensions (libraries), etc.
Additionally, get yourself familiar with using ssh and a terminal window of your machine. This is necessary in order to be able to explore the environment with a bit of comfort. For this purpose, you might find useful this post of mine, or any relevant info from any other source.
NGINX
Actually, NGINX acts as the front end of any site (WordPress site) you install in your NAS server. going to transfer the present site you see, from my MacBook Pro to my Synology NAS server.
In a Synology NAS server, the Nginx instance runs with the config files it finds under /etc/nginx :
user01@nas01:~$ ls -al /etc/nginx total 68 drwxr-xr-x 2 root root 4096 Jan 1 12:37 . drwxr-xr-x 47 root root 4096 Jan 16 12:14 .. lrwxrwxrwx 1 root root 20 Nov 1 14:30 app.d -> /var/tmp/nginx/app.d lrwxrwxrwx 1 root root 27 Nov 1 14:30 conf.d -> /usr/local/etc/nginx/conf.d -rw-r--r-- 1 root root 1077 May 12 2020 fastcgi.conf -rw-r--r-- 1 root root 1007 May 12 2020 fastcgi_params -rw-r--r-- 1 root root 2837 May 12 2020 koi-utf -rw-r--r-- 1 root root 2223 May 12 2020 koi-win -rw-r--r-- 1 root root 5318 May 12 2020 mime.types -rw-r--r-- 1 root root 13486 Jan 1 12:37 nginx.conf -rw-r--r-- 1 root root 3499 May 12 2020 nginx.conf.default -rw-r--r-- 1 root root 277 May 12 2020 proxy.conf -rw-r--r-- 1 root root 1204 May 12 2020 scgi_params lrwxrwxrwx 1 root root 34 Nov 1 14:30 sites-enabled -> /usr/local/etc/nginx/sites-enabled -rw-r--r-- 1 root root 664 May 12 2020 uwsgi_params -rw-r--r-- 1 root root 3610 May 12 2020 win-utf user01@nas01:~$
As you can see above, inside that folder, you can find these sub-folder pointers (sym links):
app.d -> /var/tmp/nginx/app.d
conf.d -> /usr/local/etc/nginx/conf.d
sites-enabled -> /usr/local/etc/nginx/sites-enabled
The file nginx.conf is the main nginx configuration file. Below is a (partial) listing of it:
user01@nas01:~$ cat /etc/nginx/nginx.conf # Copyright (c) 2000-2017 Synology Inc. All rights reserved. worker_processes auto; #worker_cpu_affinity auto; worker_rlimit_nofile 65535; include conf.d/main.conf; events { use epoll; multi_accept on; accept_mutex on; worker_connections 1024; include conf.d/events.conf; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log off; #access_log syslog:server=unix:/dev/log,facility=local7,tag=nginx_access,nohostname main; error_log syslog:server=unix:/dev/log,facility=local7,tag=nginx_error,nohostname error; sendfile on; server_tokens off; proxy_request_buffering off; fastcgi_request_buffering off; scgi_request_buffering off; proxy_buffering off; fastcgi_buffering off; scgi_buffering off; . . . . . . include app.d/www.*.conf; include app.d/alias.*.conf; include /usr/syno/share/nginx/conf.d/www.*.conf; include conf.d/www.*.conf; location = /webdefault/images/logo.jpg { alias /usr/syno/share/nginx/logo.jpg; } error_page 403 404 500 502 503 504 @error_page; location @error_page { root /usr/syno/share/nginx; rewrite (.*) /error.html break; } location ^~ /.well-known/acme-challenge { root /var/lib/letsencrypt; default_type text/plain; } include app.d/.location.webstation.conf*; location / { rewrite ^ / redirect; } location ~ ^/$ { rewrite / https://$host:5001/ redirect; } } include conf.d/http.*.conf; include app.d/server.*.conf; include sites-enabled/*; } user01@nas01:~$
As you can see in the last lines of this main nginx.conf file, it also includes (points out) other folders that we can use to put your custom configuration(s):
include conf.d/http.*.conf;
include app.d/server.*.conf;
include sites-enabled/*;
So if you want to add a custom configuration file, the real folder of the sym-link sites-enabled is the right place to add your custom file(s).
sites-enabled -> /usr/local/etc/nginx/sites-enabled
The real folder: /usr/local/etc/nginx/sites-enabled accepts any file name, so you can name it as you wish, e.g. `mycustom.conf` file.
Using other tests and commands for Nginx
Checking NGINX version:
$ nginx -v
user01@nas01:~$ nginx -v nginx version: nginx/1.15.7 user01@nas01:~$
Checking nginx configuration for possible syntax/configuration errors:
$ sudo nginx -t
user01@nas01:~$ sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful user01@nas01:~$
Check nginx status via synoservice command:
$ sudo synoservice –status nginx
user01@nas01:~$ sudo synoservice --status nginx Service [nginx] status=[enable] required upstart job: [nginx] is start. ======================================= user01@nas01:~$
Restart nginx :
$ sudo synoservicectl –restart nginx
user01@nas01:~$ synoservicectl --restart nginx
Reload nginx :
$ sudo synoservicectl –reload nginx
user01@nas01:~$ synoservicectl --reload nginx
or:
$ sudo nginx -s reload
user01@nas01:~$ nginx -s reload
Apache httpd server
Anytime you can check the Apache HTTP Server status via a terminal window (ssh):
$ sudo synoservice –status pkgctl-Apache2.4
user01@nas01:~$ sudo synoservice --status pkgctl-Apache2.4 Password: Service [pkgctl-Apache2.4] status=[enable] required upstart job: [pkgctl-Apache2.4] is start. ======================================= user01@nas01:~$
For Apache version 2.4 httpd services, the web server’s conf files are located in sub-folders of this location /usr/local/etc/apache24/
user01@nas01:~$ ls -al /usr/local/etc/apache24/ total 12 drwxr-xr-x 3 root root 4096 Jun 22 2020 . drwxr-xr-x 15 root root 4096 Apr 13 2020 .. lrwxrwxrwx 1 root root 58 Jun 22 2020 conf -> /var/packages/Apache2.4/target/usr/local/etc/apache24/conf lrwxrwxrwx 1 root root 58 Jun 22 2020 logs -> /var/packages/Apache2.4/target/usr/local/etc/apache24/logs lrwxrwxrwx 1 root root 52 Jun 22 2020 modules -> /var/packages/Apache2.4/target/usr/local/lib/modules lrwxrwxrwx 1 root root 57 Jun 22 2020 run -> /var/packages/Apache2.4/target/usr/local/etc/apache24/run drwxr-xr-x 2 root root 4096 Apr 17 2020 sites-enabled user01@nas01:~$
The important folder is the linked folder: /var/packages/Apache2.4/target/usr/local/etc/apache24/conf
user01@nas01:~$ ls -al /var/packages/Apache2.4/target/usr/local/etc/apache24/conf total 80 drwxr-xr-x 1 root root 64 Jun 2 2020 . drwxr-xr-x 1 root root 22 Jun 2 2020 .. drwxr-xr-x 1 root root 484 Jun 2 2020 extra -rw-r--r-- 1 root root 3705 Jun 2 2020 httpd24.conf -rw-r--r-- 1 root root 13064 Jun 2 2020 magic -rw-r--r-- 1 root root 60847 Jun 2 2020 mime.types user01@nas01:~$
In the above folder, you can see the main configuration file is the httpd24.conf
user01@nas01:~$ cat /var/packages/Apache2.4/target/usr/local/etc/apache24/conf/httpd24.conf ServerRoot "/usr/local/etc/apache24" Listen 127.0.0.1:915 LoadModule authn_core_module modules/mod_authn_core.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authz_core_module modules/mod_authz_core.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule include_module modules/mod_include.so LoadModule filter_module modules/mod_filter.so LoadModule deflate_module modules/mod_deflate.so LoadModule log_config_module modules/mod_log_config.so #LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule headers_module modules/mod_headers.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule asis_module modules/mod_asis.so LoadModule cgid_module modules/mod_cgid.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so LoadModule unixd_module modules/mod_unixd.so <IfModule unixd_module> User http Group http </IfModule> ErrorLog /run/apache24-error_log TraceEnable off LogLevel error <IfModule log_config_module> LogFormat "%{X-Real-IP}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{X-Real-IP}i %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%{X-Real-IP}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog /dev/null combined #CustomLog /run/apache24-access_log combined </IfModule> <IfModule cgid_module> ScriptSock /run/httpd/user-cgisock </IfModule> <IfModule mime_module> TypesConfig conf/mime.types AddEncoding x-compress Z AddEncoding x-gzip gz tgz AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType image/x-icon .ico AddHandler cgi-script .cgi </IfModule> MIMEMagicFile conf/magic EnableMMAP off # TODO: AllowOverride of root directory to All ?? <Directory /> Options FollowSymLinks AllowOverride All </Directory> # TODO: should apache handle this or nginx? <IfModule deflate_module> DeflateCompressionLevel 2 AddOutputFilterByType DEFLATE text/html text/plain text/xml AddOutputFilter DEFLATE js css BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.[0678] no-gzip BrowserMatch \bMSIE\s7 !no-gzip !gzip-only-text/html </IfModule> # TODO: should apache handle this or nginx <Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])"> <IfModule authz_core_module> Require all denied </IfModule> </Files> <VirtualHost _default_:80 _default_:443> DocumentRoot "/var/services/web" Alias /_webstation_/ "/var/packages/WebStation/target/error_page/" </VirtualHost> # TODO: Should apapche handle FileETag # For CVE-2003-1418 FileETag MTime Size Include conf/extra/httpd-mpm.conf Include conf/extra/httpd-autoindex.conf Include conf/extra/httpd-languages.conf Include conf/extra/mod_xsendfile.conf Include conf/extra/mod_rpaf.conf IncludeOptional sites-enabled/*.conf user01@nas01:~$
However, since Synology prevents permanent changes to that .conf file, whenever you want to define your virtual hosts you should use the local sub-folder available for sites-enabled. This is what is defined by the last line of the above httpd24.conf file. Then, (just like the case for nginx), you can store your custom .conf files there: /usr/local/etc/apache24/sites-enabled.
(It also accepts *.conf named files as you can see).
Take a look at sites-enabled folder:
user01@nas01:~$ ls -al /usr/local/etc/apache24/sites-enabled total 16 drwxr-xr-x 2 root root 4096 Apr 17 2020 . drwxr-xr-x 3 root root 4096 Jun 22 2020 .. -rw-r--r-- 1 root root 1336 Jan 1 15:24 httpd-vhost.conf -rw-r--r-- 1 root root 474 Jan 1 15:24 webstation-default.conf user01@nas01:~$
Actually, httpd-vhost.conf file is the ‘right place’ where you can configure your own virtual hosts:
user01@nas01:~$ cat /usr/local/etc/apache24/sites-enabled/httpd-vhost.conf Alias /_webstation_/ "/var/packages/WebStation/target/error_page/" ErrorDocument 400 /_webstation_/400.html ErrorDocument 401 /_webstation_/401.html ErrorDocument 402 /_webstation_/402.html ErrorDocument 403 /_webstation_/403.html ErrorDocument 404 /_webstation_/404.html ErrorDocument 405 /_webstation_/405.html ErrorDocument 406 /_webstation_/406.html ErrorDocument 407 /_webstation_/407.html ErrorDocument 408 /_webstation_/408.html ErrorDocument 500 /_webstation_/500.html ErrorDocument 501 /_webstation_/501.html ErrorDocument 502 /_webstation_/502.html ErrorDocument 503 /_webstation_/503.html ErrorDocument 504 /_webstation_/504.html ErrorDocument 505 /_webstation_/505.html <VirtualHost *:80 *:443> ServerName www.mysite.com SetEnv HOST www.mysite.com DocumentRoot "/volume1/web/wordpress" <IfModule dir_module> DirectoryIndex index.html index.htm index.cgi index.php index.php5 </IfModule> <Directory "/volume1/web/wordpress"> Options MultiViews FollowSymLinks ExecCGI AllowOverride All <IfModule authz_core_module> Require all granted </IfModule> </Directory> <FilesMatch "\.(php[345]?|phtml)$"> SetHandler "proxy:unix:/run/php-fpm/php-f4d357e4-6d9e-420f-b23e-c2b2c9184588.sock|fcgi://localhost" </FilesMatch> </VirtualHost> user01@nas01:~$
Looking at this httpd-vhost.conf file, you can see the settings of a virtual host defined in the block between <VirtualHost *:80 *:443> </VirtualHost> tags (VirtualHost directive). This block actually defines the ‘www.mysite.com’ domain (site) and its DocumentRoot which is located inside the /volume1/web/wordpress folder of the NAS server. This is exactly what it has been defined through the Web Station –> Virual Host [see above in this post: here].
Any time you want to add/create a new Virtual Host (a new site) via web GUI and Web Station –> Virual Host, its settings will be added as a new block inside the above httpd-vhost.conf file.
You can check the DocumentRoot and its contents, i.e. the /volume1/web/wordpress folder, either via web GUI:
or via terminal/ssh:
$ ls -al /volume1/web/wordpress
user01@nas01:~$ ls -al /volume1/web/wordpress total 204 drwxrwxrwx+ 1 http http 618 Dec 6 11:24 . drwxrwxrwx+ 1 root root 142 Nov 29 13:10 .. -rwxrwxrwx+ 1 http http 764 Dec 12 2018 disabled.html -rwxrwxrwx+ 1 http http 435 Nov 29 12:54 .htaccess -rwxrwxrwx+ 1 http http 424 May 20 2019 .htaccess.org -rwxrwxrwx+ 1 http http 420 Dec 1 2017 index.php -rw-r--r-- 1 http http 19935 Feb 17 2020 license.txt -rwxrwxrwx+ 1 http http 0 Dec 12 2018 pingbackIsOpend -rwxrwxrwx+ 1 http http 278 Dec 12 2018 syno-misc.php -rw-r--r-- 1 http http 6939 Feb 17 2020 wp-activate.php drwxr-xr-x 1 http http 2618 Feb 17 2020 wp-admin -rw-r--r-- 1 http http 369 Feb 17 2020 wp-blog-header.php -rw-r--r-- 1 http http 2283 Feb 17 2020 wp-comments-post.php -rwxrwxrwx 1 http http 3836 Nov 1 13:51 wp-config.php drwxrwxrwx+ 1 http http 134 Jan 17 10:12 wp-content -rw-r--r-- 1 http http 3955 Feb 17 2020 wp-cron.php drwxr-xr-x 1 http http 7652 Feb 17 2020 wp-includes -rw-r--r-- 1 http http 2504 Feb 17 2020 wp-links-opml.php -rw-r--r-- 1 http http 3326 Feb 17 2020 wp-load.php -rw-r--r-- 1 http http 47597 Feb 17 2020 wp-login.php -rw-r--r-- 1 http http 8483 Feb 17 2020 wp-mail.php -rw-r--r-- 1 http http 19120 Feb 17 2020 wp-settings.php -rw-r--r-- 1 http http 31112 Feb 17 2020 wp-signup.php -rw-r--r-- 1 http http 4764 Feb 17 2020 wp-trackback.php -rw-r--r-- 1 http http 3150 Feb 17 2020 xmlrpc.php user01@nas01:~$
MariaDB
Check MariaDB installed package via Package Center:
and its key settings through Nain Menu:
The binaries of MariaDB package, are installed at: /usr/local/mariadb10/bin folder. So, you can check MariaDB’s version using the mysql –version command:
$ /usr/local/mariadb10/bin/mysql –version
user01@nas01:~$ /usr/local/mariadb10/bin/mysql --version /usr/local/mariadb10/bin/mysql Ver 15.1 Distrib 10.3.7-MariaDB, for Linux () using readline 5.1 user01@nas01:~$
You can check the status of MariaDB via synoservice command:
$ sudo synoservice –status pkgctl-MariaDB10
user01@nas01:~$ sudo synoservice --status pkgctl-MariaDB10 Service [pkgctl-MariaDB10] status=[enable] required upstart job: [pkgctl-MariaDB10] is start. ======================================= user01@nas01:~$
Next, you can login to MariaDB via CLI e.g. as ‘root’ user and obtain its status info from within it:
$ /usr/local/mariadb10/bin/mysql -u root -p
user01@nas01:~$ /usr/local/mariadb10/bin/mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 33316 Server version: 10.3.21-MariaDB Source distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> MariaDB [(none)]> status -------------- /usr/local/mariadb10/bin/mysql Ver 15.1 Distrib 10.3.21-MariaDB, for Linux () using readline 5.1 Connection id: 33316 Current database: Current user: root@localhost SSL: Not in use Current pager: more Using outfile: '' Using delimiter: ; Server: MariaDB Server version: 10.3.21-MariaDB Source distribution Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /run/mysqld/mysqld10.sock Uptime: 76 days 20 hours 43 min 50 sec Threads: 7 Questions: 3423827 Slow queries: 0 Opens: 312012 Flush tables: 1 Open tables: 10 Queries per second avg: 0.515 -------------- MariaDB [(none)]>
Then you check databases (schemes) installed, as well as the users defined. You can do that by using the statement: SHOW DATABASES; and the sql command: SELECT User From mysql.user;). Then quit, typing \q and ENTER:
MariaDB [(none)]> MariaDB [(none)]> MariaDB [(none)]> MariaDB [(none)]> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | phpmyadmin | | wpdb1 | +--------------------+ 5 rows in set (0.071 sec) MariaDB [(none)]> MariaDB [(none)]> MariaDB [(none)]> SELECT User From mysql.user; +---------+ | User | +---------+ | root | | root | | root | | wpuser1 | +---------+ 4 rows in set (0.085 sec) MariaDB [(none)]> MariaDB [(none)]> MariaDB [(none)]> \q Bye user01@nas01:~$
phpMyAdnmin
Check phpMyAdmin package via Package Center:
NB: The whole phpMyAdmin package is installed under the /web folder:
After the installation, you can use its web interface using your browser. If, for instance, the local LAN IP of your Synology NAS server is 192.168.1.216, then you can type http://192.168.1.216/phpMyAdmin/index.php. Use your username and password to connect to the MariaDB:
From the Home Screen of the phpMyAdmin interface, you can also be informed about versions installed for the key components, such as Nginx, MariaDB and PHP:
You can continue navigating through the web interface of phpMyAdmin:
PHP
Check PHP package(s) via Package Center (this is for PHP package version 7.2):
Looking again through the Web Station Virtual Hosts [see above in this post] you can see what is the chosen profile. Then you can proceed and check the specific setting for that profile and extensions installed.
Let’s play around with the command shell (terminal/ssh).
Inspecting php installation(s)
If you try to get the php version info using the PHP -v command you will see that the default version is the 5.6:
$ php -v
user01@nas01:~$ php -v PHP 5.6.11 (cli) (built: May 12 2020 05:32:09) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies user01@nas01:~$
And the configuration file (php –ini) is :
$ php –ini
user01@nas01:~$ php --ini Configuration File (php.ini) Path: /etc/php Loaded Configuration File: /etc/php/php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none) user01@nas01:~$
However, looking at the packages installed you will see all different version of PHP packages installed:
$ ls -al /var/packages
user01@nas01:~$ ls -al /var/packages total 148 drwxr-xr-x 37 root root 4096 Nov 8 18:24 . drwxr-xr-x 17 root root 4096 Nov 1 14:35 .. drwxr-xr-x 4 root root 4096 May 23 2019 Apache2.2 drwxr-xr-x 4 root root 4096 Nov 1 13:40 Apache2.4 drwxr-xr-x 4 root root 4096 Nov 1 13:59 AudioStation drwxr-xr-x 4 root root 4096 Jan 1 12:34 DNSServer drwxr-xr-x 5 root root 4096 Nov 1 13:57 DownloadStation drwxr-xr-x 4 root root 4096 Sep 28 18:51 exFAT drwxr-xr-x 4 root root 4096 Jan 1 12:34 FileStation drwxr-xr-x 4 root root 4096 Sep 11 2019 Java8 drwxr-xr-x 5 root root 4096 Nov 1 13:43 MariaDB10 drwxr-xr-x 4 root root 4096 Apr 15 2020 mc drwxr-xr-x 4 root root 4096 Jan 1 12:37 MediaServer drwxr-xr-x 4 root root 4096 Nov 1 13:58 Node.js_v12 drwxr-xr-x 4 root root 4096 Apr 16 2018 Node.js_v4 drwxr-xr-x 4 root root 4096 Sep 11 2019 Node.js_v8 drwxr-xr-x 5 root root 4096 May 23 2019 NoteStation drwxr-xr-x 4 root root 4096 Nov 1 14:36 OAuthService drwxr-xr-x 4 root root 4096 Sep 11 2019 PDFViewer drwxr-xr-x 4 root root 4096 May 14 2019 Perl drwxr-xr-x 4 root root 4096 Nov 1 13:44 PHP5.6 drwxr-xr-x 4 root root 4096 Nov 1 13:45 PHP7.2 drwxr-xr-x 4 root root 4096 Jan 1 12:35 PHP7.4 drwxr-xr-x 4 root root 4096 Nov 1 13:45 phpMyAdmin drwxr-xr-x 4 root root 4096 May 25 2020 StorageAnalyzer drwxr-xr-x 4 root root 4096 Jan 1 12:35 synocli-file drwxr-xr-x 4 root root 4096 May 25 2020 SynoFinder drwxr-xr-x 5 root root 4096 May 25 2020 SynologyApplicationService drwxr-xr-x 5 root root 4096 Jan 1 12:36 SynologyDrive drwxr-xr-x 5 root root 4096 Jan 1 12:40 SynologyMoments drwxr-xr-x 4 root root 4096 May 14 2019 TextEditor drwxr-xr-x 5 root root 4096 Nov 1 13:55 Tomcat7 drwxr-xr-x 5 root root 4096 Nov 1 13:56 USBCopy drwxr-xr-x 5 root root 4096 Nov 1 14:03 VideoStation drwxr-xr-x 4 root root 4096 May 21 2019 WebDAVServer drwxr-xr-x 4 root root 4096 Nov 1 13:39 WebStation drwxr-xr-x 5 root root 4096 Nov 1 13:51 WordPress user01@nas01:~$
We can look for instance the contents of the php7.2 package:
user01@nas01:~$ ls -al /var/packages/PHP7.2 total 76 drwxr-xr-x 4 root root 4096 Nov 1 13:45 . drwxr-xr-x 37 root root 4096 Nov 8 18:24 .. drwxr-xr-x 2 root root 4096 Nov 1 14:36 conf -rw-r--r-- 1 root root 0 Nov 1 13:45 enabled lrwxrwxrwx 1 root root 29 Nov 1 13:44 etc -> /usr/syno/etc/packages/PHP7.2 -rw-r--r-- 1 root root 59756 Nov 1 13:44 INFO drwxr-xr-x 2 root root 4096 Jun 5 2020 scripts lrwxrwxrwx 1 root root 25 Nov 1 13:44 target -> /volume1/@appstore/PHP7.2 user01@nas01:~$
The configuration file for that package is php-fpm.ini and it is located at: /volume1/@appstore/PHP7.2/misc folder. You can check it:
$ cat /volume1/@appstore/PHP7.2/misc/php-fpm.ini
The php7.2 main executable file php72 is located at: /volume1/@appstore/PHP7.3/usr/local/bin/. So, you can use it directly to obtain relevant information, such as the full php 7.3 version, modules installed, etc.
$ /volume1/@appstore/PHP7.2/usr/local/bin/php72 -v
user01@nas01:~$/volume1/@appstore/PHP7.2/usr/local/bin/php72 -v PHP 7.2.29 (cli) (built: Jun 5 2020 14:21:39) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies user01@nas01:~$
$ /volume1/@appstore/PHP7.2/usr/local/bin/php72 -m
user01@nas01:~$ /volume1/@appstore/PHP7.2/usr/local/bin/php72 -m [PHP Modules] bcmath bz2 calendar Core ctype curl date dba dom exif fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap libxml mailparse mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_dblib pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix readline Reflection session shmop SimpleXML soap sockets SPL sqlite3 ssh2 standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules] user01@nas01:~$
Finally, you can also use the synoservice command to get a short staus info about php7.2:
$ sudo synoservice –status pkgctl-PHP7.2
user01@nas01:~$ sudo synoservice --status pkgctl-PHP7.2 Password: Service [pkgctl-PHP7.2] status=[enable] required upstart job: [pkgctl-PHP7.2] is start. ======================================= user01@nas01:~$
WORDPRESS
Check the WordPress package via Package Center:
As we have already seen, the default WordPress site and its folder structure is located under the /web folder, i.e. /volume1/web/wordpress.
Also, you can always list and/or navigate to the contents of the /volume1/web/wordpress folder by using your terminal/ssh:
$ ls -al /volume1/web/wordpress
user01@nas01:~$ ls -al /volume1/web/wordpress total 204 drwxrwxrwx+ 1 http http 618 Dec 6 11:24 . drwxrwxrwx+ 1 root root 142 Nov 29 13:10 .. -rwxrwxrwx+ 1 http http 764 Dec 12 2018 disabled.html -rwxrwxrwx+ 1 http http 435 Nov 29 12:54 .htaccess -rwxrwxrwx+ 1 http http 424 May 20 2019 .htaccess.org -rwxrwxrwx+ 1 http http 420 Dec 1 2017 index.php -rw-r--r-- 1 http http 19935 Feb 17 2020 license.txt -rwxrwxrwx+ 1 http http 0 Dec 12 2018 pingbackIsOpend -rwxrwxrwx+ 1 http http 278 Dec 12 2018 syno-misc.php -rw-r--r-- 1 http http 6939 Feb 17 2020 wp-activate.php drwxr-xr-x 1 http http 2618 Feb 17 2020 wp-admin -rw-r--r-- 1 http http 369 Feb 17 2020 wp-blog-header.php -rw-r--r-- 1 http http 2283 Feb 17 2020 wp-comments-post.php -rwxrwxrwx 1 http http 3836 Nov 1 13:51 wp-config.php drwxrwxrwx+ 1 http http 134 Jan 17 10:12 wp-content -rw-r--r-- 1 http http 3955 Feb 17 2020 wp-cron.php drwxr-xr-x 1 http http 7652 Feb 17 2020 wp-includes -rw-r--r-- 1 http http 2504 Feb 17 2020 wp-links-opml.php -rw-r--r-- 1 http http 3326 Feb 17 2020 wp-load.php -rw-r--r-- 1 http http 47597 Feb 17 2020 wp-login.php -rw-r--r-- 1 http http 8483 Feb 17 2020 wp-mail.php -rw-r--r-- 1 http http 19120 Feb 17 2020 wp-settings.php -rw-r--r-- 1 http http 31112 Feb 17 2020 wp-signup.php -rw-r--r-- 1 http http 4764 Feb 17 2020 wp-trackback.php -rw-r--r-- 1 http http 3150 Feb 17 2020 xmlrpc.php user01@nas01:~$
NB: The above files are created when you install ‘officially’ the WordPress via Synology NAS Package Center following the default/suggested settings (You can see more in this post). Generally, the files, subfolders and the whole folder/file structure is the same as the standard WordPress installation. However, there are some files that are specific to the ‘official’ Synology NAS Package Center installation. These are:
- The .htaccess file:
# BEGIN WordPress # The directives (lines) between `BEGIN WordPress` and `END WordPress` are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. # END WordPress # 200426 - Block WordPress xmlrpc.php requests - It disables everything.... # <Files xmlrpc.php> # order deny,allow # deny from all # allow from 192.168.0.50 # </Files>
- The syno-misc.php file:
<?php class csSYNOWordPressMisc { static function get_home_path($home, $siteurl) { $root_dir = '/var/services/web'; if ( $home != '' && $home != $siteurl ) { $home_path = $root_dir . "/wordpress/"; } else { $home_path = ABSPATH; } return $home_path; } } ?>
- And the .pingbackIsOpend file, which seems to do nothing and it remains empty.
You can delete the last 2 files since they seem that they do not affect the WordPress installation and functionality. The .htaccess is a configuration file that can be used with web sites running under the Apache Web Server. You can get some more info from another post on this site, here.
Furthermore, you can recall, that the /web/wordpress folder is also defined as the Document root at the Virtual Host settings of the Web Station:
And these settings are reflected inside the httpd-vhost.conf file as a virtual host defined in the block between <VirtualHost *:80 *:443> </VirtualHost> tags:
<VirtualHost *:80 *:443> ServerName www.mysite.com SetEnv HOST www.mysite.com DocumentRoot "/volume1/web/wordpress" <IfModule dir_module> DirectoryIndex index.html index.htm index.cgi index.php index.php5 </IfModule> <Directory "/volume1/web/wordpress"> Options MultiViews FollowSymLinks ExecCGI AllowOverride All <IfModule authz_core_module> Require all granted </IfModule> </Directory> <FilesMatch "\.(php[345]?|phtml)$"> SetHandler "proxy:unix:/run/php-fpm/php-f4d357e4-6d9e-420f-b23e-c2b2c9184588.sock|fcgi://localhost" </FilesMatch> </VirtualHost>
Finally, take into account that you can always install, manually, a new WordPress site, by downloading the compressed file and deploying it under the /web folder in a new directory.
NB: In this post of the present site you can find instructions on how to obtain the installation files and in this post there detailed instructions on how to set up a brand-new WordPress site in macOS. However, the process is almost the same for a manual installation of a WordPress site in a Synology NAS server. See here [tbu] how-to.
That’s it for now!
Thank you for reading!