Installing Moodle On Windows x86

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Installing

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

© Copyright: BFC Networks Limited 2009


Configuring Windows, Roles and Features
Install Windows Server 2008 Server (x86), give the server an IP address and change the name of the
machine to Moodle and add the machine to your Windows Domain.

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

© Copyright: BFC Networks Limited 2009


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).

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

© Copyright: BFC Networks Limited 2009


7. Best practise states that SQL Services on your SQL Server should run on its own user
account. You can either create a domain account or a local account. Log onto your Domain
Controller and create a new Service Account for SQL Server
a. Name: SQLServerMoodle
b. Password: <Complex>
c. Also ensure the user account password does not expire.

Installing SQL Server 2008


1. Back on your Moodle server, insert the SQL 2008 CD and Run setup.exe from the root of the
CD.
2. SQL Server 2008 will require Microsoft .NET Framework 3.5 Service Pack 1. Depending on
the media you have this will be installed during the loading of the setup file or can be
downloaded from http://download.microsoft.com. Once the install has completed you will
be required to restart the server. Log back in as your domain administrator.
3. Run Setup.exe from your CD Drive again to start the install of SQL Server 2008
4. Install the following Features
a. Database Engine Services
i. SQL Server Replication
ii. Full-Text Search
b. Management Tools – Basic
i. Management Tools – Complete

4|Page

© Copyright: BFC Networks Limited 2009


5. On the Server Configuration Page Click on Use the same account for all SQL Server Services
and type the domain name of your SQL Service Account and password created earlier.

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.

Installing PHP and Configuration with IIS

1. Download PHP-5.2.9-2-Win32 from http://www.php.net and extract the files into C:\php\.

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


C:\php\sessions. Give IUSR write permissions to this folder.

5|Page

© Copyright: BFC Networks Limited 2009


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. Download the file php_dblib.dll from http://kromann.info/php5_1-release_TS/php_dblib.dll


and save it into the c:\php\ext folder. This dll will be used later for the PHP Configuration.
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.

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.

6|Page

© Copyright: BFC Networks Limited 2009


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

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.


7|Page

© Copyright: BFC Networks Limited 2009


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.9-2 and look similar to the screenshot below

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
8|Page

© Copyright: BFC Networks Limited 2009


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
3. Previously we added the file php_dblib.dll to the c:\php\ext folder. We now need to add
this to the extensions list.
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 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

© Copyright: BFC Networks Limited 2009


7. 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.

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

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 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

© Copyright: BFC Networks Limited 2009


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.

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

© Copyright: BFC Networks Limited 2009


8. Expand SQL Server Network Configuration click on Protocols for MSSQLSERVER. Right click
on Named Pipes and click Enable. Restart your server once this is complete.

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

2. Select the language you want and click Next


3. Moodle will now do some tests on PHP. You should find all of these have passed.
12 | P a g e

© Copyright: BFC Networks Limited 2009


4. Change the web address to your external address for Moodle.

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

© Copyright: BFC Networks Limited 2009


8. 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.

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

© Copyright: BFC Networks Limited 2009


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

Links and Resources


Microsoft Windows Server 2008
http://www.microsoft.com/windowsserver2008/

PHP
http://www.php.net

Microsoft SQL Server 2008


http://www.microsoft.com/sqlserver

php_dblib.dll
http://kromann.info/php5_1-release_TS/php_dblib.dll

Microsoft .net framework 3.5


http://www.microsoft.com/NET/

Moodle
http://moodle.org/

15 | P a g e

© Copyright: BFC Networks Limited 2009

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy