You are on page 1of 38

Implementing

Moodle on a
Windows
High
Availability
Environment
Implementing Moodle 1.9 on 2
Microsoft Load Balanced Web Front
End Server and a Microsoft SQL
Server 2008 R2 Cluster environment

Written by:
Alex Pearce
Email:
apearce@bfcnetworks.com
Blog:
www.learninggateway.net/blogs/ajp
Contents
Introduction ...................................................................................................................................... 2
Understanding the Architecture ........................................................................................................ 2
Pre-requirements .............................................................................................................................. 3
Server Network Interface Cards ..................................................................................................... 3
Domain Users ................................................................................................................................ 3
Shares on SAN ............................................................................................................................... 4
Enabling the required Features and Role ........................................................................................... 4
Connecting to a iSCSI Drive ................................................................................................................ 5
Creating the Cluster........................................................................................................................... 8
Installing SQL Server 2008 R2 as a Cluster ........................................................................................ 13
Configuring Moodle Web Front End Servers. ................................................................................... 17
Installing PHP and Configuration with IIS ......................................................................................... 19
Configuring the PHP.ini file .............................................................................................................. 21
Testing IIS and PHP .......................................................................................................................... 24
Configuring Network Load Balancing ............................................................................................... 25
Testing the Network Load Balance ................................................................................................... 28
Configuring SQL Server .................................................................................................................... 29
Download and Configuring Moodle ................................................................................................. 31
Moving Moodle to be Network Load Balanced ................................................................................ 35
Configuring IIS for remote Moodle files. .......................................................................................... 36

1|P a ge

© Copyright: BFC Networks Limited 2010


Introduction
In recent years the advances of technology have changed the way we teach and learn. Virtual
Learning Environments have taken learning online but the importance of these websites being
accessible 24 hours a day is increasingly important.

Students are using the internet every day and all days and will learn better when it suits them,
teaching in the classroom between 9 and 3 is not where it ends as they log into web pages and
extend their learning when they want.

What happens if the single online learning server goes down and the students can’t learn? They lose
confidence in the technology and are denied the education they want. But technologies from
Microsoft have allowed websites to stay accessible through their high availability products and
features.

Understanding the Architecture


In this scenario there are six servers running in a Microsoft Active Directory domain. Two servers are
running Windows Server 2008 R2 Enterprise edition and the others are running Windows Server
2008 R2 Standard edition.

Windows Server 2008 R2 Enterprise includes the role Microsoft Clustering. In this scenario we are
using the Active/Passive setting which means one server is currently the live server running the
database services while the Passive server is set in standby waiting in case the other server fails. If it
does fail, the passive server will take control of the database services enabling the database to be
online again. This server will then become the active Node. In this whitepaper we will be using 1
Active and 1 Passive but you may want to increase the number of nodes if you require.

Windows Storage Server 2008 allows large amount of data to be stored on a specially designed
storage server which will have a large number of physical hard drives. This technology has been
developed to house data in a central location instead of on multiple servers.

We will be using the Windows Storage Server to house the SQL database and the files required to
run the website.

In this environment we are using virtual servers but depending on your requirements and database
read/write speeds you may want to use physical SQL Servers in your cluster.

The two web front end servers will convert the Moodle PHP files to a website. These two servers
will be Network Load Balanced (NLB) allowing one server to be down and the other to still present
the website. When both servers are online users will connect to both but should one fail the other
will take the load.

2|P a ge

© Copyright: BFC Networks Limited 2010


Server name Description Windows Version
DC Active Directory Windows Server 2008
Domain Controller R2 Standard
DC Moodle-WFE1 Moodle-WFE2
Node1 SQL Server Cluster Windows Server 2008
node 1 R2 Enterprise
Domain Network
Node2 SQL Server Cluster Windows Server 2008
node 2 R2 Enterprise
Moodle-WFE1 Moodle Web Front Windows Server 2008
End 1 R2 Standard
Moodle-WFE2 Moodle Web Front Windows Server 2008
SAN Node1 Node2
End 2 R2 Standard
iSCSI Network iSCSI-SAN Storage Server Windows Storage Server
2008

Pre-requirements
There are a few requirements that are needed through the process of the whitepaper. Ensure you
have the following configured before starting any of the other requests.

Server Network Interface Cards


Each server requires a number of network cards. Make sure you set each of these with the IP
address range depending if that machine requires access to the iSCSI Network. To help with the
process also rename the interface cards from Local Area Connection to the cards role.

Server Number of Network Network Rename to


Cards
DC 1 Domain Network Domain
Node1 2 Domain Network Domain
iSCSI Network iSCSI
Node2 2 Domain Network Domain
iSCSI Network iSCSI
Moodle-WFE1 2 Domain Network Domain
Domain Network NLB
Moodle-WFE2 2 Domain Network Domain
Domain Network NLB
SAN 2 Domain Network Domain
iSCSI Network iSCSI

On top of this you will require four other static IP addresses that will be added to the SQL Cluster
and the Network Load Balance settings.

Domain Users
By default Active Directory will create an administrator username. If you don’t have access to this
you will need permission to add and remove features on your servers. Ensure you have the correct
administrative permissions to the box. You will also require two other usernames md_admin and
SQLServices which should both be Active Directory accounts. They too will require administrative
permission to the servers in this whitepaper.

3|P a ge

© Copyright: BFC Networks Limited 2010


Shares on SAN
We will be storing all the Moodle web files in a share on the SAN. Create a share called Moodle on
the SAN and ensure the md_admin username has permission to the write to the share.

Enabling the required Features and Role


Install Windows Server 2008 R2 Enterprise Edition on your two cluster nodes. Ensure each server
has two network cards. One will provide network connection to the domain while the other will
provide connection to the SAN through iSCSI.

When you have built the server add it to your Active Directory domain, logon to the server with
administrator rights so we can start enabling features and roles.

Note:
This document will not cover the ports that need to be opened on the Windows Firewall.

1. Open Server Manager and navigate down to Security Information. On the panel of the left
hand side you will find Go to Windows Firewall.

2. Navigate down to Firewall Information and on each tab (Domain, Private and Public) turn
Firewall State to Off.

3. Back in the Security Information click on Configure IE ESC and turn this Off for both
Administrators and Users.

4|P a ge

© Copyright: BFC Networks Limited 2010


4. In Server Manager, Click on Add Roles and check Application Server. Click Next.

5. Ensure .NET Framework 3.5.1 is checked and also check Incoming Remote Transactions and
Outgoing Remote Transactions.

6. Click Next and complete the install of these feature by clicking on Finish.
7. In Server Manager, Click on Add Feature and check Failover Cluster. Click Next.

Connecting to a iSCSI Drive


For the SQL Cluster to be able to access the same databases files each cluster node is required to
connect to the same iSCSI drive. This document assumes you have created 4 iSCSI drives on your
SAN and you have the IQN names for each.

1. Go to Start, Administrative Tools and then click on iSCSI Initiator.

5|P a ge

© Copyright: BFC Networks Limited 2010


2. When the window has opened add the IP address into the Target location and click Quick
Connect. This IP address is the internal IP of the SAN that has been created just for your
iSCSI connection.

3. The iSCSI Initiator will go to the SAN and find all the drives required. You will now see the
four drives targets you can connect to.

4. Click on each of the targets and click Connect. In the status column it will change from
Inactive to Connected. Click Done.

6|P a ge

© Copyright: BFC Networks Limited 2010


5. Now Open Disk Management by going to Start and typing diskmgmt.msc. You will see
there are four disks that have been added, these are the four iSCSI drives we connected to a
moment ago.

6. Right click on each of these Offline drives and click Online. They will now say they are Not
Initialized. Right click one of the drives and click on Initialize Disk.

7. Ensure that Disk 1 to Disk 4 are checked in the windows and click on OK.

We now see the drives set to Online.

7|P a ge

© Copyright: BFC Networks Limited 2010


8. We are now going to create a partition on all of these drives. Right click on the unallocated
drive space (in black) and create a New Simple Volume. When completing the wizard,
ensure you name Disk 1 Database, Disk2 Logs, Disk 3 Quorum and Disk 4 DTC. You will now
see that all drives can be written to. When completing this on any other SQL Cluster nodes
will not need to format the disk when bringing the drive online.

9. Complete this process on Node2.

Creating the Cluster


We are now going to validate the two nodes and ensure they can be used as a SQL Cluster. Once all
these have passed we will create the cluster.

1. Ensure both machines are turned on and can connect to the iSCSI drive. On node1 open
Server Manager and expand Features until you can see Failover Cluster Manager. Click on
Failover Cluster Manager.

2. Now click on Validate a Configuration…

3. A new wizard will open and it will give you more information on what is going to happen
next. We want to ensure that the hardware and software configured can be used as a full
cluster. This validation wizard will do this for us. Click Next.

8|P a ge

© Copyright: BFC Networks Limited 2010


4. Add the names of each node and then click Add so both servers are in the Selected Servers
list. Click Next

5. We want to run all the tests that are available on these servers so ensure that it can be a
complete cluster. Ensure Run all tests is checked and click Next.

6. You will then be given a list of tests that will run on each of the two nodes. Review the list
so you are aware of the test. Click Next to start the tests.

While the tests are running you will be able to scroll up and down the page to see which
tests have passed and failed. Do not worry if you miss a failed test as the error will be
presented on the next page. Some tests will take longer than others depending on the
number of drives and nodes in the cluster.
7. When the tests have finished it will generate a web page report. In the report you will see
which tests have failed and passed (marked as Successful). If you have received any errors,
check the report and check your hardware and software settings.

9|P a ge

© Copyright: BFC Networks Limited 2010


8. Now the validation is complete we can create the cluster. Click on Create a Cluster in Server
Manager.

9. Add the computers names of two nodes into the wizard. All these servers will be in your
cluster nodes.

10. During the pre-requirements we stated that a DNS entry will be required on your DNS
server. Now enter the NetBios name into the Cluster Name field and the static IP address in
the Address field.

When you have clicked Next the wizard will run a validation test. You will now be presented
with a Confirmation page.
11. Click Next. The wizard will now run to create your cluster. Once this is done you will get a
status at the top of the page which will say “You have successfully completed the Create
Cluster Wizard”.

10 | P a g e

© Copyright: BFC Networks Limited 2010


We can now test our cluster by pinging the IP address of cluster name from a machine that is not
one of the cluster nodes. Ping the cluster using the –t after the name of you cluster name which is
continually pinging the cluster until you stop it. Example ping sqlcluster –t. As you shut down each
node you will notice the ping will drop for 3 requests. This is while the Passive node picks up the
services from the failed Active node.

We now need to install Microsoft Distributed Transaction Coordinator (MSDTC) which is a


requirement for a SQL Server cluster. This is installed on the cluster.

12. Ensure both nodes are powered on. Complete the next steps on your Active node.
13. On the Active node open Server Manager and expand Features until you can see Failover
Cluster Manager. Click on Failover Cluster Manager.

14. Right click on Services and Applications and click on Configure a Service or Application.

15. In the list you will see several cluster applications that can be used in a Microsoft cluster.
You must ensure that these features are installed on all the nodes should you chose to use
them. Select Distributed Transaction Coordinator (DTC) and click Next.

11 | P a g e

© Copyright: BFC Networks Limited 2010


16. The Name will automatically be filled in. Now add the static IP address from the pre-
requirements and click Next

17. Select the Cluster disk that you have created for the MSDTC and click Next. This will now
finish the application installation.

12 | P a g e

© Copyright: BFC Networks Limited 2010


Installing SQL Server 2008 R2 as a Cluster
1. On the Active Node, insert the SQL Server 2008 R2 disk in the DVD drive.
2. Go to Start and then Computer. Right click on your CD Drive and Click on Install or run
program from your media. SQL Server Installation Centre will now open.

3. Down the left hand side click on Installation.

4. On the right hand side now click on New SQL Server failover cluster Installation.

5. A dependency check will now run in the background to ensure you have all the required
features installed. Once these checks have completed click on OK.
6. Add your SQL Server product key and click on Next to install the Setup Support Files.
7. Install the following Features
a. Database Engine Services
i. SQL Server Replication
ii. Full-Text Search
b. Management Tools – Basic
i. Management Tools – Complete

13 | P a g e

© Copyright: BFC Networks Limited 2010


8. Fill in the SQL Server Network Name with a new name which we will use to connect Moodle
to the database server. Click Next.

9. As we are using both the drives, 1 for the database and the other for the SQL logging we
need to check both of the disks. This will allow you to use both disks in this SQL Cluster.

10. The SQL cluster will use a new IP Address. We can now set this IP on the next page.
Uncheck DHCP and add the IP Address for this cluster name.

11. The SQL Server Agent and SQL Server Database Engine services will run as a domain user.
This username was created in the pre-requirements. Click Use the same account for all SQL
Server services and add the SQLServices username and password. Click Next.

1. On the next page (Database Engine Configuration) on the Account Provisioning tab click
Mixed Mode and enter a secure password. Then click on Add Current User for Specify SQL
Server Administrator and click on Data Directories.
14 | P a g e

© Copyright: BFC Networks Limited 2010


12. Ensure that all of directories in this list are pointing at the iSCSI clustered drives. Find Temp
DB Log Directory and change the location to point to your Log drive. All these should have
been setup during the install of SQL. Click Next.

13. Review the Installations Rules and click Install to install SQL Server Clustering to this node.

14. Once the install has finished the installation wizard will state that it is complete and you can
click Close to finish the work required on this node.

We are now going to install SQL on the other nodes within the SQL Cluster.

1. Log onto the Passive node and insert the SQL Server 2008 R2 installation Disk.

15 | P a g e

© Copyright: BFC Networks Limited 2010


2. Click on Add Node to a SQL Server failover cluster and wait for the installation wizard to
load.

3. When the setup files have been installed you will be taken to the Cluster Node Configuration
page where it will auto detect the SQL Server instance name. Check these settings and click
Next.

4. To ensure you have the correct security permissions you are required to put in the password
for the SQL Service accounts we are using. Type the passwords in both boxes.

5. You will not be able to change any other settings so click Next until you have finished the
install of the cluster node.

16 | P a g e

© Copyright: BFC Networks Limited 2010


Configuring Moodle Web Front End Servers.
1. Open Server Manager and navigate down to Security Information. On the panel of the left
hand side you will find Go to Windows Firewall.

2. Navigate down to Firewall Information and on each tab (Domain, Private and Public) turn
Firewall State to Off.

3. Back in the Security Information click on Configure IE ESC and turn this off for both
Administrators and Users

4. We will be using Microsoft Internet Information Service to publish our Moodle website. We
will now install this role and add the requirements needed. In Server Manager, Click on Add
Roles and check Application Server and Web Server (IIS).

17 | P a g e

© Copyright: BFC Networks Limited 2010


5. In Web Server (IIS), Role Services ensure the following extras are checked
a. Application Development
i. ASP.NET
ii. .NET Extensibility
iii. ISAPI Extensions
iv. ISAPI Filters
b. Security
i. Basic Authentication

6. Click Next and then Install. This will finish off the roles required, you will not require a
reboot following the install.
7. In Server Manager, Click on Add Feature and check Network Load Balancing.

8. Click Next and then Install. This will finish off the features required, you will not require a
reboot following the install.
9. Complete this on all your web front end servers.

18 | P a g e

© Copyright: BFC Networks Limited 2010


Installing PHP and Configuration with IIS

1. Download the latest version of PHP x64 from http://www.bfcnetworks.com/php%20x64.zip


and extract the folder PHP-5.2.5 (x64) into C:\php\.

2. Rename C:\php\php.ini-recommended to c:\php\php.ini and create the folder


C:\php\sessions. Give moodle_admin write permissions to this folder.
3. Create the folder C:\inetpub\moodledata and share this as moodledata with everyone
having read rights. Give IUSR write permissions to this folder.

4. Ensure that the file php_dblib.dll is in the folder c:\php\ext.


5. Open Server Manager and expand Roles down into Internet Information and Services.
Once IIS Manager has opened on the right of the screen click on the name of your server.
6. Scroll down the page and you will find Handler Mappings under the IIS Group.

19 | P a g e

© Copyright: BFC Networks Limited 2010


7. Open Handler Mappings and click on Add Script Map… which is located down the right hand
side.

8. Fill in the small form with the following information


a. Request path: *.php
b. Executable: C:\php\php5isapi.dll
c. Name: PHP
9. Click OK to add this extension to IIS. You will then be prompted if you want to allow this
ISAPI and click Yes.

10. Now open MIME Type from the IIS Group in IIS Manager

11. Click on Add which is located down the right hand side.
a. File Name Extension: .php
b. MIME Type: text/html

20 | P a g e

© Copyright: BFC Networks Limited 2010


12. Now open Default Document in the same IIS Group as Handler Mappings and MIME Type.

13. Remove all the default files in the list by selecting each one and clicking on Remove which is
located down the right hand side. Once you have done this click on Add.. and add index.php
as this is the default file used in Moodle when we navigate to the root of the website.

14. You can now close Server Manager.

Configuring the PHP.ini file


Moodle uses several dll files to run which include the method to connect to a SQL Database. We
now need to register these files in the PHP.ini file. We will also add other settings required in the file
at this point.

1. Open the file C:\php\php.ini in notepad and start a search in the file. You will find a whole
list of extensions one after each other. All these extensions are dll files that are stored in the
c:\php\ext folder. Moodle will not require all of these but we need to remove the comment
sign ( ; ) from each we need.
2. Remove the ; from the start of the following
a. extension=php_curl.dll
b. extension=php_gd2.dll
c. extension=php_ldap.dll
d. extension=php_mbstring.dll
e. extension=php_openssl.dll
f. extension=php_xmlrpc.dll

21 | P a g e

© Copyright: BFC Networks Limited 2010


3. One of the extension dll is missing from this list even though it was downloaded as part of
the php download.
a. Add extension=php_dblib.dll

4. Navigate to the top of the file and search for doc_root. After the = add the root of your
website, c:\inetpub\wwwroot\

5. Even though PHP is registering correctly with the extensions we need to tell the php.ini
where the extensions folder is. Now search for extension_dir and edit this to c:\php\ext\

6. When we were installing PHP we created the folder called sessions. We now need to tell
PHP where this folder is located. Search for ;session.save_path. Note this has been
commented out. Remove the ; and change the location to c:\php\sessions. Save the
php.ini file.

15. Copy the php.ini file into c:\windows\

For Moodle to run with a SQL Server we require a conf file to be stored in the root of the c:\ drive.

22 | P a g e

© Copyright: BFC Networks Limited 2010


16. Create the file freetds.conf in the root of the c:\ drive and add the following code adding the
location of your SQL server at the right point (highlighted in red below).

[global]
host = SQLClusterServ
port = 1433
client charset = UTF-8
tds version = 7.0
text size = 20971520s

17. Complete this on all Web Front End servers

23 | P a g e

© Copyright: BFC Networks Limited 2010


Testing IIS and PHP
We are now going to test PHP is working on your server through IIS.

1. Navigate to c:\inetpub\wwwroot which is the root of your default website.


2. Create a new text file and rename it to testphp.php
Note:
If you cannot see file extension to change the file from txt to php in Explorer, click on Tools
and then Folder Options. Click on the view tab and find Hide Extensions for known file
types. Uncheck this option.
3. Open testphp.php in notepad and add the follow code

<html>
<head>
<title>PHP test</title>
</head>
<body>
<?php
phpinfo();
?>
</body>
</html>
4. Save the file and open Internet Explorer on the Moodle server. Navigate to
http://127.0.0.1/testphp.php. If you have configured PHP correctly with Internet
Information Servers your page will load and at the top you will have the title of PHP Version
5.2.5 (x64) and look similar to the screenshot below.

5. Ensure these tests pass on all your servers.

24 | P a g e

© Copyright: BFC Networks Limited 2010


Configuring Network Load Balancing
We are now going to configure the Network Load Balancing on the two web front end servers. We
also need to test to ensure the load balancing is working. When a client connects to the network
load balancing address, it will either receive the web site from the first web front end or the second.
Should one be down the other will pick up the users request instead.

We also need to test the load balancing is working so we will use the testphp.php file to do this.

1. On the first web front end server, go to Start, Administrative Tools and click on Network
Load Balancing Manager.

2. When the manager console opens right click on Network Load Balancing Clusters and click
on New Cluster.

3. The New Cluster wizard will open and we are going to connect to the first host in the Load
Balancing cluster. This is the machine you are currently on. Type in the computer name of
the machine you are currently connected to and click on Connect.

25 | P a g e

© Copyright: BFC Networks Limited 2010


4. We will now be presented with a list of Network Interfaces on your Windows Server. Select
the NLB network adapter which is part of the requirements list and click Next.

5. We do not need to change any of the settings on the next page. Click Next.
6. We now need to add the IP address for the NLB Cluster. Click on Add and type in the IP
Address and Subnet Mask. Click OK and then Next.

7. In the Cluster operation mode select Multicast and click Next and then Finish.

8. Back in the Network Load Balancing Manager the cluster will be created. You can check the
status in the log files at the bottom of the window. When this is complete you will see the
cluster IP address down the left hand side and the first machine in the NLB Cluster.

26 | P a g e

© Copyright: BFC Networks Limited 2010


9. Right click on the IP address of the cluster and click on Add Host to Cluster.

10. A similar wizard will now be open. Add the second Moodle web front end into the host
prompt box and click Connect. Select the NLB interface from the list. Click Next and run
through the wizard using the default settings.

11. Once you have clicked Finish the NLB Cluster will add the second web front end. In the list
you will now see two machines.

12. As we can see from the image above the image next to each machine name is green. If
either of these changes to red, there is an issue with that network load balanced machine.

27 | P a g e

© Copyright: BFC Networks Limited 2010


Testing the Network Load Balance
Before we start the Moodle install and configuration we need are going to test the load balancing is
working. We are going to do this by connecting to the testphp.php through the network load
balance hostname.

For these tests to work we need to use a 3rd machine to test the configuration of the network load
balance.

1. Open your web browser and connect to http://moodle/testphp.php


2. The same PHP page will open as we saw earlier. At the top of the list you will see System. It
will list the server environment (Windows Server) but also the computer name. This is the
machine we have connected to within the network load balance cluster.

3. Shutdown the server that is listed in the testphp file. We are now going to see if the load
balance works by disconnecting that machine and trying to connect to the other machine.
4. When the server has shutdown, connect to the same address. http://moodle/testphp.php
and check the System field. You should now see it is the other web front end server.

5. Turn the first web front end back on and shutdown the second. We are going to test that
the network load balance works on just the first web front end.
6. Open http://moodle/testphp.php and check the System field again and it reflects the
machine that is currently on.
7. If all these tests been successful, the network load balancing is working.

28 | P a g e

© Copyright: BFC Networks Limited 2010


Configuring SQL Server
We need to create a new database for the Moodle to use. As we launch Moodle for the first time it
will create all the tables and rows it requires. We will now create the database and add a local SQL
User to it as well.

1. Open SQL Server Management Studio from one of the SQL Cluster Nodes. You are
connecting to the SQL Cluster name that we configured during the SQL install..

2. Create a new SQL User by expanding the Object Explorer and then expanding Logins. Click
on Logins and click New Login

3. Create a user called moodle_user.


a. Click on SQL Server Authentication and add a password of moodle100
b. Uncheck Enforce password policy
c. Click OK to create the user
4. Create a new database by right clicking on Databases and clicking New Database.

29 | P a g e

© Copyright: BFC Networks Limited 2010


5. Give the database the name of moodle_DB and add Moodle_User as the owner. In the
Database files list scroll across until you find Paths. Change the log file location to point to
the log drive

6.
Now click on Options down the left hand side.

7. In the Other option section at the bottom of the page you will see a group of settings under
the Miscellaneous Group. Change ANSI NULLS Enabled to True and Quoted Identifiers
Enabled to True and click OK to create the database.

30 | P a g e

© Copyright: BFC Networks Limited 2010


Download and Configuring Moodle
Because of the way Moodle has been designed we need to configure Moodle for one of the web
front end servers. We will then need to change some of the back end settings so the moodledata
folder location can be stored remotely.

1. Log onto the first Moodle Web Front End Server


2. Download Moodle from www.moodle.org. Do not download Moodle for Windows as this
does not use IIS or SQL Server.
3. Extract the content of the downloaded zip file in c:\inetpub\wwwroot.

4. Create the folder c:\moodledata


5. Navigate to http://127.0.0.1/

6. Select the language you want and click Next


7. Moodle will now do some tests on PHP. You should find all of these have passed.

31 | P a g e

© Copyright: BFC Networks Limited 2010


8. Ensure the web address is http://127.0.0.1 and change the data directory to the folder we
created in step 4 c:\moodledata.

9. Complete the next form with the following settings, ensuring you have the correct settings.
a. Type: SQL Server with UTF-8 Support (MSSQL_n)
b. HostServer (Location of your SQL Server: SQLClusterServ
c. Database (Name of the database we created earlier): moodle_db
d. User (Name of the username we created earlier): moodle_user
e. Password (the password you gave to this user): ********
f. Tables prefix (Keep as default): mdl_
g. Click Next

10. You will now get a Configuration Completed that also states that config.php has been
successfully created.

32 | P a g e

© Copyright: BFC Networks Limited 2010


11. We will now see a Configuration complete page and will state that it was not able to create
the config.php file.

Note:
This is because the user that is running the website in IIS does not have write permission to
the root of the moodle website (C:\inetpub\wwwroot\). The default user is IIS is normally
iusr_*hostname*. You do not need to change the permissions on the folder

12. Download the config.php file and save it into the root of the Moodle website,
c:\inetpub\wwwroot\ and click on continue.

13. Agree to the terms and conditions and you will be prompted if you would like Unattended
operation. Following this step Moodle will go to your database and create all the tables it
requires. If you check Unattended each script will go away and run without you having to do
anything. If you do not check this option you will have to click next after each script. There
are about 12 scripts in total. When ready, click Continue.

Note:
If you have checked Unattended do not click Continue while the scripts are running. After
about 5 seconds the page will run the next script.

33 | P a g e

© Copyright: BFC Networks Limited 2010


14. Once the scripts are complete you will have to set up the administrators account and will be
presented with the screen below.

You have required fields that need completing, marked in red. Fill this form in for the admin
account, remembering your admin password. The password you fill in must have at least 1
upper case character, a number and a symbol.
15. You are now on the last step of completing your Moodle install. Fill in the Front Page
settings. This will include site name, export methods, anti-virus settings and email settings.

16. You will now be taken to your Moodle homepage as below.

34 | P a g e

© Copyright: BFC Networks Limited 2010


Moving Moodle to be Network Load Balanced

1. Copy the content of the folder c:\inetpub\wwwroot\ to \\san\moodle\.


2. Copy the content of the folder c:\moodledata to \\san\moodle\moodledata.
3. Navigate to \\san\moodle and open the file config.php in notepad.
4. Within the file search for $CFG->wwwroot. Change this to http://moodle. This is the
network load balance URL we set up in the pre-requirements.
5. Within the file search for $CFG->dirroot. Change this to \\\san\moodle\. Note that this is
three backslashes.
6. Within the file search for $CFG->dataroot. Change this to \\\san\moodle\moodledata.
Note that this is three backslashes.
7. Ensure that the web front end servers can see this share and the files within it.

35 | P a g e

© Copyright: BFC Networks Limited 2010


Configuring IIS for remote Moodle files.
1. Open Internet Information Services Manager by going to Start, Administrative Tools and
click on Internet Information Services (IIS) Manager.

2. Expand the connection panel until you see Default Web Site.

3. From the Actions Panel select Advanced Settings.

4. Change Physical Path to the share on the SAN we created in the pre-requirements.

5. Below Physical Path click on Physical Path Credentials and click the box with the three full

stops.
6. Click on Specific User and then Set. Type in the md_admin username that has write
permission to this share.

36 | P a g e

© Copyright: BFC Networks Limited 2010


7. We now need to change a setting in the php.ini file to reflect the physical path of the
website.
8. On your web front end server navigate to c:\php and open the file php.ini with notepad.
9. Search for doc_root. There will be two entries in the file. One is within a sentence and the
other will have a UNC path. We need to change this UNC path to the physical path of the
website. Change this to the root of the website which is the same as $CFG->wwwroot which
we changed in the config.php file.

10. Copy the file c:\php\php.ini to c:\windows. You will be asked if you want to overwrite this
file which you need to accept.
11. Copy the file c:\inetpub\wwwroot\testphp.php to \\san\moodle.
12. To test the php is working with this new physical path on this server. Navigate to
http://127.0.0.1/testphp.php.
13. When the test page has loaded, using the search facility in your web browser search for
PATH_TRANSLATED. This will tell you the physical path of testphp.php file we have just
configured.

14. Complete this on the other web front end servers.


15. When you have changed these settings on all of your web front end load balanced machines
delete the file c:\inetpub\wwwroot\testphp.php. Using a different machine other than the
web front end servers connect to http://moodle/testphp.php. check the
PATH_TRANSLATED and it will show the new location on the SAN share. If you wish to do
further tests on the physical path, shutdown each web front end to ensure the network load
balancing is working.

This has now completed the installation of Moodle on two web front ends using a Microsoft SQL
Cluster as a database service.

If you wish to test any of servers and the high availability, shutdown different servers but remember
you must have at least one web front end and one active cluster node for the Moodle website to
work.

37 | P a g e

© Copyright: BFC Networks Limited 2010

You might also like