How to host a website on 5big Network2

Re: How to host a website on 5big Network2

Postby Jocko » Thu Apr 29, 2021 7:32 pm

:thumbup
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: How to host a website on 5big Network2

Postby lisek » Fri Apr 30, 2021 12:15 am

Maybe this is a very silly question:
What should be the 'Database Host', because 'localhost' doesn't work?
Where are the MySQL databases saved by default?
And how to test if the MySQL/Apache works?
(I would like to add the info to the Step By Step manual)
Thx :)
lisek
Donator VIP
Donator VIP
 
Posts: 20
Joined: Fri Feb 01, 2019 9:15 pm

Re: How to host a website on 5big Network2

Postby Jocko » Fri Apr 30, 2021 8:20 am

hi

About localhost, you may use its related ip instead: 127.0.0.1

To test your config, you can check if the extensions are rightly added by
Code: Select all
php -m
which will list them or in fvdw-sl web-interface, from the menu 'System Information', the tab 'Php and apache status' lists their environment and then the loaded php extensions.

After to test mysql, you may read this page https://www.php.net/manual/en/book.mysql.php
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: How to host a website on 5big Network2

Postby Jocko » Fri Apr 30, 2021 8:28 am

I see you made some progresses on your howto :thumbup
I added few new suggestions.
You refer to an old fvdw-sl patch which has been build for another purpose and it contains some additional files. I'd prefer to use a new tarball with only the missing extensions and this one allows to install them directly in the right folder. So I attached this package
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: How to host a website on 5big Network2

Postby lisek » Wed May 05, 2021 2:24 pm

Today I had some time, and I tried to continue my tutorial however, it seems like I have a problem with SQL because I cannot log in to the MySQL server, and I can't find the SQL config file anywhere on the NAS: 'my.cnf' (it is not in the default locations, or even by using the 'search' option, I can't find it anywhere).

I tried to find some answers of the 'mysqli_real_connect(): (HY000/2002)' problem online, but nothing helped. Even in the manual of SQL I can't find why there could be a problem. Maybe I have to create some config file(s) or start the SQL server in a different way than in my tutorial? No idea... :(

It must be something simple with the first time use of SQL, but I don't know what...
You do not have the required permissions to view the files attached to this post.
lisek
Donator VIP
Donator VIP
 
Posts: 20
Joined: Fri Feb 01, 2019 9:15 pm

Re: How to host a website on 5big Network2

Postby Jocko » Thu May 06, 2021 9:40 am

Hi

Did you run this command ?
Code: Select all
/usr/local/bin/mysqladmin -u root

Maybe you fail to connect because you did not set a password (which is not the password for logging to a shell session) whereas phpmyadmin disables by default (but you may change that) logins without a password. So without setting a password with the mysql root account you can not connect to phpmyadmin.

So run this additional command
Code: Select all
mysqladmin -u root password your_password

Then this time you should be able to connect.

But there is a new issue with version 4.9, phpmyadmin expects at least version 5.5 for mysql and then you are disconnected immediately because we use version 5.1.

This may be easily fixed by patching two files on version 4.9 : common.inc.php and databaseInterface.php, to remove this check (and another one on language settings).
So attached a tarball to install these two files (and also a backup of the original version, extension *.org).
Store it at the root folder of phpmyadmin (so should be phpMyAdmin-4.9.7-zzzz) and untar it in this folder (right click and custom file commands)
Changes are:
* in libraries/common.inc.php
Code: Select all
        if ($GLOBALS['dbi']->getVersion() < $cfg['MysqlMinVersion']['internal']) {
            Core::fatalError(
                __('You should upgrade to %s %s or later.'),
                array('MySQL', $cfg['MysqlMinVersion']['human'])
            );
        }
 
* in libraries/classes/DatabaseInterface.php
Code: Select all
        if (! empty($locale)) {
            $this->query(
                "SET lc_messages = '" . $locale . "';",
                DatabaseInterface::CONNECT_USER,
                self::QUERY_STORE
            
);
        }
(these lines have been commented to disable the check)
Note 1: I updated my pma post. I added an instruction to create a temp directory (do a symlink targetting the folder /tmp). This to remove the related warning in pma GUI.
Note 2: later we go to examine if we release a new version for mysql

Now with it, you should be able to use pma:
pma-logged.jpg


About cnf file as mysqld uses default values, it does not exist. If you want to change some values then you may create it in /usr/local/etc . But I think you should not need to use a custom cnf on mysql server.
You do not have the required permissions to view the files attached to this post.
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: How to host a website on 5big Network2

Postby lisek » Fri May 07, 2021 5:51 pm

Thanks Jocko, but unfortunately it is not the problem with an user/password, but it looks more like it's related to the: 'tmp/mysql.sock' problem - it looks like it doesn't exist (if it should be saved somewhere...?)

Is there any simple method to keep the NAS Raid5 data, and completely clean/delete the firmware, and start again the whole NAS firmware from scratch, but with option to restore my present Raid5 data?

I don't like to give-up, but now I don't have any more ideas of what to check...
lisek
Donator VIP
Donator VIP
 
Posts: 20
Joined: Fri Feb 01, 2019 9:15 pm

Re: How to host a website on 5big Network2

Postby Jocko » Fri May 07, 2021 6:40 pm

Hi

if the socket is missing that would mean mysqld is no longer running, maybe because you did not start it on the background (by using '&' in the commandline). So
try to start it again
Code: Select all
/usr/local/libexec/mysqld --user=root &
and then a socket should be set in /tmp if you did not change its default settings.

lisek wrote:Is there any simple method to keep the NAS Raid5 data, and completely clean/delete the firmware, and start again the whole NAS firmware from scratch, but with option to restore my present Raid5 data?
No need to use this way. Just upgrade the firmware, to get a fresh version 18.2 and delete the folder addons in the share fvdw (stop first any add-on feature: mysqld, transmission, ...).
By this way you will have to re-install all add-ons and also the patch packages for version 18.2

Note to check if a process is running, use the command
Code: Select all
ps -ef
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: How to host a website on 5big Network2

Postby lisek » Fri May 07, 2021 7:05 pm

I'm not 100% sure, but it looks like you have found the problem, which is... encoding problem of my WinSCP (I'm Polish and I use UTF-8 in general).
Each time when I had the problem (see the screenshot) I just removed the '&' symbol ;)
You do not have the required permissions to view the files attached to this post.
lisek
Donator VIP
Donator VIP
 
Posts: 20
Joined: Fri Feb 01, 2019 9:15 pm

Re: How to host a website on 5big Network2

Postby Jocko » Fri May 07, 2021 7:17 pm

Not sure if this option may fix your issue

Check if you set utf-8 encoding in advanced settings of your site:
utf-8.jpg


And you have to restart your Winscp session
You do not have the required permissions to view the files attached to this post.
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

PreviousNext

Return to Lacie 5big Network vs2

Who is online

Users browsing this forum: No registered users and 2 guests

cron