Install TNG on a Synology NAS

Paul Barrett
Posts: 68
Joined: Sun Apr 08, 2018 6:52 pm

Re: Install TNG on a Synology NAS

Post by Paul Barrett »

Hi Steve,

I'm about to do an install of TNG on a DS1821+ to two Seagate Ironwolf 1TB SSDs in SHR

Haven't done this in a while. I shall be following your guide

PHP 7.4/MariaDB 10

What's your advice re Apache 2.4 versus NGINX as the back end, please?

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

Re: Install TNG on a Synology NAS

Post by Steve »

Both Apache and NGINX work fine with TNG. However you cannot use bot trap or an htaccess file with NGINX. If you want to control access to your site you can use Rip Prevention with Apache or NGINX which allows monitoring and blocking IP addresses.
Paul Barrett
Posts: 68
Joined: Sun Apr 08, 2018 6:52 pm

Re: Install TNG on a Synology NAS

Post by Paul Barrett »

Sounds like Apache it is then! Thanks
john_mpls
Posts: 4
Joined: Thu Feb 25, 2021 2:29 pm

Re: Install TNG on a Synology NAS

Post by john_mpls »

Steve,

Hoping you can help -- I posted on the TNG community page with no luck. Stuck at the "Please wait, attempting to process..." message.

I'm a newbie to PHP (but not to programming), but am certainly willing to roll up my sleeves. Are there debug commands I can edit into the script that is "attempting to process" so I can get a better idea of what is failing?

Here's the text of my message from the TNG forum. And here's the link with the screenshots of all of the dialogs that may give some clues: https://tng.community/index.php?/forums ... o-process/

I'm stuck on step 6 of the Readme HTML installation guide with the dreaded "Please wait, attempting to process..." message.

TNG v12.3, MariaDB 10, PHP 7.2, DB name: "tng", DB username: "tng-local". I'm running the Readme from the URL to the web volume on the Synology DS916. Also have referenced SKDavis' install guide for Synology.

I believe I have followed all of the other steps without missing or having issues. Screen shots attached to show privileges, versions, etc. (password omitted on screen shot but included during install). Have googled this and tried other suggestions, but I appear to be overlooking or misunderstanding something.


Appreciate any suggestions or help!

Thanks.

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

Re: Install TNG on a Synology NAS

Post by Steve »

Connecting to the database is pretty straight forward with TNG. Please refer to this section viewtopic.php?f=9&t=6#7 and scroll down to section 6. I typically use mixed case characters with numbers and the following special characters (_)*#$<^>{-}@![,] for the database user name and password.

Make sure you are using the correct port for MariaDB. You can click MariaDB from the Synology menu and the port is displayed.

The only other problems are usually typos or the MySQLi module is not enabled in PHP. To check this module, open Web Station and select PHP Settings. Highlight the PHP version you are using and the click the Edit Tab. Scroll down and make sure the mysqli box is checked. You don't need the PDO or sqlite3 versions for TNG. You can also enable openssl if you are using https.

If you are using a virtual host make sure it is using a php profile that has mysqli enabled.

Once everything is correct it should connect.
Last edited by Steve on Mon Mar 01, 2021 4:54 pm, edited 3 times in total.
Reason: Corrected database connection information
john_mpls
Posts: 4
Joined: Thu Feb 25, 2021 2:29 pm

Re: Install TNG on a Synology NAS

Post by john_mpls »

Steve,

Thank you for the quick reply. Unfortunately I still am not connecting.

I've deleted the database and user and recreated them with the same name, following the steps in your guide.
I've used all lower case for the user and database (i.e., "tng")
I've verified the port is 3307 (MariaDB10) and the socket is /run/mysqld/mysqld10.sock, but no combination of localhost:3307, localhost:3307/tng or localhost with port number set gets me any further. I've tried using this socket in the socket field, and also leaving it blank; same result -- no connect.
I'm installed in the tng directory under web, and am not using a virtual host.
I've verified the MySQLi module is enabled.
Using PHP 7.2 and Apache 2.4. Those are only version installed.
I'm viewing readme.html in firefox from 192.168.x.x/tng/readme.html.

Any guidance on doing stuff from the CLI / manually so that I can get error results or tell what is not working (rather than through the "Save and Verify" button on readme.html)?

Thanks.

John
john_mpls
Posts: 4
Joined: Thu Feb 25, 2021 2:29 pm

Re: Install TNG on a Synology NAS

Post by john_mpls »

I have resolved my problem --

It appears I had an invalid password at one time (contained an apostrophe) and that confuses the parsing of config.php. Once it is written with the apostrophe, it appears it can not be written again. So it was the write of config.php that was failing, not the connection to the database.

I resolved this by downloading config.php, editing out the old password and replacing it with "password123", then uploading it and chmod'd it to 666 just to be sure. Then next time I tried step 6, I got "Information saved but connection failed" as expected (since I used another fake password in the dialog). When I use the correct password (that doesn't contain an apostrophe now), I get "Information saved, connection verified!"

For me the key was seeing that config.php wasn't writing, and Darrin's insight into the apostrophe.

Thanks!

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

Re: Install TNG on a Synology NAS

Post by Steve »

Thanks for passing along that information. I have never run into the apostrophe/password problem and will have to look into how that occurs.
john_mpls
Posts: 4
Joined: Thu Feb 25, 2021 2:29 pm

Re: Install TNG on a Synology NAS

Post by john_mpls »

FWIW, I don't think it is specific to Synology / DSM install, but I happened to find it there because that is where I installed first; then any other changes to that install (even with a different password) went into the bitbucket. Since I didn't use that bad password on my hosted site, I didn't get blocked there.
Steve
Posts: 130
Joined: Sun Oct 01, 2017 3:08 pm

Re: Install TNG on a Synology NAS

Post by Steve »

I don't know what I was thinking earlier. Using double or single quotes (apostrophes) is a problem because PHP uses them to define variables. This is also true when PHP is used to display text. You might find this link useful. Here is an additional link on slashes.