Note: You are currently viewing documentation for Moodle 3.1. Up-to-date documentation for the latest stable version of Moodle is probably available here: Installation quick guide.

Installation quick guide: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 1: Line 1:
<p class="note">Note: The following installation pages are currently being updated. Please bear with us while this work is being completed.</p>
This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. For everybody else, please see [[Installing Moodle]].
===Basic Requirements===


<p class="note">Note: The following installation pages are currently being updated. Please bear with us while this work is being completed.</p>
* You will need a working web server (e.g. Apache), a database (e.g. MySQL or PostgreSQL) and have PHP configured.
* Moodle requires a number of PHP extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.
* If you want Moodle to send email (you probably do) you need working Sendmail on your server or access to an SMTP mail server.
 
===Getting Moodle===
 
You have two basic options:
* Download your required version from http://moodle.org/downloads
* Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):
<pre>
git clone -b MOODLE_21_STABLE git://git.moodle.org/moodle.git
</pre>
 
'''NOTE: only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories) cannot be guaranteed to work properly, be upgradable or be supportable. 
 
===Create a database===
 
* Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:
<pre>
CREATE DATABASE moodle DEFAULT CHARACTER SET UTF8;
</pre>
* Create a user/password combination with appropriate permissions for the database. For example (MySQL again):
<pre>
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'yourpassword';
</pre>
 
===Create data directory===
 
* Create an empty directory to hold Moodle files. It '''must not''' be in the area served by the web server and must have permissions so that the web server user can write to it. Typically, either make it owned by the web server user or give it write permissions for 'everyone'.
 
 
===Install Moodle code===


This guide is designed for administrators who have installed Moodle before and need a quick recap to jog their memory. It could also be useful for those administrators who wish to have an overview of the installation procedure before they start with our [[Installing Moodle| more detailed installation guide]].
* Unzip / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/moodle
* Check the permissions and make sure that the web server does '''not''' have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).
* If you need to, configure your web server to serve the Moodle site with your chosen URL.  


===Preparation===


* Install PHP and required extensions, a supported database such as MySQL and a webserver on the target computer
===Configure Moodle===
* Create a blank database using UTF-8 encoding (call it moodle if you like) and create a database user with the appropriate permissions
* Create a data directory (call it moodledata if you wish) outside of the webserver.
* Ensure the webserver is the owner of the data folder and give the owner read, write and execute permissions
* Download Moodle


===Installation===
* In the Moodle code directory, find the file ''config-dist.php'' and copy it to config.php
* Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. ''Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards''


* Extract the files and place them in the documents folder on the webserver (or any subfolder of your webserver)
===Install Moodle===
* Go to <nowiki>http://yourserver/install.php</nowiki> or <nowiki>http://yourserver/subfolders/install.php</nowiki> to start the installation
* Download the [[Configuration file | config.php]] file from your webserver and place in the moodle root if prompted


===Configuration===
* Either go to the URL for your moodle site in a browser (installation will start automatically) or run the command line version at (requires cli version of PHP):
<pre>
php /path/to/moodle/admin/cli/install.php
</pre>


* If you agree with the [[License | GPL license]] you will be allowed to continue
===Set up cron===
* Give your site a name and description
* Configure an admin account


===One last thing===
* You will need a cron job to run periodically. A typical Unix cron entry will be as follows:
Once you have finished setting up moodle you need to set up [[Cron|cron]].
<pre>
*/15 * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php >/dev/null
</pre>
See [[Cron]] for more options.


'''That's it! Well done :-)'''
You are now ready to use your Moodle site. If you run into problems see the 'See Also' below or ask in the forums at http://moodle.org.


==See Also==
==See Also==

Revision as of 14:52, 28 November 2011

Note: The following installation pages are currently being updated. Please bear with us while this work is being completed.

This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. For everybody else, please see Installing Moodle.

Basic Requirements

  • You will need a working web server (e.g. Apache), a database (e.g. MySQL or PostgreSQL) and have PHP configured.
  • Moodle requires a number of PHP extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.
  • If you want Moodle to send email (you probably do) you need working Sendmail on your server or access to an SMTP mail server.

Getting Moodle

You have two basic options:

  • Download your required version from http://moodle.org/downloads
  • Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):
git clone -b MOODLE_21_STABLE git://git.moodle.org/moodle.git 

NOTE: only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories) cannot be guaranteed to work properly, be upgradable or be supportable.

Create a database

  • Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:
CREATE DATABASE moodle DEFAULT CHARACTER SET UTF8;
  • Create a user/password combination with appropriate permissions for the database. For example (MySQL again):
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'yourpassword';

Create data directory

  • Create an empty directory to hold Moodle files. It must not be in the area served by the web server and must have permissions so that the web server user can write to it. Typically, either make it owned by the web server user or give it write permissions for 'everyone'.


Install Moodle code

  • Unzip / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/moodle
  • Check the permissions and make sure that the web server does not have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).
  • If you need to, configure your web server to serve the Moodle site with your chosen URL.


Configure Moodle

  • In the Moodle code directory, find the file config-dist.php and copy it to config.php
  • Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards

Install Moodle

  • Either go to the URL for your moodle site in a browser (installation will start automatically) or run the command line version at (requires cli version of PHP):
php /path/to/moodle/admin/cli/install.php

Set up cron

  • You will need a cron job to run periodically. A typical Unix cron entry will be as follows:
*/15 * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php >/dev/null

See Cron for more options.

You are now ready to use your Moodle site. If you run into problems see the 'See Also' below or ask in the forums at http://moodle.org.

See Also