Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Craig Gardner -
Number of replies: 10

Hello Moodle folk,

Firstly, I have been following this site for a few months extracting all the finer detail and building an environment that is a little different and where 1 or more threads don't quite give me the full confidence as this is more based on a LAMP model. So thankyou for all the snippets of information.


Current Environment:

  • 38 Disparate Sites
  • 4000 Computers
  • Windows Server Failover Clusters (WSFC) at each site in 2 Node Mirror
  • Central Higher Bandwidth Site with 3 Node WSFC
  • All different Subnets
  • ALL SITES OPERATE RETROSPECTIVLY WETHER WAN LINK IS UP OR NOT * This is a must for continuance of training*


Current Position:

I have engineered successfully a single site (SITE TEMP) to have a full working access point for Moodle courseware to all the other 38 Sites. The network isn't by any means to latent and was done at a remote site so the Moodle administrator can add all the courses and look/feel etc locally.

So this consists of (Baring in mind it was just for development);

  • Windows Server 2016 VM hosting;
  1. Microsoft IIS 10
  2. PHP 7.0
  3. MS SQL 2016 with 5.3 Driver
  4. Moodle 3.6.2 within the www root 


The bigger plan is to have the ability to incorporate it into the 'Top Level' WSFC for high Availability and co-ordinate the \MoodleData folder over the network using DFS-R.

SQL VM's Split over 3 NODES within the cluster using Always ON Availability Groups (AG) *Standard Licencing*

MSSQL Publish / Subscribe Unless there is a way to get around this and copy the database as a 1 time deal?

IIS Application Request Routing (ARR) for Network Load Balancing (NLB) for the moodle wwwroot.

HAVE THE ABILITY TO ACCESS THE CONTENT LOCALLY USING NLB DIRECTED BY IIS SERVER OR IN THE EVENT OF TOP LEVEL SWITCH OR WAN LINK FALIURE AT ANY SITE. 


Problem:

I have like hundreds of ideas and plans in my head/on paper and trying to find common ground with them is haunting me as its all in the detail. A detail where Moodle is off topic for me as I have worked with Microsoft technologies for years.

Essentially I would like to know the best way to accomplish the Moodle aspect with regards to clustering, HA, offsite local replication and database responses for how Moodle would behave.


Notes:

This is a fully enclosed domain with no external connectivity to the Internet. It operates within the confines of an Intranet.


I hope this was informative and all support is welcome.


\Craig

Average of ratings: -
In reply to Craig Gardner

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Usman Asar -
Picture of Plugin developers Picture of Testers

Craig,

you mentioned 3 nodes of DB server, but 38 sites, how are sites linked? as you as well mentioned case of failure of WAN connection.

Also, when using DFS-R, it wont be just moodledata, but moodle folder as well, unless you're going to copy over moodle folder on all nodes manually after every upgrade/plug-in addition. 

In reply to Usman Asar

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Craig Gardner -

Many thanks for gettig back to me.


The sites are all connected to form a ‘Lan Interconnect’ using private BT( British Telecom) secure circuits routed through a massive Private area Network (PAN) if you like.


If im sat in site B and the WAN link fails due to maintenance or force majure events, then i would still like to access the moodle course ware at the time of disconnect.


Of course resynchronise the topology upon establishment of Network infrastructure.


I’m glad you said ‘moodle folder’ also which has ticked an unknown. I was going to initially deploy it over the domain and then let it run. So i’ll eatablish the DFS relationship for the wwwroot also. Cheers Usman.


So Moodle will require a different prefix i read for this setup for each site?

The remainder of the config.php will be all locally, however i’ll use the URL to the namespace address NLB of IIS and chose locally prefered nodes etc.


I wont have the admins update course ware on local server due to me wanting a better control over replication and not using multimaster.

In reply to Craig Gardner

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Usman Asar -
Picture of Plugin developers Picture of Testers
Craig, my only concern is, 3 Db servers, as you said if PAN link goes down, moodle still be able to operate, where moodle relies on DB and that isnt replicated on every site, how would you expect a disconnected site to communicate with a DB server? unless few "grouped" sites have one DB node that isn't relying on PAN but LAN.

regarding moodle requiring a different prefix for each site, Have you thought of setting up shared configuration? will make administration much easier. make changes in site configuration on main, and it will be reflected all across nodes. Shared configuration is different to shared content. 

regarding DFS-R, keep management console on main server. I can understand the hub-spoke topology for moodle folder as nothing really changes there apart from when upgrading moodle or adding plug-ins, but moodledata folder will have to be on full mesh (assuming people have ability to add courses at any node - or is it the other way around, courses being added from main admin only?)

Things are still little mixed up in my mind, as I am trying to paint the picture of how I would have done it, as I had once thought about testing the whole scenario (as moodle is different than many web applications), but due to hardware limitations (still on 10 year old CPU wink) I couldn't test it myself to able to confidently point you in right direction.
 I have absolutely no knowledge of SQL Server replication to even think about that, as even thinking of a multi server setup, even Open University is using a Postgre SQL server with Master-Slave configuration not even replication. That's why I mentioned my concern regarding 3 DB nodes, but anyway, you're getting there for sure, but do keep updating as I might have something to add to IIS farming, if not, I'll have something to learn smile
In reply to Usman Asar

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Craig Gardner -
Usman,

Thanks again for replying. Much appreciated.

The 3 Database servers are purely there for High Availability as i decided to offer a solution that will also enhance our current position for forest root domain wide SQL servicing for SCCM, McAfee ePO, WSUS, SharePoint etc and with the addition of the Moodle element. Sounds a lot of load for a cluster but it is all flash storage using Microsoft's latest iteration of Storage Spaces Direct (S2D).

Please tell me more on the 'Shared Configuration' aspect and your thought process with this.

I can Publish and subscribe end database servers to update the databases as and when changes occur through the log shipping and merge method (Hub Spoke). However i need to target the correct tables that require this replication and i'm having a mare to allocated the right tables and not the temp ones. I will continue to play in this area till i find the right things i need to replicate across for successful operation. maybe you have seen this before with other SQL iterations?

DFS-R will reside at the top level and be updated by admins via the top level links via IIS Webpage.

Moodle data i will force the hand to only have access to content updated/modified at the top level site. This is one of my sticking points for simplicity and to avoid any tom/dick/harry admin adding locally the relevant course ware or changes.

* A 10 Year CPU :D *

I want to also add this is being dry run and done in a pre-production where hardware is also somewhat limited but scale-able and a not too far of representation (yet in house).

Using NLB on IIS isn't too much of an issue as its handled quite well in server 2016 and up from previous experience.

IF i crack it, I pledge to write a guide on this as i know for sure i'm not the only one in the world that has envisioned this idea and realize there is not much support on this...

\Craig
In reply to Craig Gardner

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Usman Asar -
Picture of Plugin developers Picture of Testers

Hello Craig,

Apologies for a delay, for in my mind I had replied already days back, just coming back to this post today I realised I hadn't. 

Anyway, regarding shared configurations, everything you do in IIS is written in XML files (applicationHost.config XML files), so when setting up a farm, I have to add a website to every instance of the farm. So if I have made some changes in configuration of the website, I have to run around making changes in every server, this is where shared configuration comes in, we share configuration files on a shared network. in your case you'll be sharing this configuration out of your main box and tells every other server to look for configuration changes. Concept is basically similar to shared content, but adding shared configuration, you'll be making changes (weather content or site) on main server to be replicated to all others in farm. 

In order to set up shared configurations, create a folder on main server (say sharedconfigurations)  <<-- this is where you'll be replicating the applicationHost.config file, give permission of domain admins (or whatever you have setup your domain as, you can as well create a dedicated user for that, for example wwwconfig user with read and write permissions to that shared configuration folder) 

Step 1 will be exporting the configuration file, go to IIS manager at server level and you'll find icon shared configurations


Once you open that, you'll find check box of "enable shared configuration" - dont check it yet, export file first to that shared configuration folder


Once you click export, it will ask you for the place to export to (your shared configuration folder) - use your wwwconfig user, enter password and you'll find encryption keys option - this key is used when you'll setup configuration on other servers, to confirm for shared configuration. 

Step 2 : Check that "enable shared configuration" enter wwwconfig user, password and encryption, and you'er done setting up shared configuration.

now you only have to do step 2 on other servers, same method, rather exporting configuration files, just enable shared configuration. 

when you create application pool and setup site on main server, all that will be replicated to other servers, you dont have to setup application pools and sites on other servers, this makes the site management very easy.

only thing, you have to take care of, if for example you're adding an application that you'll be keeping on one server only, then just take servers out of shared configurations and once you're done with setup, re-enable shared configurations again. 

Regarding database replication of ideal tables, do ask for advice of Ken Task, he has expertise in that area. 

some guide at the end would really be worth while, as setting this whole scenario isnt easy task, though Windows server makes the process easy, but its all the attention for setup details that makes a mess. I would have done it practically myself, but then due to hardware limitations I postponed the idea wink

In reply to Usman Asar

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Craig Gardner -
Usman,

Apologies also, I picked this up and subconsciously replied.

What exactly is the 'Shared Configuration' sharing with regards to the environment etc?

I'm under the impression after testing this element that the servers all need to be baseline'd to the same standard with regards to current configuration. For example, wwwroot requires the same vanilla moodle installation package, PHP configured with Fast CGI and the SQL drivers.

Am i right in this approach or does the shared configuration to some degree replicated the smaller piece of this puzzle?

I noticed i can create a virtual directory for example, and it will appear on the other servers configured for shared configuration.


Another Question:

I have setup a remote site with the;

For Now dB Config (until merge tables can be implemented)

  • dbtype - MSSQL
  • dbhost - SQLCluster01
  • Prefix -  mdl_     <---------- I want to use this better to ideally identify different portions of moodle installations at remote sites?


Issue:

At remote site, i hit the local address space and i'm aware that when i click through the courseware it points to the parent cluster for the URL Links. Will moodle still use local resource for moodle data or will the upstream parent manage the files as the database points the links to the parent environment and thus not use its locaaly stored repo for moodle data and webroot etc?


Cheers


\Craig

In reply to Craig Gardner

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Usman Asar -
Picture of Plugin developers Picture of Testers

Craig,


Absolutely right in terms of shared configuration. 

regarding DB, you can use any prefix, but be assured it remains same when merging tables, as on local installation moodle points to table name, and in case of difference once merged, it will create issue. 

moodledata is configured in config.php file, if some portion of the content are called in from central repository then it's ok, moodledata's local folder will serve images, parts of selected theme, user cache and anything uploaded on that instance (which will later be replicated on to other moodle sites's moodledata folder anyway). you can setup moodledata to be used from parent (central repository) but it will impact the speed of moodle. 

In reply to Usman Asar

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Craig Gardner -
Usman,

Great, I get the 'Shared Configuration' now and have implemented this into the design. Changes are being made at master and showing at remote sites.

How much do you know about Application Request Routing (AAR) and URL re-write?

So if i'm at the remote site and i have the copy of the master database locally, and i have the Config.php all pointing to the local server for SQL, WWWroot and MoodleData, then whats the best way to get this to rewrite the URL's pertaining to the master site without having to do it in the moodle admin console to change links everytime.

So i hit URL http://moodle/lms which has many IP addresses (HostA) assigned to it for all the sites. I don't wan't the copied database to redirect to the parent database at the master site. Does that make sense?

Cheers in advance Usman

\Craig
In reply to Craig Gardner

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Usman Asar -
Picture of Plugin developers Picture of Testers

Hi Chris, 

Hope you're getting well along with your setup, I can understand the situation, but weren't there 3 copies for DB in all across your farm? I haven't touched URL ReWrite to the extent that I can tell without referring to IIS documentation, but based on your requirements, you can look into this page

I believe ARR has settings to route incoming traffic to servers, but I haven't practically tested it (remember the limitation of my CPU), but will have a look into it if I can find something out. 

In reply to Craig Gardner

Re: Windows Server 2016, IIS10, MSSQL 2016, PHP7.0 with Moodle 3.6.2+

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Moving to Hardware and performance forum...