Difference between revisions of "Windows installation using XAMPP"

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Windows installation using XAMPP.

(Create the MySQL database)
(Create the MySQL database)
Line 97: Line 97:
 
[[Image:PhpMyAdmin3131 created moodle.png|thumb|center|The database is corrected, notice the privileges icon]]   
 
[[Image:PhpMyAdmin3131 created moodle.png|thumb|center|The database is corrected, notice the privileges icon]]   
  
At this point we recommend you click the moodle database, then on the privileges icon. Select one of the root users for editing. [[Image:PhpMyAdmin3131 privileges edit.png|thumb|center|See the edit action icon]]  
+
===MySQL security===
The best practice is to create a password for the root user. The edit action will give a place to do that. Another good practice is to copy the root user's privileges to another user. [[Image:PhpMyAdmin3131 privileges create admin.png|thumb|center|We changed root to admin, added a passwword and kept the user root]] On a localhost, often this user will be "admin" and have the same password as the Moodle admin user.
+
Security on a localhost maynot be a big concern, but at this point we recommend you click the moodle database, then on the privileges icon. Select one of the root users for editing. Create their passwords. [[Image:PhpMyAdmin3131 privileges edit.png|thumb|center|See the edit action icon]]  
 +
 
 +
The best practice is to create a password for the root user. The "edit action" will give a place to do that. Another good practice is to copy the root user's privileges to another user. Here we changed the root user to admin, added a password and kept the user called root. [[Image:PhpMyAdmin3131 privileges create admin.png|thumb|center|Creating an admin MySQL user]]  
 +
:'''TIP:''' On a localhost site, that has no internet security issues, use the same name and password for the user with the most privileges/permissions, usually "admin", for both MySQL and Moodle.
  
 
==Extract the downloaded Moodle files to the correct location==
 
==Extract the downloaded Moodle files to the correct location==

Revision as of 13:22, 21 June 2009

XAMPP is a fully functional web server package. It is built to test web based programs on a personal computer. It is not meant for online access via the web on a production server. This page describes how to install the XAMPP webserver package of progrmas and how to install a Moodle standard package on the server which was created.

TIP: These guidelines are not intended for the Complete install packages for Windows from download.Moodle.org - although the troubleshooting part may help if you encounter problems. XAMPP is also used to create Moodle's complete install packages.

Overview

Note: This guide uses XAMPP 1.5.1. An installation for 1.7.1 was similar.

This is a guide for installing XAMPP and Moodle on a computer using the Windows XP operating system.

An overview of the steps:

  • Download the standard Moodle install package you wish to use
  • Download the latest version of XAMPP from Apachefriends.org
  • Install XAMPP
  • Start XAMPP, which will start Apache and MySQL
  • Confirm webserver is operating with your browser
  • Unzip Moodle into the htdocs folder
  • Use your browser to navigate to Moodle
  • Install Moodle, perhaps pausing to update some configuration files
  • Create Admin user and Front Page settings and you have done it.

Preparation

Get Moodle

Get XAMPP

  • Go to apachefriends.org and download XAMPP for Windows. This example assumes that you have downloaded the “Installer” package. There are several XAMPP packages to download. Installer is about 1/2 the size of the same package as a zip file.

File:new image?

Allow yourself some time

  • Say 45 minutes. The time will depend upon the speed of your computer, download connection and of course your familiarity with the process.

Installing XAMPP

  • Run the installer, eventually you will be presented with an option about where to install the package. We told it to install it in a new folder called C:\X_server which XAMPP will create.

XAMPP171 Install folder.png

  • Continue with the installation, this will take a while!

Xampp3.gif

  • Eventually you will be presented with the option to install Apache, MySQL, Filezilla and Mercury as a service.

Xampp4.gif

  • It’s probably best to choose “No” for now. You can always enable these as services later.
  • Next you’ll be asked if you want to start the XAMPP Control Panel.

Xampp5.gif

  • Click the “No” button.


Launch XAMPP

There are several ways to start your webserver.
Server directory start/stop files
One way to start/stop: XAMPP control panel

1. On your Desktop, locate the shortcut XAMPP icon and double click to launch the Control Panel.

    • When the XAMPP Control Panel has launched, click the “Start” buttons for Apache and MySQL (see below).

2. In the folder you installed XAMPP, look for the XAMPP_start, or XAMPP_restart icon.

    • When XAMPP start has finished, both Apache and MySQL have been started.

3. In the folder you installed XAMPP, look for the Apache start and MySQL start icons

    • When Apache and MySQL start icons are used, two black windows command window should remain open
  • If all is well you will see something like this.

If Apache fails to run i.e. the "Running" text with the green background keeps disappearing) and you are using Skype - please review "Troubleshooting" at the end of these instructions.

Create the MySQL database

To create a MySQL database for your Moodle “site” we will use the phpMyAdmin utility included with XAMPP.

Browser address bar
  • To access this launch the web browser of your choice (Firefox is used in this example), type http://localhost in the address bar.


  • The XAMPP default page wiil be displayed, click the link for your preferred language – we will be using English.
  • From the menu on the left, click on “phpMyAdmin”
Click on phpMyAdmin
  • When phpMy Admin has launched in your browser window, enter the name of your database in the “Create new database” field.
Center of initial phpMyAdmin screen
  • From the "Collation" drop down list select "utf8_unicode_ci"
  • Click the “Create” button to create the database.

You should see the database on the left with your moodle MySQL database name without files in it and/or a notice that it was created.

Example of a phpMyAdmin database list, click on moodle to add MySQL users
The database is corrected, notice the privileges icon

MySQL security

Security on a localhost maynot be a big concern, but at this point we recommend you click the moodle database, then on the privileges icon. Select one of the root users for editing. Create their passwords.
See the edit action icon
The best practice is to create a password for the root user. The "edit action" will give a place to do that. Another good practice is to copy the root user's privileges to another user. Here we changed the root user to admin, added a password and kept the user called root.
Creating an admin MySQL user
TIP: On a localhost site, that has no internet security issues, use the same name and password for the user with the most privileges/permissions, usually "admin", for both MySQL and Moodle.

Extract the downloaded Moodle files to the correct location

Locate the zip file of the standard install package you downloaded from Moodle.org. The easiest method is to extract everything in the file to the htdocs folder that XAMPP just created. Most XP Windows operating systems come with an program that will recognize a zip file and ask you where you want to extract the files.

  • Extract the Moodle files to htdocs. A default folder named “moodle” is created with all the Moodle folders and files within it.

Xampp19.gif

Moodledata folder

It is a good practice to manually create the moodledata folder. In an standard default install, Moodle will look for it in the top most level of folders on your server, the same level as htdocs, apache, php and those folders.

You may have to change the permissions of the folder in some operating systems.

For example, in Windows Vista, you will need to manually create your moodledata folder and assign it permissions. To do this right click on the moodledata folder, select properties and the "Security" tab.
Another box will pop up. Select "Users" and give them "Modify" and "Write" permissions, along with whatever existed already.
Windows Vista folder securities tab showing permissions

Summary of XAMPP and initial Moodle install

You have now installed a webserver on your computer. You have at least two web based applications on it: XAMPP and Moodle. Your can use this webserver to install other webbased applications.

Next you need to get Moodle to install itself. You will use your favorite web browser to do this.

Start of a Moodle install

Other pages in MoodleDocs describe the install process. We will just cover the first few screens and then point you to other pages.

  • In your web browser, type the path to the folder containing the Moodle files in te address bar – in this example it’s http://localhost/moodle.
Xampp23.gif
  • The initial install page is displayed.
Xampp24.gif


  • Choose your preferred language (English is used in this example) and click the “Next” button.
  • A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.
Xampp25.gif


  • Click the “Next” button to continue.
  • The paths for your Moodle installation are shown – accept these or amend as desired.
Xampp26.gif
  • Click the “Next” button to continue.
  • In this screen we enter the database settings. The fields are populated with some suggested values.
Xampp27.gif


  • In this example the database created is “moodle153”. The “root” user will be used without a password.
  • DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY.
TIP: Remember that in phpMyAdmin there was a screen to change the root password. Our instructions said to copy the root user to a user called admin. Probably bad security but we use our moodle admin password for the MySQL user called admin.
Xampp28.gif


  • When you have added or edited information on the page, click the “Next” button to continue.
TIP: This information is creating and can later be edited in the htdocs/moodle/config.php file.
  • Provided the Moodle folder is writable a message confirming the configuration has been completed will be displayed.
Xampp29.gif


  • Click the “ Continue” button to proceed.

The Moodle copyright / licence notices are displayed.

Xampp30.gif


  • Click the “Yes” button to continue, and you will be asked to create the admin user for your Moodle site, then be taken to the Front Page settings. Nice job.

Troubleshooting

Bitnami

  • If you have previously created a Moodle install with the Bitnami installer you may find that Apache will not start. This is because Bitnami installs a service for Apache and MySQL. To disable these go to Control Panel > Administrative tools > Service to locate and disable these services.

Skype

  • If XAMPP does not work when you launch your browser and you have Skype enabled it may be necessary to change the port settings in Skype.
  • Locate "Options..." in Skype.
Click to make bigger


  • Locate the "Connection" options.
Click to make bigger


  • Remove the tick / check from the Checkbox.
Click to make bigger


  • Click the "Save" button.
  • You may need to re-start your computer for this to take effect.


Still having problems but do not have Skype installed?

  • Check for another program which may be using port 80. IIS is commonly found to be the culprit.

Moodle Networking does not work

You may need to enable curl. Link to help screenpage which will tell you the line of code in the php/php.ini file to change. Or find more instructions at this link Enable curl in XAMPP on XP

See also