Documente Academic
Documente Profesional
Documente Cultură
Installing Moodle 2.0 on a Windows Server 2008 x64 with MySQL, IIS7 and PHP.
Written by: Alex Pearce Email: apearce@bfcnetworks.com Blog: http://www.bfcnetworks.com
Contents
Configuring Windows, Roles and Features ............................................................................................. 2 Installing PHP and Configuration with IIS ............................................................................................... 5 Testing IIS and PHP ................................................................................................................................. 7 Configuring the PHP.ini file ..................................................................................................................... 8 Folders and Permissions ......................................................................................................................... 9 Installing MySQL x64 ............................................................................................................................. 11 Configuring MySQL Server .................................................................................................................... 13 Download Moodle ................................................................................................................................ 14 Configuring Moodle .............................................................................................................................. 14 Links and Resources .............................................................................................................................. 16
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. 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 extras are checked a. Application Development i. ASP.NET ii. .NET Extensibility iii. CGI iv. ISAPI Extensions v. 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.
4. As we are running PHP with FastCGI we need to install the IIS FastCGI. Select IISFastCGI from the list and click Next.
5. The default install will install all the extensions we require for Moodle 2.0. Click Next.
6. On the next screen of the wizard click Install which will complete the process of installing PHP.
We are now going to configure PHP with IIS. 1. 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. 2. Scroll down the page and you will find Handler Mappings under the IIS Group.
3. Open Handler Mappings and click on Add Module Map which is located down the right hand side.
4. Fill in the small form with the following information a. Request path: *.php b. Module: FastCGIModule c. Executable: C:\php\php-cgi.exe d. Name: PHPviaFastCGI
5. Click OK to add this extension to IIS. You will then be prompted if you want to allow this ISAPI and click Yes.
3. In a later step we will be create a folder that Moodle will as a temporary location to upload files. Even though we havent created this folder yet we can still tell PHP to use this folder. Search for upload_tmp_dir. Change both upload_tmp_dir and session.save_path on the next line to c:\php\sessions.
4. As we are using FastCGI for our Moodle website we need to make some changes to the php.ini file that tunes the performance of FastCGI with IIS. Navigate to the top of the page and search for ;cgi.fix_pathinfo and remove the ; comment from the start of the line.
5. Save the php.ini file. 6. We need IIS to recognise the changes we have just made. We can do this by restarting the IIS services by opening a command prompt and typing IISreset and pressing Enter.
7. To ensure that PHP is still working navigate to http://127.0.0.1/phpinfo.php and ensure the page loads. 8. Search for session.save_path within the page and check that this has changed to the new location we set in set 3.
4. Click Add and you will be given a new window. By default all users will be searched from our domain. To change this click on Locations and select your local server and click OK.
5. Now enter IUSR which is the default user that runs the website in IIS.
6. The user will now appear in the permissions tab. By default the IUSR will only have view access. We now need to give the user write access. Check Modify which will also check Write.
7. Click on OK to confirm these changes and then click on OK to confirm the Properties changed. 8. We now need to do the same with the Moodle data folder. Navigate to c:\inetpub and create the folder c:\inetpub\moodledata. 9. Complete steps 2 to 7 for this folder ensure the IUSR has write permission to the folder.
4. At the end of the Install it will ask you if you want to Configure the MySQL Server Now. Ensure this is checked and click Finish.
5. We are now going to configure the default setting to the MySQL application. Select Standard Configuration and click Next.
7. The next part of the wizard allows us to set the password for the root administrator account in MySQL. Set the password to a complex password.
Do not check Create An Anonymous Account. 8. Click Execute to configure MySQL. When this has run click Finish.
2. Enter the Root Administrator password we inserted during the install process. 3. First we need to create a new database. We will call it MoodleDB. Enter the command be into the command line tool and press Enter. create database moodledb;
If entered correctly you will be given the results that the query ran OK and 1 row was affected. 4. We now need to create a user that we will use to tell Moodle to connect to this database. Run this command, creating the user Moodle_User with the password of Password1. grant usage on *.* to moodle_user@localhost identified by 'Password1';
5. Now we need to give the moodle_user permission to the database. Run the following command, and press Enter. grant useage on *.* to moodle_user@localhost identified by 'Password1';
Download Moodle
1. Download Moodle 2.0 from www.moodle.org. 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 to use and click Next.
3. The Moodle install will automatically enter the Data Directory which is a c:\inetpub\modledata folder we created earlier.
If you receive an error message from this screen you have not set the permissions correctly on the server. 4. From the database type select Improved MySQL (native/mysqli) and click Next.
5. Fill the online form in as below from everything we have configured in previous steps. a. Database host i. 127.0.0.1 b. Database name i. Moodledb c. Database user i. Moodle_user 14 | P a g e Copyright: BFC Networks Limited 2010 www.bfcnetworks.com
6. The next page will try and create a file called config.php in the c:\inetpub\wwwroot folder. By default the IUSR user does not have permission to write to this folder. Select the content of the page and copy it to your click board. Create the file config.php in the c:\inetpub\wwwroot folder. Open the file and paste the content into the file.
If you have followed these steps correctly you will be able to click next in the Moodle install web page which will then ask you to confirm the term and conditions. 7. Moodle will now complete a check on the state of your environment. Ensure everything is set to OK. You do not need to worry about the internationalisation extension. When you are happy click on Continue.
8. Moodle will now create all the tables it requires in the MySQL database. Once it has loaded the page click on Continue at the bottom.
9. You now need to give your admin account for Moodle a complex password. Also complete the other fields required. At the bottom click Update Profile.
10. We now complete the final install process by completing information about the education establishment. Fill in the online form and click on Save Changes at the bottom of the page.
You will now have Moodle 2.0 implemented on your Windows Server.