Install WordPress from WordPress.org on Synology

Steve
Posts: 119
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

If the web folder still contains the original index.html file, rename it to something like syno-index.html. Click this link to download an index file for WordPress. Extract the file to your web folder.

If WordPress is installed in a folder named wordpress, it should load when you access your website. If the folder is named something else, you will need to edit the path and change the folder name. Use an editor like Komodo IDE or NotePad++ or one that does not add BOM (Byte Order Mark) characters.

If you want to use a virtual host, make sure you are using all lower case. If the URL for your website contains upper case characters, it will not work.
wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

This is where I am at the moment! I did do some typing in my index.php file which looks the same as yours apart from the comments. Just in case, I downloaded your file and copied it into the WEB directory., renaming my one. Same result - timeout.

My Synology Wordpress set-up has never worked from outside, and one of the processes I followed in my journey to try and fix this was a recommendation to allow Apache 2.4 and PHP 7.3. This involved i) copying the contents of the Wordpress directory to a backup; ii) taking the Synology option to unistall Wordpress but saving the database; iii) installing Apache 2.4 and PHP 7.3; then copying back the Wordpress files. Of course now, if I look in package centre at installed packages Wordpress is not there as one of the installed packages, but I don't think that should matter?

Although I think virtual hosts is a good option for me, I don't think playing around with them at the moment will help solve this problem ...

By the way, I have had so many windows open trying to work on this, I thought I was posting on the "set up a website" article, but I see I am on the "install Wordpress from WordPress.Org". Sorry this is a mistake, because I haven't tried to do that yet - I am still working with the Synology package.
Last edited by wobble on Tue May 26, 2020 12:05 pm, edited 1 time in total.
Steve
Posts: 119
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

In your first post you stated:
wobble wrote:I cannot get it to show the Wordpress site - which I can view using the internal IP address of my server n.n.n.n/wordpress.
If you can still view WordPress locally, login to the WordPress dashboard and go to General Settings.

Check the WordPress Address URL and the Site Address URL. If these are pointing to 192.168.1.x you will never be able to access from the internet, only locally. The URL entries must match the internet URL you are using.
wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

This is interesting. I have changed the URL in the database - hoping to reflect virtual host or not - currently the database has both set to my domain name URL with 'wordpress'.

In Wordpress general setting admin screen though the Wrdpress Address URL see stuck on a '192.168.../wordpress' and greyed out, not reflecting the database value.

Can I change this?
Steve
Posts: 119
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

First, what is entered in the WordPress URL has nothing to do with directing a virtual host. A virtual host looks at the URL and directs the request to the folder specified in the virtual host settings. However, the WordPress and Virtual Host URLs must match.

WordPress writes information into various places to prevent someone easily hacking your site. So go to your WP database and change whatever you changed earlier back to the local address i.e. 192.168.x.x/wordpress. Then log into WordPress and see if the address is still greyed out. If it is not greyed out, change it to your domain's URL address as follows:
WordPress Address (URL) http://mydomain.com/wordpress (Use https if using an SSL certificate)
Site Address (URL) http://mydomain.com (Use https if using an SSL certificate)
You will need to use the php index file discussed earlier for this to work.
After you change the URL, you will lose the ability to log in locally.

In my opinion, the easiest way to set up getting to your website is use a virtual host. Log into DSM and select web station. In general setting set the backend to nginx and php to the version you want to use. Then select php and confirm the version of php you want to use is present and configured. You will probably not need to change anything here.

Then select Virtual Host. Select create and enter your domain in the box. DO NOT add http or https just the domain name and extension such as: mydomain.com or www.mydomain.com depending on how you registered the name. It must be lower case. Check the box for ports 80/443. Now you must enter the document root path. Select browse and browse to the WordPress folder. When the folder is highlighted click the select button. Now select Apache for the HTTP back-end server and the version of php you want to use and you're done unless you are using an SSL certificate. If you are, check the HSTS and HTTP/2 boxes.

When you open your browser and enter your domain name, if you have set up the DDNS servers and registered your domain name correctly, you will go directly to the WordPress folder via the virtual host.
Last edited by Steve on Tue May 26, 2020 2:12 pm, edited 1 time in total.
wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

I've updated the database for 'home' and 'siteurl'. After logoff / logon the general settings page still has Wordpress Address (URL) greyed out with a http://192.168.1../wordpress entry.

I've looked everywhere to find occurences of '192.168..', it is not in any config or function files. In the database however it occurs in ftp credentials and in a variable to do with a theme which I used when I originally set this up. It also occurs many times in the site content. So I think it is time to begin again, do you agree? I'm not sure of the process for this - as I mentioned above I not longer have the Synology Uninstall option. Or maybe I can just delete the site content somehow.

I would want to to use virtual hosts. In your last note you advised using nginx, does that mean you advise against apache 2.4?

I will want to use https eventually. Should I get SSL set up beforehand or can I do it later? This is another area where I have had no success so far. Using DDNS I can redirect port 80, but there's no option for port 443 as far as can see ... this may be behind my failure. Lets Encrypt does not recognise my domain.
Steve
Posts: 119
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

wobble wrote:So I think it is time to begin again, do you agree?
When I first started the WordPress site I did something similar and ended up starting over. It appears you have a bit of a mess so a fresh install might be best. I did a search on one of my websites and here are the tables that refer to the domain. All references to the doamin are important but the first four are critical. If you are using WP-Forms, those entries are critical too.
1 match in wp_users
18 matches in wp_options
4 matches in wp_postmeta
47 matches in wp_posts
1 match in wp_comments
9 matches in wp_statistics_search
15167 matches in wp_statistics_visitor
16 matches in wp_wpforms_entries
25 matches in wp_wpforms_entry_fields
 
You can run queries to change these but if you make a mistake, you could end up with a bigger mess.

If you have WP content you want to keep in your existing database, make a backup using the WordPress Export option. You can import it into the new database.
wobble wrote:I no longer have the Synology Uninstall option. Or maybe I can just delete the site content somehow.
Once you install Synology WordPress certain information remains in the package folder even if it is deleted. It won't hurt anything but can be removed using putty or a similar editor. I prefer using WordPress from WordPress.org. It works great but does not update automatically until you add some code in the config file. That is explained in the parent for this thread.
wobble wrote:In your last note you advised using nginx, does that mean you advise against apache 2.4?
No using Apache is fine and works well for WordPress. If you read my message for carefully, I was referring to the default backend when using a Virtual Host but you can use Apache for this as well. I have another website application that uses nginx so I run both. If you are not going to use a Virtual Host for Word Press, set the default Back-end to Apache.

You do not need to add SSL at this point as it is fairly easy to add after you get everything working. Adding SSL can complicate things when you are starting out. You can get errors due to serving http content on a https connection. Additionally, if you do not set up your certificate correctly, many browsers will not let you connect.
wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

I've made a new install from wordpress.org in a parallel folder /web/wordpress_org.

I've set up a new database user and database.

My domain name points to the default Index.html file in /web. If I add /wordpress_org to the domain name it times out. Deja vu! No clue about why this is. Port 80 looks open on a port checker. My DDNS service translates forwards it to another port which my router resolves to 80 on my synology box.
Steve
Posts: 119
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install WordPress from WordPress.org on Synology

Post by Steve »

wobble wrote:My domain name points to the default Index file.
I do not understand your domain name points to the default index file. Typically a DDNS service forwards requests on port 80 automatically. All the DDNS service is doing is translating your domain name to an IP address. Your router should be setup to forward ports 80 and 443 to you NAS LAN address. When a WAN request comes to the NAS, it is sent to the web folder which automatically loads whatever index file is present. Keep in mind index.html loads before index.php.

Your DDNS service should contain the host name and the IP address. Check your local IP address and then confirm it is the same as that listed on your DDNS provider.

Since your dealing with multiple issues, first confirm WAN traffic is directed to your NAS. The easiest way to do this is re-enable the Synology index.html file. VIewing the page using the LAN address does not mean anything when dealing with internet visibility. To confirm it's working, type your domain name into your browser. If everything is correct the Synology earth and web station is not setup message should appear. If it does not, either your router, NAS of DDNS provider has an incorrect setting. If the Synology page appears, rename the Synology index.html file and use the index.php file that points to your new WP installation. When everything is correct WP will load.
wobble
Posts: 13
Joined: Mon May 25, 2020 4:46 pm

Re: Install WordPress from WordPress.org on Synology

Post by wobble »

Sorry I wasn't clear, by 'the default index file' I mean the index.html file in the /web directory - the one that displays "the Synology earth and web station is not setup message". I've never had a problem reaching this from my domain URL, it is the next bit that doesn't work - getting into the /wordpress directory, or now the /wordpress_org directory.

Note I haven't been through the install process yet.

I got as far as "Example URL if WordPress is installed a web sub-folder: http://your_domain_name/wordpress_folder_name" in the instructions in the how-to section above.

I'll have another go as you suggest.

So after renaming the index.html and copying to /web and modifying the index.php file to point to wordpress_org I got an PHP error message (so it does connect!) which I corrected, then I got a 404 message. (Maybe because the package is not installed yet?)
Last edited by wobble on Wed May 27, 2020 3:40 pm, edited 1 time in total.