Installing Moodle On Windows x86
Installing Moodle On Windows x86
Installing Moodle On Windows x86
Moodle on a
Windows x86
Environment
Installing Moodle 1.9 on a
Windows Server 2008 x86
with Microsoft SQL Server
2008 and IIS7.
Written by:
Alex Pearce
Email:
apearce@bfcnetworks.com
Blog:
www.learninggateway.net/blogs/ajp
Contents
Configuring Windows, Roles and Features ............................................................................................. 2
Installing SQL Server 2008 ...................................................................................................................... 4
Installing PHP and Configuration with IIS ............................................................................................... 5
Testing IIS and PHP ................................................................................................................................. 8
Configuring the PHP.ini file ..................................................................................................................... 8
Configuring SQL Server ......................................................................................................................... 10
Configuring Moodle .............................................................................................................................. 12
Links and Resources .............................................................................................................................. 15
1|Page
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
2|Page
5. In Web Server (IIS), Role Services ensure the following extra 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.
3|Page
4|Page
6. 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 Next and start the install by clicking on Install.
1. Download PHP-5.2.9-2-Win32 from http://www.php.net and extract the files into C:\php\.
5|Page
7. Open Handler Mappings and click on Add Script Map… which is located down the right hand
side.
6|Page
11. Click on Add which is located down the right hand side.
a. File Name Extension: .php
b. MIME Type: text/html
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.
<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.9-2 and look similar to the screenshot below
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
8|Page
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 collectly 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.
9|Page
For Moodle to run with a SQL Server we require a conf file to be stored in the root of the c:\ drive.
8. 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 = your sql server
port = 1433
client charset = UTF-8
tds version = 7.0
text size = 20971520s
1. Open SQL Server Management Studio and log into the Database Engine
2. Create a new SQL User by expanding the Object Explorer and then expanding Logins. Click
on Logins and click New Login
10 | P a g e
5. Give the database the name of moodle_DB and add Moodle_User as the owner. Now click
on Options down the right hand side.
6. 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.
7. Open SQL Server Configuration Manager from the Start Menu.
11 | P a g e
Download Moodle
1. Download Moodle from www.moodle.org. Do not download Moodle for Windows as this
does not use IIS or SQL Server.
2. Extract the content of the downloaded zip file in c:\inetpub\wwwroot.
Configuring Moodle
1. Navigate to http://127.0.0.1/ and you will be brought to the Moodle Installation page
5. Complete the next form with the following setting ensuring you have the correct settings.
a. Type: SQL Server with UTF-8 Support (MSSQL_n)
b. HostServer (Location of your SQL Server: Moodle
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
6. You 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
7. Download the config.php file and save it into the root of the Moodle website,
c:\inetpub\wwwroot\ and click on continue.
13 | P a g e
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.
9. 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.
10. 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.
14 | P a g e
PHP
http://www.php.net
php_dblib.dll
http://kromann.info/php5_1-release_TS/php_dblib.dll
Moodle
http://moodle.org/
15 | P a g e