2 server setup

2 server setup

by Paul Smith -
Number of replies: 8

I am a REAL Ubunto newbie so please be gentle smile

I am trying to set up a new moodle environment and after some advice in a different forum, I am using separate Web and SQL servers.

So far I have identical Ubuntu 18.04 servers setup, I have followed various tutorial and walkthroughs but I am now stuck. I have managed to get to the pint where I can load the initial moodle setup webpage but keep getting an "Error: Database connection failed"



I have checked in the moodle folder on the webserver and I don't have a config.php, just a config-dist.php. Could this be the problem?

Average of ratings: -
In reply to Paul Smith

Re: 2 server setup

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Nope... almost certainly your MySQL setup is wrong and/or your GRANT command was wrong.

Firstly, Ubuntu out of the box does not allow remote connections to MySQL. This is a DigitalOcean help page but it should be pretty clear, https://www.digitalocean.com/community/tutorials/how-to-allow-remote-access-to-mysql

Secondly, your Database user *cannot* be correct. It isn't @ anything, it's just a name. You need to make sure your GRANT command is correct. So the grant (on the db server) would look something like...

GRANT .... ON moodledb.* to moodleadmin@'10.10.0.14' IDENTIFIED BY 'whateveryourpasswordis'

Replace the .... with the permissions (too lazy to look them up but never ALL) and 10.10.0.14 with whatever the IP or hostname of your web server machine is. Then (to repeat) your Database user is just 'moodleadmin'
Average of ratings: Useful (1)
In reply to Howard Miller

Re: 2 server setup

by Paul Smith -
Thanks Howard, that makes perfect sense. I think I had just reached my personal input capacity. I had been running the GRANT command (I think it was from another digitalocean resource) but I was applying it to a user called moodleadmin on the SQL server.
My nest course of action was to look at the external MySQL connections, but as I have had a total of about 3 days experience with Linux of any form, my brain was starting to hurt so I had put that off until tomorrow.
In reply to Paul Smith

Re: 2 server setup

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

If you are new to Moodle and to Linux, why make the "learning curve" four times steeper by going to this twin server installation. I repeat in the forums, "grow with your server". Your institution starting Moodle/Linux is the best that could happen (as opposed to inheriting a running/neglected Moodle server). Here is the https://docs.moodle.org/en/Step-by-step_Installation_Guide_for_Ubuntu.

Another thing on hardware resources. Premature plans for "scalable" servers can kill your initial experience. It is quite the opposite. By trying to get the maximum out of the smallest server you see the bottlenecks early and learn how to overcome them. (The key is monitoring. But all that takes time. You'll find the initial pointers in the header of the Hardware and performance forum.)
In reply to Visvanath Ratnaweera

Re: 2 server setup

by Paul Smith -
Thanks for your reply. I am just doing the initial config of these servers and the computer science dept are taking over after that. This setup is done by their request. I get your point about not learning from the server(s) reaching a bottleneck, but I have a VMWare server at my disposal with oodles of resources available.
At the moment, this is more a proof of concept and a tool to convince the headmaster that it's a valid and useful resource for all the faculties to utilise. My feeling is that at that point we will look at a hosted solution where someone with more expertise than me looks after the backend settings.
In reply to Paul Smith

Re: 2 server setup

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Your chosen path makes perfect sense. Yes, those "oodles of resources" are tempting. I am not the doctor who feels the patients wallet before prescription.

Anyway, you aim was to get a Moodle server going. I see that Howard's guess was spot on. The administration of the Moodle server will be nothing for a computer science department.

So, we can call this thread resolved. You are welcome to come back any time, with questions on Linux, I mean.
wink
In reply to Visvanath Ratnaweera

Re: 2 server setup

by Paul Smith -
I think you might be correct, I think I will end up doing the admin as and when we go live. For now, it is internal use only. I have a feeling I will be back many times as I ensure that our setup is secure enough to open to the outside world.
Yes, this thread can be marked as resolved. Thank you both for your input and guidance.