<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mrverrall</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mrverrall"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Mrverrall"/>
	<updated>2026-04-14T23:22:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=123348</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=123348"/>
		<updated>2016-05-09T07:46:45Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: miscellaneous changes to (hopefully) improve readability.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection can appear to be a complex off-putting beast and this can lead to it either being ignored or, as is often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [[Caching| the rest]]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and sites running Moodle 2.4 or above are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If a site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly compared to using no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of its storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe as it can always be regenerated and so can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use to do this, such as, tmpfs, Memcached, APC, Redis and overtime probably more... A good place to start if unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on the OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached and it&#039;s PHP support in a way compatible with the operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached php5-memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; look for Memcached and click the &#039;&#039;&#039;Add instance&#039;&#039;&#039; action.&lt;br /&gt;
**Give the store a name, like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select the caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
See [[Caching]] for more details.&lt;br /&gt;
&lt;br /&gt;
==How much memory should I allocate to MUC?==&lt;br /&gt;
&lt;br /&gt;
The default on most Memcached deployments is 64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a standard Moodle install. As a real world example, checking a live site with ~6000 individual user logins over the last 24 hours, was Memcached MUC usage was ~11MB (Moodle 2.8 with 26 additional plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly when implementing an in memory cache such as Memcached is to monitor and understand its use in &#039;&#039;&#039;your own&#039;&#039;&#039; deployment as requirements can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all users will be logged out. Two Memcached instances are required in this scenario, one for sessions and one MUC. An example of how to do this can be found [https://moopi.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==How can I tell what Cache store I am really using==&lt;br /&gt;
[[File:perf.png|thumb|300px]]&lt;br /&gt;
Temporarily switch on performance debugging at,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Site administration  Development &amp;gt; Debugging &amp;gt; Performance info&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This adds some useful information to the the footer of all pages (if your theme supports it) including MUC objects and the cachestore they came from .&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This appears under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; when the default Application Cache store mapping does not support a requirement of one or more of the cache definitions. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches, &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported by Memcached. This is because Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039; which ensures data exists in the cache once it is put there. It is never cleaned up to free space or because it has not been recently used. Because Memcached evicts objects from it&#039;s cache it cannot be used for Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
This is not a problem as Event Invalidation will simply use the file-system cache, or if specified a compatible secondary application cache, or one allocated directly to the Event Invalidation definition.&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
&lt;br /&gt;
See [[Caching]].&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of the caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to look.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=323628 MUC and localcache] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[de:MUC FAQ]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=NTLM_authentication&amp;diff=122156</id>
		<title>NTLM authentication</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=NTLM_authentication&amp;diff=122156"/>
		<updated>2016-02-02T13:50:51Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* APACHE Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Authentication}}This document describes how to set up &#039;&#039;&#039;NTLM/Windows Integrated Authentication&#039;&#039;&#039; in Moodle. &lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
Integrated Windows Authentication uses the security features of Windows clients and servers. It does not prompt users for a user name and password. The current Windows user information on the client computer is supplied by the browser through a challenge/response authentication process with the Web server for the Moodle site. &lt;br /&gt;
&lt;br /&gt;
==Assumptions==&lt;br /&gt;
&lt;br /&gt;
#You are running MS [[Active Directory]] for Authentication.&lt;br /&gt;
#The Server hosting your website is a member of the Active Directory Domain that your users are also members of.&lt;br /&gt;
#You are able to define people inside your Network (and authenticated to the Domain) from an IP range of computers.&lt;br /&gt;
#You are familar with or have read the LDAP authentication documentation.&lt;br /&gt;
#The Active Directory domain credentials of your users are returned as &#039;&#039;&#039;DOMAINNAME\username&#039;&#039;&#039; from your authentication service. If you are using the Winbind service from the Samba project, this can be untrue, depending on your Winbind configuration settings. If you are using Moodle 2.4 or later, you can specify the format of the domain credentials (see below). If you are using an older version and you can not modify your settings to satisfy this last assumption, then you will need to remove or comment out the line that reads:&lt;br /&gt;
    $username = substr(strrchr($username, &#039;\\&#039;), 1); //strip domain info&lt;br /&gt;
and add the relevant lines of code to extract the username part from the domain user credentials and store it in $username.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;VERY IMPORTANT&#039;&#039;&#039;: NTLM authentication depends on [[LDAP authentication]], and NTLM configuration is specified in the LDAP authentication settings page (Site Administration &amp;gt;&amp;gt; Plugins &amp;gt;&amp;gt; Authentication &amp;gt;&amp;gt; LDAP Server). So before trying to configure NTLM, make sure you have LDAP_authentication properly setup and working.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
No installation needed. See Site Administration &amp;gt;&amp;gt; Plugins &amp;gt;&amp;gt; Authentication &amp;gt;&amp;gt; LDAP Server for the NTLM config options. You only have to&lt;br /&gt;
&lt;br /&gt;
*Enable NTLM SSO&lt;br /&gt;
*Set the IP/Subnet mask for the clients (see below)&lt;br /&gt;
*(Optionally) Set the &amp;quot;Remote username format&amp;quot; for your domain user credentials format (see below)&lt;br /&gt;
*On IIS: turn on Windows Authentication&lt;br /&gt;
*On Apache - use one of the 3 methods outlined below&lt;br /&gt;
*On the client pc&#039;s, you might need to set the moodle server ip/moodle url as being in &amp;quot;local intranet&amp;quot; (From IE, tools -&amp;gt; options -&amp;gt; security -&amp;gt; local intranet)&lt;br /&gt;
&lt;br /&gt;
It is important to note the following conditions must be satisfied to let NTLM SSO happens:&lt;br /&gt;
*you&#039;ve arrived to the login page with one GET request&lt;br /&gt;
*you&#039;ve ldap-&amp;gt;ntlmsso_enabled&lt;br /&gt;
*you&#039;ve ldap-&amp;gt;ntlmsso_subnet&lt;br /&gt;
*you aren&#039;t logged&lt;br /&gt;
*the IP of the client is in ntlmsso_subnet&lt;br /&gt;
&lt;br /&gt;
Thus it is needed to set the IP subnet.&lt;br /&gt;
&lt;br /&gt;
==How to Turn Integrated Authentication on==&lt;br /&gt;
The auth/ldap/ntlmsso_magic.php file MUST have NTLM/Integrated Authentication enabled on the server or the authentication will not work.&lt;br /&gt;
&lt;br /&gt;
===IIS Configuration===&lt;br /&gt;
Open the IIS Management Console and navigate to the auth/ldap/ntlmsso_magic.php file.&lt;br /&gt;
&lt;br /&gt;
====IIS 6.0====&lt;br /&gt;
#right click on the file, choose properties&lt;br /&gt;
#under the &amp;quot;file security&amp;quot; tab, click on the Authentication and Access control &amp;quot;edit&amp;quot; button&lt;br /&gt;
#untick &amp;quot;Enable Anonymous Access&amp;quot; and tick &amp;quot;Integrated Windows Authentication&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====IIS 7.x====&lt;br /&gt;
#After navigating to the &#039;auth/ldap&#039; folder, switch to Content View&lt;br /&gt;
#right click on the file, choose &amp;quot;Switch to Features View&amp;quot;&lt;br /&gt;
#click on the Authentication icon on the right&lt;br /&gt;
#select &#039;Anonymous Authentication&#039; and click the &#039;Disable&#039; button&lt;br /&gt;
#select &#039;Windows Authentication&#039; and click the &#039;Enable&#039; button&lt;br /&gt;
&lt;br /&gt;
*According to [http://moodle.org/mod/forum/discuss.php?d=145171#p634027 this post], if you are using IIS 7.5 (it comes with Windows Server 2008 R2), you have to select &#039;Windows Authentication&#039; and click on &#039;Providers&#039;. This shows a list of enabled providers (Negotiate and NTLM, by default). Change the order so that NTLM is at the top of the list.&lt;br /&gt;
*If &#039;Windows Authentication&#039; is not available, then you need to install it as a separate authentication provider (in Control Panel).&lt;br /&gt;
&lt;br /&gt;
===APACHE Configuration===&lt;br /&gt;
There are currently 4 possible methods for this:&lt;br /&gt;
&lt;br /&gt;
====Using the NTLM part of Samba for Apache on Linux====&lt;br /&gt;
* If using Ubuntu 12.04 or higher you can install this using:&lt;br /&gt;
 sudo apt-get install php5-ldap libapache2-mod-auth-ntlm-winbind winbind smbfs smbclient samba&lt;br /&gt;
 sudo a2enmod auth_ntlm_winbind &lt;br /&gt;
 sudo /etc/init.d/apache2 restart&lt;br /&gt;
Note: On Ubuntu 14.04 smbfs has been replaced with cifs-utils&lt;br /&gt;
* If you are using an earlier version of Ubuntu or another distribution you can get the plugin here: http://samba.org/ftp/unpacked/lorikeet/mod_auth_ntlm_winbind/ . You need to download all the files from the link, but not the &amp;lt;code&amp;gt;contrib&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;debian&amp;lt;/code&amp;gt; directories. Then follow the instructions given inside the &amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; file. If you are using Debian/Ubuntu, you can follow these [[#Compiling_mod_auth_ntlm_winbind_on_Debian.2FUbuntu|compilation instructions]].&lt;br /&gt;
* Once you have compiled it, put it inside Apache&#039;s modules subdirectory (this location depends on a number of factors, like compiling Apache yourself, using different Linux distributions packages, an so on), and load and enable the module in Apache&#039;s configuration. For example, if your Apache modules are under &amp;lt;tt&amp;gt;/usr/lib/apache2/modules&amp;lt;/tt&amp;gt;, you&#039;ll need something like this in your Apache configuration file (usually called &amp;lt;tt&amp;gt;apache2.conf&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;http2.conf&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;IfModule !mod_auth_ntlm_winbind.c&amp;gt;&lt;br /&gt;
       LoadModule auth_ntlm_winbind_module /usr/lib/apache2/modules/mod_auth_ntlm_winbind.so&lt;br /&gt;
   &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Install the Samba &amp;lt;tt&amp;gt;winbind&amp;lt;/tt&amp;gt; daemon package. This packages relies on Samba&#039;s configuration file to get some important settings (like the Windows domain name, uid and gid range mappings, and so on). In addition to that, you&#039;ll need to make your Linux/Unix machine part of the domain. Otherwise winbind won&#039;t be able to pull user and groups information from the domain controllers. You should read the Samba documentation to perform this step, but the most important part is having something like the following lines in your &amp;lt;code&amp;gt;smb.conf&amp;lt;/code&amp;gt; file, inside the [global] section (in addition to what you already have there):&lt;br /&gt;
&lt;br /&gt;
  workgroup = DOMAINNAME&lt;br /&gt;
  password server = *&lt;br /&gt;
  security = domain&lt;br /&gt;
  encrypt passwords = true&lt;br /&gt;
  idmap uid = 10000-20000&lt;br /&gt;
  idmap gid = 10000-20000&lt;br /&gt;
&lt;br /&gt;
: and executing the command (as root):&lt;br /&gt;
&lt;br /&gt;
  # net join DOMAINNAME -U Administrator&lt;br /&gt;
&lt;br /&gt;
: where &#039;&#039;&#039;DOMAINNAME&#039;&#039;&#039; is the NetBIOS windows domain name, and &#039;&#039;&#039;Administrator&#039;&#039;&#039; an account with enough privileges to add new machines to the domain.&amp;lt;br/&amp;gt; You&#039;ll need to type this account&#039;s password for the command to succeed.&lt;br /&gt;
&lt;br /&gt;
: In Windows environments you could also try executing the command (as root):&lt;br /&gt;
&lt;br /&gt;
  # net join DOMAINNAME -S DCSERVER -U Administrator&lt;br /&gt;
&lt;br /&gt;
: where DCSERVER is the Domain Controller server&lt;br /&gt;
&lt;br /&gt;
: Also, make sure you have disabled &amp;quot;Microsoft Network Server: digitally sign communications (always)&amp;quot; in your Domain Controllers Security Policy, unless you are using a version of Samba that can sign SMB packets.&lt;br /&gt;
&lt;br /&gt;
* Restart the &amp;lt;tt&amp;gt;winbind&amp;lt;/tt&amp;gt; service to apply the changes and test that it&#039;s running ok by executing:&lt;br /&gt;
&lt;br /&gt;
  $ wbinfo -u&lt;br /&gt;
&lt;br /&gt;
: You should get the full list of Windows domain users. If you use &#039;&#039;&#039;&amp;lt;tt&amp;gt;-g&amp;lt;/tt&amp;gt;&#039;&#039;&#039; instead, you&#039;ll get the domain groups list.&lt;br /&gt;
&lt;br /&gt;
* Check that your &amp;lt;tt&amp;gt;winbind&amp;lt;/tt&amp;gt; package installed the authentication helper command &amp;lt;tt&amp;gt;ntlm_auth&amp;lt;/tt&amp;gt;, as we&#039;ll need it later. We&#039;ll assume the helper is located at &amp;lt;tt&amp;gt;/usr/bin/ntlm_auth&amp;lt;/tt&amp;gt;. If yours is at a different location, make sure you adjust the path in the example below.&lt;br /&gt;
&lt;br /&gt;
* Add something like this to your Apache configuration file (usually called &amp;lt;tt&amp;gt;apache2.conf&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;http2.conf&amp;lt;/tt&amp;gt;). We&#039;ll assume that your Moodle &amp;lt;tt&amp;gt;$CFG-&amp;gt;dirroot&amp;lt;/tt&amp;gt; directory is located at &amp;lt;tt&amp;gt;/var/www/moodle&amp;lt;/tt&amp;gt; in the example:&lt;br /&gt;
    &amp;lt;Directory &amp;quot;/var/www/moodle/auth/ldap/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;Files ntlmsso_magic.php&amp;gt;&lt;br /&gt;
            NTLMAuth on&lt;br /&gt;
            AuthType NTLM&lt;br /&gt;
            AuthName &amp;quot;Moodle NTLM Authentication&amp;quot;&lt;br /&gt;
            NTLMAuthHelper &amp;quot;/usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp&amp;quot;&lt;br /&gt;
            NTLMBasicAuthoritative on&lt;br /&gt;
            require valid-user&lt;br /&gt;
        &amp;lt;/Files&amp;gt;&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
* Check the permissions of the Winbind pipe directory (Ubuntu places it under &amp;lt;tt&amp;gt;/var/run/samba/winbindd_privileged&amp;lt;/tt&amp;gt;, yours may be placed at a different location). Apache will need to be able to enter that directory, so we need to make sure it has the right permissions. So have a look at the permissions of that directory and note the name of the group assigned to it. The following example is from a Ubuntu 7.10 machine:&lt;br /&gt;
&lt;br /&gt;
  $ ls -ald /var/run/samba/winbindd_privileged&lt;br /&gt;
  drwxr-x--- 2 root winbindd_priv 60 2007-11-17 16:18 /var/run/samba/winbindd_privileged/&lt;br /&gt;
&lt;br /&gt;
:so we see the group is &amp;lt;tt&amp;gt;winbindd_priv&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Instead of modifying the directory permissions (which could break other services that use winbind) we are going to make the Apache user (&amp;lt;tt&amp;gt;www-data&amp;lt;/tt&amp;gt; in our example, but could be &amp;lt;tt&amp;gt;httpd&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;nobody&amp;lt;/tt&amp;gt;, etc.) is part of the appropiate group. Execute the following as root:&lt;br /&gt;
&lt;br /&gt;
  # adduser www-data winbindd_priv&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;tt&amp;gt;adduser&amp;lt;/tt&amp;gt; is available in Debian and Ubuntu at least. If your distribution doesn&#039;t have &amp;lt;tt&amp;gt;adduser&amp;lt;/tt&amp;gt;, you can edit &amp;lt;tt&amp;gt;/etc/group&amp;lt;/tt&amp;gt; manually to achive the same effect.&lt;br /&gt;
&lt;br /&gt;
* Stop and start the Apache service to apply the changes. Have a look at Apache&#039;s error log to see that everything is ok.&lt;br /&gt;
&lt;br /&gt;
* Couple of gotchas - in Fedora Core (and also in Redhat/Centos), keep alive is turned OFF by default in the httpd.conf - see this bug for further info: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=188138&amp;lt;br /&amp;gt;&lt;br /&gt;
simply change the line to that was:&lt;br /&gt;
 KeepAlive Off&lt;br /&gt;
to:&lt;br /&gt;
 KeepAlive On&lt;br /&gt;
and restart apache (/etc/init.d/http restart)&lt;br /&gt;
* Here are some notes from people who have the samba winbind option working&lt;br /&gt;
::-- I made it work using Ubuntu 7.04. That&#039;s what I&#039;ve used to update the documentation. [[User:Iñaki Arenaza|Iñaki Arenaza]] 10:43, 30 September 2007 (CDT)&lt;br /&gt;
::-- I have this working on Ubuntu 8.04 LTS in an RM CC4 Active Directory Domain. [[User:munk3h|Ian]] 16:31 15 December 2009 (GMT)&lt;br /&gt;
::--  Running on Ubuntu 10.04 Lucid, Apache2 got this running in no time flat with AD v6. Worth noting that if Using Iñaki Arenaza&#039;s LDAP Clone plugin, you will need to add another copy of the Directory tag in &amp;lt;tt&amp;gt;apache2.conf&amp;lt;/tt&amp;gt; pointing at the new ldap plugin. --[[User:Christopher O&amp;amp;#39;Kelly|Christopher O&amp;amp;#39;Kelly]] 10:09, 16 April 2012 (WST)&lt;br /&gt;
::-- On Ubuntu 14.04 I had to do the following to get NTLM auth working as I was getting the error &amp;quot;ntlm_auth reports Broken Helper: BH NT_STATUS_UNSUCCESSFUL NT_STATUS_UNSUCCESSFUL&amp;quot; in the Apache error logs (from [https://bugs.launchpad.net/ubuntu/+source/apache-mod-auth-ntlm-winbind/+bug/1304953 Launchpad]) [[User:ngmares|ngmares]]:&lt;br /&gt;
&lt;br /&gt;
  usermod -a -G winbindd_priv www-data&lt;br /&gt;
  chgrp winbindd_priv /var/lib/samba/winbindd_privileged&lt;br /&gt;
  ln -s /var/lib/samba/winbindd_privileged/pipe /var/run/samba/winbindd_privileged/pipe&lt;br /&gt;
&lt;br /&gt;
====Using the NTLM Auth Module for Apache on Linux====&lt;br /&gt;
The NTLM Auth module is a bit stale and even its authors suggest that you use the [[#Using_the_NTLM_part_of_Samba_for_Apache_on_Linux|NTLM part of Samba with Apache on Linux]]&lt;br /&gt;
&lt;br /&gt;
Get it from here &lt;br /&gt;
# get the Module from: http://modntlm.sourceforge.net/&lt;br /&gt;
# follow the instructions given there and inside the README that comes with the package.&lt;br /&gt;
&lt;br /&gt;
I (Iñaki Arenaza) strongly recommend using the [[#Using_the_NTLM_part_of_Samba_for_Apache_on_Linux|NTLM part of Samba with Apache on Linux]] over this module. It&#039;s better maintained, more robust and has more features.&lt;br /&gt;
&lt;br /&gt;
====Using the mod_auth_sspi Module for Apache 2 on Windows====&lt;br /&gt;
NOTE: This setup is currently being used in a live production environment, and is therefore suitable for such use provided it is correctly configured and tested.&lt;br /&gt;
&lt;br /&gt;
This is the recommended method for Apache 2 on Windows, however it will &#039;&#039;&#039;not&#039;&#039;&#039; work on Linux/UNIX systems.&lt;br /&gt;
It provides better stability and higher performance than other NTLM modules.&lt;br /&gt;
&lt;br /&gt;
* Download the mod_auth_sspi Module from: http://sourceforge.net/projects/mod-auth-sspi/. At the moment of writing this (2007.09.30), the current version is mod_auth_sspi 1.0.4, which has two different ZIP files to download:&lt;br /&gt;
&lt;br /&gt;
::* mod_auth_sspi-1.0.4-2.0.58.zip :   Use this file if you are using Apache 2.0.x.&lt;br /&gt;
::* mod_auth_sspi-1.0.4-2.2.2.zip :   Use this file if you are using Apache 2.2.x.&lt;br /&gt;
&lt;br /&gt;
If you are using an x64 version of Apache mod_auth_sspi x64 versions are available from https://www.apachehaus.net/modules/mod_auth_sspi/&lt;br /&gt;
&lt;br /&gt;
These files &#039;&#039;&#039;do not&#039;&#039;&#039; work with Apache versions 2.4.x.&lt;br /&gt;
&lt;br /&gt;
* Unzip the right file and copy mod_auth_sspi.so (it&#039;s inside &#039;&#039;&#039;bin&#039;&#039;&#039; subdirectory) to your Apache modules directory.&lt;br /&gt;
* Edit your Apache 2 configuration file (httpd.conf) to load the module.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;IfModule !mod_auth_sspi.c&amp;gt;&lt;br /&gt;
        LoadModule sspi_auth_module modules/mod_auth_sspi.so&lt;br /&gt;
    &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Choose one of the two methods below&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Method 1&#039;&#039;&#039;: This method is recommended for servers that will host a single Moodle instance. Configure NTLM from the main configuration file, add the following to httpd.conf (substitute &amp;quot;C:\moodle&amp;quot; with the path to your Moodle installation e.g. &amp;quot;C:\my-moodle&amp;quot;&lt;br /&gt;
    &amp;lt;Directory &amp;quot;C:\moodle\auth\ldap&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;Files ntlmsso_magic.php&amp;gt;&lt;br /&gt;
            AuthName &amp;quot;Moodle at My College&amp;quot;&lt;br /&gt;
            AuthType SSPI&lt;br /&gt;
            SSPIAuth On&lt;br /&gt;
            SSPIOfferBasic Off&lt;br /&gt;
            SSPIAuthoritative On&lt;br /&gt;
            SSPIDomain &amp;lt;YOUR AD DOMAIN&amp;gt;&lt;br /&gt;
            require valid-user&lt;br /&gt;
        &amp;lt;/Files&amp;gt;&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Method 2&#039;&#039;&#039;: The alternative method is to use a .htaccess file&lt;br /&gt;
:This method is recommended for servers that will host multiple Moodle instances. It allows additional Moodle instances to be configured without restarting apache, and also makes the solution a little more portable. We need to add a directive to the main httpd.conf to allow configuration of authentication within .htaccess files.&lt;br /&gt;
    &amp;lt;Directory C:\moodle&amp;gt;&lt;br /&gt;
        AllowOverride AuthConfig&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::Create a new text file named &#039;.htaccess&#039; in the directory &#039;C:\moodle\moodle\auth\ldap&#039; and add the following directives:&lt;br /&gt;
    &amp;lt;Files ntlmsso_magic.php&amp;gt;&lt;br /&gt;
        AuthName &amp;quot;Moodle at My College&amp;quot;&lt;br /&gt;
        AuthType SSPI&lt;br /&gt;
        SSPIAuth On&lt;br /&gt;
        SSPIOfferBasic Off&lt;br /&gt;
        SSPIAuthoritative On&lt;br /&gt;
        SSPIDomain mycollege.ac.uk&lt;br /&gt;
        require valid-user&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:This enables the Moodle folder to be moved to any apache webserver that is configured to allow authentication configuration through .htaccess&lt;br /&gt;
&lt;br /&gt;
Lastly for Internet Explorer 7 onwards you must also replace this line in your httpd-ssl.conf file: &lt;br /&gt;
&lt;br /&gt;
  BrowserMatch &amp;quot;.*MSIE.*&amp;quot; \ &lt;br /&gt;
&lt;br /&gt;
with &lt;br /&gt;
&lt;br /&gt;
  BrowserMatch &amp;quot;.*MSIE [2-5]\..*&amp;quot; \ &lt;br /&gt;
&lt;br /&gt;
For further help and discussion: http://moodle.org/mod/forum/discuss.php?d=56565&lt;br /&gt;
&lt;br /&gt;
====Using the Kerberos Auth Module for Apache on Linux/UNIX (mod_auth_kerb)====&lt;br /&gt;
*Install and configure http://modauthkerb.sourceforge.net/&lt;br /&gt;
*Configuration of mod_auth_kerb in a Microsoft Windows Active Directory environment (AD 2003 and above) (http://grolmsnet.de/kerbtut/)&lt;br /&gt;
&lt;br /&gt;
Environment details in this example:&lt;br /&gt;
#&#039;&#039;&#039;Active Directory Domain:&#039;&#039;&#039; EXAMPLE.AC.UK&lt;br /&gt;
#&#039;&#039;&#039;Active Directory Domain Controller:&#039;&#039;&#039; dc.example.ac.uk&lt;br /&gt;
#&#039;&#039;&#039;Linux/UNIX web server:&#039;&#039;&#039; moodle.example.ac.uk&lt;br /&gt;
#&#039;&#039;&#039;Active Directory user account for web server service principal:&#039;&#039;&#039; moodlekerb&lt;br /&gt;
&lt;br /&gt;
Install kerberos on moodle.example.ac.uk and enter the following in krb5.conf (by default: /etc/krb5.conf)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[libdefaults]&lt;br /&gt;
    default_realm = EXAMPLE.AC.UK&lt;br /&gt;
[domain_realm]&lt;br /&gt;
    example.ac.uk = EXAMPLE.AC.UK&lt;br /&gt;
[realms]&lt;br /&gt;
     EXAMPLE.AC.UK = {&lt;br /&gt;
                      admin_server = dc.example.ac.uk&lt;br /&gt;
                      kdc          = dc.example.ac.uk&lt;br /&gt;
                    }:&lt;br /&gt;
* Test kerberos&lt;br /&gt;
Issue the following command at the shell prompt:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$&amp;gt; kinit user@EXAMPLE.AC.UK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &#039;user&#039; is an Active Directory account for which you know the password.&lt;br /&gt;
&lt;br /&gt;
Next, issue the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;$&amp;gt;klist&amp;lt;/pre&amp;gt;&lt;br /&gt;
If all is OK it will list the Kerberos ticket you were granted from the domain controller (KDC)&lt;br /&gt;
&lt;br /&gt;
* Create HTTP service principal for moodle.example.ac.uk&lt;br /&gt;
#Create the &#039;moodlekerb&#039; &#039;&#039;&#039;user&#039;&#039;&#039; account in Active Directory (NOT a machine account) to map to the web server service principal (HTTP/moodle.example.ac.uk@EXAMPLE.AC.UK)&lt;br /&gt;
NOTE: moodle.example.ac.uk MUST be the canonical DNS name of the server i.e. an A record (NOT a CNAME). Additionally a valid PTR (reverse DNS) record must exist and match the corresponding A record.&lt;br /&gt;
&lt;br /&gt;
#Use the ktpass.exe utility to map the service principal and create a keytab file&lt;br /&gt;
Apache requires a keytab file, which is generated with ktpass.exe on the Windows Active Directory Domain Controller.&lt;br /&gt;
Unfortunately, this component of Windows Server 2003 SP1 does not function correctly so one must obtain a hot fix: http://support.microsoft.com/kb/919557&lt;br /&gt;
&lt;br /&gt;
Run the following command on the domain controller:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\path\to\hotfix\ktpass.exe -princ HTTP/moodle.example.ac.uk@EXAMPLE.AC.UK -mapuser EXAMPLE\moodlekerb -crypto DES-CBC-MD5 +DesOnly +setPass +rndPass -ptype KRB5_NT_PRINCIPAL -out moodle.example.ac.uk.keytab&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy C:\path\to\hotfix\moodle.example.ac.uk.keytab to the moodle web server and remember the location (/etc/httpd/moodle.example.ac.uk.keytab or similar)&lt;br /&gt;
&lt;br /&gt;
* Configure Apache / mod_auth_kerb&lt;br /&gt;
Edit the Apache configuration for the moodle host and add the following directives:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        &amp;lt;Directory /path/to/moodle/docs/auth/ldap/&amp;gt;&lt;br /&gt;
                &amp;lt;Files ntlmsso_magic.php&amp;gt;&lt;br /&gt;
                        AuthName &amp;quot;Moodle&amp;quot;&lt;br /&gt;
                        AuthType Kerberos&lt;br /&gt;
                        KrbAuthRealms EXAMPLE.AC.UK&lt;br /&gt;
                        KrbServiceName HTTP&lt;br /&gt;
                        Krb5Keytab /etc/httpd/moodle.example.ac.uk.keytab&lt;br /&gt;
                        KrbMethodNegotiate on&lt;br /&gt;
                        KrbMethodK5Passwd on&lt;br /&gt;
                        KrbAuthoritative on&lt;br /&gt;
                        require valid-user&lt;br /&gt;
                &amp;lt;/Files&amp;gt;&lt;br /&gt;
        &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuring IP/Subnet Mask==&lt;br /&gt;
Subnet masks are based on binary patterns so need a bit of knowledge to understand. The best way to find out what IP/Subnet masks to use is to ask your Network Admin. &lt;br /&gt;
&lt;br /&gt;
* Just type them one after the other, separated by commas. You can use several syntaxes:&lt;br /&gt;
** Type the network-number/prefix-length combination. E.g. 192.168.1.0/24&lt;br /&gt;
** Type the network &#039;prefix&#039;, ending in a period character. E.g. 192.168.1.&lt;br /&gt;
** Type the network address range (&#039;&#039;&#039;this only works for the last address octect&#039;&#039;&#039;). E.g. 192.168.1.1-254&lt;br /&gt;
:All the three examples refer to the same subnetwork. So assuming you need to specify the following subnetworks:&lt;br /&gt;
::* 10.1.0/255.255.0.0&lt;br /&gt;
::* 10.2.0.0/255.255.0.0&lt;br /&gt;
::* 172.16.0.0/255.255.0.0&lt;br /&gt;
::* 192.168.100.0/255.255.255.240&lt;br /&gt;
:You can type:&lt;br /&gt;
 10.1.0.0/16, 10.2.0.0/16, 172.16.0.0/16, 192.168.100.0/28&lt;br /&gt;
: or:&lt;br /&gt;
  10.1.0.0/16, 10.2.0.0/16, 172.16.0.0/16, 192.168.100.240-255&lt;br /&gt;
:or even:&lt;br /&gt;
  10.1., 10.2., 172.16., 192.168.100.0/28&lt;br /&gt;
:(the last one cannot be expressed as a network &#039;prefix&#039; as the netmask does not fall on an octect boundary).&lt;br /&gt;
&lt;br /&gt;
==Configuring Domain user credentials format==&lt;br /&gt;
If you are using Moodle 2.4 and later there is a new setting that lets you configure the format of the domain user credentials, instead of using the old fixed format. The setting is called &amp;quot;Remote username format&amp;quot;. If you leave this seting empty, the default &#039;&#039;&#039;DOMAINNAME\username&#039;&#039;&#039; format will be used. You can use the optional &#039;&#039;&#039;%domain%&#039;&#039;&#039; placeholder to specify where the domain name appears, and the mandatory &#039;&#039;&#039;%username%&#039;&#039;&#039; placeholder to specify where the username appears.&lt;br /&gt;
&lt;br /&gt;
Some widely used formats are:&lt;br /&gt;
* &#039;&#039;&#039;%domain%\%username%&#039;&#039;&#039; : MS Windows default, contains the domain name, followed by a backlash character, followed by the username.&lt;br /&gt;
* &#039;&#039;&#039;%username%@%domain%&#039;&#039;&#039; : This is the same format used by Kerberos (domain name followed by an at sign, followed by the username).&lt;br /&gt;
* &#039;&#039;&#039;%domain%/%username%&#039;&#039;&#039; : Some people configure Samba+Winbind to use this format.&lt;br /&gt;
* &#039;&#039;&#039;%domain%+%username%&#039;&#039;&#039; : Some people configure Samba+Winbind to use this other format.&lt;br /&gt;
* &#039;&#039;&#039;%username%&#039;&#039;&#039; : Only contains the username, with no domain part.&lt;br /&gt;
&lt;br /&gt;
==Notes/Tips==&lt;br /&gt;
&lt;br /&gt;
#If you are using Firefox, you will need to follow these steps:&lt;br /&gt;
:*Load Firefox and type about:config in the address box. The configuration settings page should be displayed.&lt;br /&gt;
:*In the Filter box, type the word &amp;quot;ntlm&amp;quot; to filter the NTLM strings. You should see three settings displayed.&lt;br /&gt;
:*Double-click on &amp;quot;network.automatic-ntlm-auth.trusted-uris&amp;quot;.&lt;br /&gt;
:*In the box, enter the full URL of your Moodle server. For example &amp;lt;pre&amp;gt;http://moodle.mydomain.com, (the comma is important)&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Close Firefox and restart.&lt;br /&gt;
# NTLM seems to not work at all when BASIC authentication is enabled. (this was using the Kerberos method, other ways may work)&lt;br /&gt;
# If the account in your AD management console shows like &amp;quot;First Last&amp;quot;, you better change the ldap settings parameter &#039;User Attribute&#039; from its default of {blank} / &#039;cn&#039; to &#039;sAMAccountName&#039; as indicated in [http://moodle.org/mod/forum/discuss.php?d=132364#p682173 this post]. The reason is that the cn name generally looks like &amp;quot;First Last&amp;quot;, once you done the ldap sync, the user name in moodle will be &amp;quot;first last&amp;quot;, but IE passes the account of &amp;quot;domain\first.last&amp;quot; to moodle which does not exist in moodle.&lt;br /&gt;
&lt;br /&gt;
== To get a domain name for Moodle working on IIS7.5 Windows 2008 R2 ==&lt;br /&gt;
Refer to http://support.microsoft.com/kb/896861. Key section listed below.&lt;br /&gt;
Click Start, click Run, type regedit, and then click OK.&amp;lt;br /&amp;gt;&lt;br /&gt;
In Registry Editor, locate and then click the following registry key: &lt;br /&gt;
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0&amp;lt;br /&amp;gt;&lt;br /&gt;
Right-click MSV1_0, point to New, and then click Multi-String Value.&amp;lt;br /&amp;gt;&lt;br /&gt;
Type BackConnectionHostNames, and then press ENTER.&amp;lt;br /&amp;gt;&lt;br /&gt;
Right-click BackConnectionHostNames, and then click Modify.&amp;lt;br /&amp;gt;&lt;br /&gt;
In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.&amp;lt;br /&amp;gt;&lt;br /&gt;
Quit Registry Editor, and then restart the IISAdmin service.&lt;br /&gt;
&lt;br /&gt;
==Compiling mod_auth_ntlm_winbind on Debian/Ubuntu==&lt;br /&gt;
You need to install the following packages (and all of their dependencies) by using aptitude, synaptic, etc.:&lt;br /&gt;
&lt;br /&gt;
  autoconf apache2-threaded-dev debian-builder&lt;br /&gt;
&lt;br /&gt;
Once you have them installed, open up a text console, go to the directory where you downloaded the mod_auth_ntlm_winbind files an execute the following commands (as a normal user):&lt;br /&gt;
&lt;br /&gt;
  autoconf&lt;br /&gt;
  ./configure --with-apxs=/usr/bin/apxs2 --with-apache=/usr/sbin/apache2&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
That should compile it without errors. Then as a user that can run commands as root via sudo, execute the following command from the same directory:&lt;br /&gt;
&lt;br /&gt;
  sudo make install&lt;br /&gt;
&lt;br /&gt;
This will create the final mod_auth_ntlm_winbind.so file and install it under /usr/lib/apache2/modules, with the rest of the Apache 2 modules (the size of the file and last modification time shown below may differ from your install):&lt;br /&gt;
&lt;br /&gt;
  ls -l /usr/lib/apache2/modules/mod_auth_ntlm_winbind.so&lt;br /&gt;
  -rw-r--r-- 1 root root 20921 2009-02-17 04:27 /usr/lib/apache2/modules/mod_auth_ntlm_winbind.so&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://moodle.org/mod/forum/view.php?id=42 Using Moodle: User authentication] forum&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=45887 NTLM Authentication] forum discussion&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=80104 Merging AD NTLM SSO into auth/ldap] forum discussion&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=186661 Moodle in a DMZ with NTLM] forum discussion&lt;br /&gt;
*[http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=314 Download the NTLM Authentication Module]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Authentification NTLM]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121675</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121675"/>
		<updated>2015-12-01T15:50:38Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Set up your server */ typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). For example it is important that the HTTP daemon is configured to support [[Using slash arguments| slash arguments]].&lt;br /&gt;
&lt;br /&gt;
If a hosting provider in being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform, otherwise all the core configuration should be done. It will be helpful to become familiar with how to change setting within the hosting providers platform (e.g. PHP file upload maximums) as the options and tools provided can vary a huge amount between them.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121666</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121666"/>
		<updated>2015-11-30T16:36:20Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Set up your server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc). For example it is important that the HTTP daemon is configured to support [[Using slash arguments| slash arguments]].&lt;br /&gt;
&lt;br /&gt;
If a hosting provider in being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform, otherwise all the core configuration should be done. I will be helpful to become familiar with how to change setting within the hosting providers platform (e.g. PHP file upload maximums) as the options and tools provided can vary a huge amount between then.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Talk:Installing_Moodle&amp;diff=121664</id>
		<title>Talk:Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Talk:Installing_Moodle&amp;diff=121664"/>
		<updated>2015-11-30T13:55:23Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;blockquote&amp;gt;&amp;quot;&#039;&#039;&#039;Oracle and MSSQL are fully supported&#039;&#039;&#039; (but may never have been tested for optional plugins) but documentation and &#039;&#039;&#039;support is limited&#039;&#039;&#039;&amp;quot;.&amp;lt;/blockquote&amp;gt; (emphasis added)&lt;br /&gt;
How can they be fully supported if support is limited? Perhaps there should be a better explanation of what is meant by &amp;quot;support&amp;quot; here?&lt;br /&gt;
&lt;br /&gt;
[[User:Mark Johnson|Mark Johnson]] 16:48, 23 January 2012 (WST)&lt;br /&gt;
&lt;br /&gt;
Fair point - improved I hope --[[User:Howard Miller|Howard Miller]] 22:52, 21 March 2012 (WST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;It is strongly recommended to use ACL when your server supports it ... &amp;lt;code&amp;gt;chmod -R +a ...&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The docs suggest a specific syntax for setting ACLs that only seems to work on OSX instead of Linux systems which is what the Requirements section suggestions this document is primarily focused on.&lt;br /&gt;
&lt;br /&gt;
The ACL given also seems to directly against the security advice also given on that page.  &amp;lt;code&amp;gt;It is vital that the files are not writable by the web server user&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Chris Francy|Chris Francy]] ([[User talk:Chris Francy|talk]]) 04:51, 1 February 2014 (WST)&lt;br /&gt;
&lt;br /&gt;
I agree and think that talk of ACL&#039;s it confusing and unnecessary in the standard install docs.&lt;br /&gt;
&lt;br /&gt;
--[[User:Paul Verrall|Paul Verrall]] ([[User talk:Paul Verrall|talk]]) 21:55, 30 November 2015 (AWST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Please see Create an empty database section and check if --&amp;lt;blockquote&amp;gt; Oracle (known issues, not fully supported)&lt;br /&gt;
&amp;lt;/blockquote&amp;gt; -- is correct or which Moodle version affects.  When you go and see release_notes for Software requirements, don&#039;t say anything about issues. --[[User:Carina Martinez 2|Carina Martinez 2]] ([[User talk:Carina Martinez 2|talk]]) 00:43, 20 November 2014 (AWST)&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121663</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121663"/>
		<updated>2015-11-30T13:39:20Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Set up your server */ Mention slash args and hopefully generally improve this section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
Depending the use case a Moodle server may be anything from a Desktop PC (e.g. for testing and evaluating) to a rackmounted or  [[Server cluster|clustered]] solution. As mentioned above there are lots of possibilities for installing the basic server software, some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]. &lt;br /&gt;
&lt;br /&gt;
It will help hugely, regardless of your deployment choices, if time is taken to understand how to configure the different parts of your software stack (HTTP daemon, database,  PHP etc) e.g. it is important that the HTTP daemon is configured to support [[Using slash arguments| slash arguments]].&lt;br /&gt;
&lt;br /&gt;
If a hosting provider in being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform, otherwise all the core configuration should be done. I will be helpful to become familiar with how to change setting within the hosting providers platform (e.g. PHP file upload maximums) as the options and tools provided can vary a huge amount between then.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121662</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121662"/>
		<updated>2015-11-30T12:54:31Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (sometimes known as the LAMP platform). Typically this is also how Moodle is run, although there are other options as long as the software requirements of the  [{{Release notes}} release] are met.&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.  You also need to verify that your webhost supports the required php version for the Moodle installation you are installing.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121660</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121660"/>
		<updated>2015-11-30T11:24:38Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Undo revision 121333 by Tsala (talk). Already updated to remove superfluous text and ambiguity for 3.0. The restored text adds no information not already stated in this section.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.  You also need to verify that your webhost supports the required php version for the Moodle installation you are installing.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MySQL]] (known issues - see MDL-45233)&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=OPcache&amp;diff=121354</id>
		<title>OPcache</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=OPcache&amp;diff=121354"/>
		<updated>2015-11-18T11:20:20Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Configuration */ Revised value for max_accelerated_files for 3.0 and more concise explanation of it&amp;#039;s use.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
&lt;br /&gt;
The standard OPcache extension is strongly recommended; since Moodle 2.6, it is the only solution officially supported by PHP developers. The benefits are increased performance and significantly lower memory usage. However, opcode caching extensions (including OPcache, eAccelerator and APC) aren&#039;t compatible with servers configured to use some common types of high-security PHP handlers such as suPHP (the default on WHM / cPanel Linux servers).&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
The OPcache extension is distributed as part of PHP 5.5.0 and later. It is available also for older stable PHP releases from PECL under the original name ZendOPcache.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: If you are running PHP 5.3 or 5.4 you can safely ignore the Environment Check message about OpCache. Nonetheless, [https://moodle.org/mod/forum/discuss.php?d=245885 it might be useful] to upgrade Operating System/PHP and get to 5.5 or newer; as there have been all sorts of problems described on PHP 5.2 and 5.3, and upgrading PHP turned out to be the easier solution. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
PHP.ini settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[opcache]&lt;br /&gt;
opcache.enable = 1&lt;br /&gt;
opcache.memory_consumption = 128&lt;br /&gt;
opcache.max_accelerated_files = 8000&lt;br /&gt;
opcache.revalidate_freq = 60&lt;br /&gt;
&lt;br /&gt;
; Required for Moodle&lt;br /&gt;
opcache.use_cwd = 1&lt;br /&gt;
opcache.validate_timestamps = 1&lt;br /&gt;
opcache.save_comments = 1&lt;br /&gt;
opcache.enable_file_override = 0&lt;br /&gt;
&lt;br /&gt;
; If something does not work in Moodle&lt;br /&gt;
;opcache.revalidate_path = 1 ; May fix problems with include paths&lt;br /&gt;
;opcache.mmap_base = 0x20000000 ; (Windows only) fix OPcache crashes with event id 487&lt;br /&gt;
&lt;br /&gt;
; Experimental for Moodle 2.6 and later&lt;br /&gt;
;opcache.fast_shutdown = 1&lt;br /&gt;
;opcache.enable_cli = 1 ; Speeds up CLI cron&lt;br /&gt;
;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When using non-Windows platforms, you have to use the &#039;&#039;zend_extension&#039;&#039; configuration to load the OPcache extension into PHP by adding to php.ini.&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
zend_extension=/full/path/to/opcache.so &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When using IIS you will need PHP 5.5 and you will need to add the extension for opcache under the &#039;&#039;ExtensionList&#039;&#039; section of the php.ini file. For PHP 5.3 and 5.4 you can download the binaries separately from [http://windows.php.net/downloads/pecl/releases/opcache] and you will also need to enter full absolute path to the module dll in php.ini.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code ini&amp;gt;&lt;br /&gt;
[ExtensionList]&lt;br /&gt;
...&lt;br /&gt;
zend_extension=php_opcache.dll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; max_accelerated_files&lt;br /&gt;
From: [http://php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files php.net max-accelerated-files]&lt;br /&gt;
*&#039;&#039;The maximum number of keys (and therefore scripts) in the OPcache hash table. The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987 } that is bigger than the configured value. Only numbers between 200 and 100000 are allowed.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As Moodle 3.0 contains over 8000 php files it is recommended above that opcache.max_accelerated_files should be set to 8000 to accommodate this (16229 will actually be used as per the explanation above). &lt;br /&gt;
&lt;br /&gt;
If many additional plugins are installed so that your total PHP files exceed 16229 then the next most suitable value for max_accelerated_files should be used.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [http://pecl.php.net/package/ZendOpcache PECL ZendOPcache]&lt;br /&gt;
* [http://windows.php.net/downloads/pecl/releases/opcache/ Windows builds for PHP 5.3-5.4]&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=244133 OPcache: Memory Usage = 100% (is this good or bad?)]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=245885 OPCode cache]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
[[es:OPcache]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121062</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121062"/>
		<updated>2015-11-05T09:13:15Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Hardware */ Pointless statement and already covered in the final paragraph.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core or more recommended.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.  You also need to verify that your webhost supports the required php version for the Moodle installation you are installing.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121061</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121061"/>
		<updated>2015-11-05T09:12:06Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Hardware */ Not sure that backups need to be mentioned at all here as it is not a &amp;#039;Requirement&amp;#039; to install Moodle.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core recommended. These settings may vary according to the resources used.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.  You also need to verify that your webhost supports the required php version for the Moodle installation you are installing.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121060</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121060"/>
		<updated>2015-11-05T08:36:03Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Hardware */ 512MB is a much more realistic minimum memory requirement.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core recommended. These settings may vary according to the resources used.&lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site.&lt;br /&gt;
* Memory: 512MB (min), 1GB or more is recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.  You also need to verify that your webhost supports the required php version for the Moodle installation you are installing.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121059</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121059"/>
		<updated>2015-11-05T08:33:15Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Hardware */ 3.0rc1 is 193MB, round up to 200MB requirement.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core recommended. These settings may vary according to the resources used.&lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site.&lt;br /&gt;
* Memory: 256MB (min), 1GB or more is strongly recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.  You also need to verify that your webhost supports the required php version for the Moodle installation you are installing.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121007</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Installing_Moodle&amp;diff=121007"/>
		<updated>2015-11-03T12:11:08Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page explains how to install Moodle. If you are an expert and/or in a hurry try [[Installation Quickstart]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you just want to try Moodle on a standalone machine there are &#039;one-click&#039; installers for Windows (see [[Complete install packages for Windows]]) and for OSX (see [[Complete Install Packages for Mac OS X]]) or [[ install on OS X]]. These are unsuitable for production servers. &lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[PostgreSQL]]/[[MySQL]]/[[MariaDB]] and [[PHP]] (also sometimes known as the LAMP platform). If in doubt, this is the safest combination (if for no other reason than being the most common). There are other options - see the Software section that follows:&lt;br /&gt;
&lt;br /&gt;
If you are installing Moodle in a Windows server, note that from php5.5 onwards, you will also need to have  the Visual C++ Redistributable for Visual Studio 2012 installed from:&lt;br /&gt;
http://www.microsoft.com/en-us/download/details.aspx?id=30679 Visual C++] ( x86 or x64)  &lt;br /&gt;
&lt;br /&gt;
The basic requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
=== Hardware === &lt;br /&gt;
* Disk space: 160MB free (min) plus as much as you need to store your materials. 5GB is probably a realistic minimum. &lt;br /&gt;
* Processor: 1GHz (min), 2GHz dual core recommended. These settings may vary according to the resources used.&lt;br /&gt;
* Backups: at least the same again (at a remote location preferably) as above to keep backups of your site.&lt;br /&gt;
* Memory: 256MB (min), 1GB or more is strongly recommended. &lt;br /&gt;
&lt;br /&gt;
All the above requirements will vary depending on specific hardware and software combinations as well as the type of use and load; busy sites may well require additional resources. Further guidance can be found under [[Performance_recommendations|performance recommendations]].&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
&lt;br /&gt;
== Set up your server ==&lt;br /&gt;
&lt;br /&gt;
...or desktop computer, if you are just evaluating Moodle. There are lots of possibilities for installing the basic server software depending on your particular choices. Some links and pointers are at [[Installing AMP]], [[Internet_Information_Services|IIS]], [[Nginx]]&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted server all this should be done for you. However, (especially on shared hosting) make sure you understand or find out how to change PHP settings (e.g. file upload maximums). This can vary a huge amount from host to host.  You also need to verify that your webhost supports the required php version for the Moodle installation you are installing.&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: While there are now a number of places you can get the Moodle code, you are strongly advised to obtain Moodle from moodle.org. If you run into problems it will be a great deal easier to support you.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have two options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads and unzip/unpack...&lt;br /&gt;
* &#039;&#039;&#039;OR&#039;&#039;&#039; Pull the code from the Git repository (recommended for developers and also makes upgrading very simple):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone --depth=1 -b MOODLE_30_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
--depth=1  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
--single-branch  option to limit cloning to a single branch, this fetches the Moodle 3.0 Stable branch (latest weekly build). For a fuller discussion see [[Git for Administrators]]. &lt;br /&gt;
&lt;br /&gt;
Either of the above should result in a directory called &#039;&#039;&#039;moodle&#039;&#039;&#039;, containing a number of files and folders. &lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. See the documentation for your system and/or web server if you are unsure. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you are downloading Moodle to your local computer and then uploading it to your hosted web site, if possible upload the compressed file and decompress at the remote end (check your &#039;file manager&#039;). Failing that, watch FTP progress carefully for errors or missed files.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Secure the Moodle files:&#039;&#039;&#039; It is vital that the files are not writeable by the web server user. For example, on Unix/Linux (as root):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
# chmod -R 0755 /path/to/moodle&lt;br /&gt;
# find /path/to/moodle -type f -exec chmod 0644 {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(files are owned by the administrator/superuser and are only writeable by them - readable by everyone else)&lt;br /&gt;
&lt;br /&gt;
The third command finds all the regular files and executes the chmod command 0644 on them. &lt;br /&gt;
&lt;br /&gt;
If you want to use the built-in plugin installer you need to make the directory writable by web server user. It is strongly recommended to use ACL when your server supports it, for example if your Apache server uses account www-data: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect of the previous command is to allow the Apache user account (www-data in this case) to access and change files within the moodle site. Many people would consider this a brave move for a new site admin to implement. In a new moodle you can safely leave this out. A default Ubuntu install does not have the +a option for the chmod command anyway. The +a attribute is an ACL (Access Control List) facility which allows you to set per user access for individual files. For example, OSX has this by default.&lt;br /&gt;
&lt;br /&gt;
== Create an empty database ==&lt;br /&gt;
&lt;br /&gt;
Next create a new, empty database for your installation. You need to find and make a note of following information for use during the final installation stage:&lt;br /&gt;
* &#039;&#039;&#039;dbhost&#039;&#039;&#039; - the database server hostname. Probably &#039;&#039;localhost&#039;&#039; if the database and web server are the same machine, otherwise the name of the database server&lt;br /&gt;
* &#039;&#039;&#039;dbname&#039;&#039;&#039; - the database name. Whatever you called it, e.g. &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;dbuser&#039;&#039;&#039; - the username for the database. Whatever you assigned, e.g. &#039;&#039;moodleuser&#039;&#039; - do not use the root/superuser account. Create a proper account with the minimum permissions needed.&lt;br /&gt;
* &#039;&#039;&#039;dbpass&#039;&#039;&#039; - the password for the above user&lt;br /&gt;
&lt;br /&gt;
If your site is hosted you should find a web-based administration page for databases as part of the control panel (or ask your administrator). For everyone else or for detailed instructions, see the page for your chosen database server:&lt;br /&gt;
* [[PostgreSQL]]&lt;br /&gt;
* [[MariaDB]]&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (known issues, not fully supported - see MDL-41310)&lt;br /&gt;
&lt;br /&gt;
== Create the (&#039;&#039;moodledata&#039;&#039;) data directory  ==&lt;br /&gt;
&lt;br /&gt;
Moodle requires a directory to store all of its files (all your site&#039;s uploaded files, temporary data, cache, session data etc.). The web server needs to be able to write to this directory. On larger systems consider how much free space you are going to use when allocating this directory. &lt;br /&gt;
&lt;br /&gt;
Due to the way Moodle caches data you may have performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) memcached for [[Caching]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; This directory must &#039;&#039;&#039;NOT&#039;&#039;&#039; be accessible directly via the web. This would be a serious security hole. Do not try to place it inside your web root or inside your Moodle program files directory. Moodle will not install. It can go anywhere else convenient. &lt;br /&gt;
&lt;br /&gt;
Here is an example (Unix/Linux) of creating the directory and setting the permissions for &#039;&#039;&#039;anyone&#039;&#039;&#039; on the server to write here. This is only appropriate for Moodle servers that are not shared. Discuss this with your server administrator for better permissions that just allow the web server user to access these files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /path/to/moodledata&lt;br /&gt;
# chmod 0777 /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your server supports ACL it is recommended to set following permissions, for example if your Apache server uses account www-data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chmod -R +a &amp;quot;www-data allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are planning to execute PHP scripts from the command line you should set the same permissions for the current user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo chmod -R +a &amp;quot;`whoami` allow read,delete,write,append,file_inherit,directory_inherit&amp;quot; /path/to/moodledata&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Securing moodledata in a web directory ====&lt;br /&gt;
&lt;br /&gt;
If you are using a hosted site and you have no option but to place &#039;moodledata&#039; in a web accessible directory. You may be able to secure it by creating an .htaccess file in the &#039;moodledata&#039; directory. This does not work on all systems - see your host/administrator. Create a file called .htaccess containing only the following lines:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Start Moodle install ==&lt;br /&gt;
It&#039;s now time to run the installer to create the database tables and configure your new site. The recommended method is to use the command line installer. If you cannot do this for any reason (e.g. on a Windows server) the web based installer is still available.&lt;br /&gt;
&lt;br /&gt;
=== Command line installer ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s best to run the command line as your system&#039;s web user. You need to know what that is - see your system&#039;s documentation (e.g. Ubuntu/Debian is &#039;www-data&#039;, Centos is &#039;apache&#039;)&lt;br /&gt;
&lt;br /&gt;
* Example of using the command-line  (as root - substitute &#039;www-data&#039; for your web user):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# chown www-data /path/to/moodle&lt;br /&gt;
# cd /path/to/moodle/admin/cli&lt;br /&gt;
# sudo -u www-data /usr/bin/php install.php&lt;br /&gt;
# chown -R root /path/to/moodle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The chowns allow the script to write a new config.php file. More information about the options can be found using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# php install.php --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be asked for other settings that have not been discussed on this page - if unsure just accept the defaults. For a full discussion see [[Administration via command line]]&lt;br /&gt;
&lt;br /&gt;
=== Web based installer ===&lt;br /&gt;
To run the web installer script, just go to your Moodle&#039;s main URL using a web browser.&lt;br /&gt;
&lt;br /&gt;
The installation process will take you through a number of pages. You should be asked to confirm the copyright, see the database tables being created, supply administrator account details and supply the site details. The database creation can take some time - please be patient. You should eventually end up at the Moodle front page with an invitation to create a new course. &lt;br /&gt;
&lt;br /&gt;
It is very likely that you will be asked to download the new config.php file and upload it to your Moodle installation - just follow the on-screen instructions.&lt;br /&gt;
&lt;br /&gt;
==Final configuration==&lt;br /&gt;
&lt;br /&gt;
=== Settings within Moodle ===&lt;br /&gt;
There are a number of options within the Moodle Site Administration screens (accessible from the &#039;Site administration&#039; tab in the &#039;Administration&#039; block. Here are a few of the more important ones that you will probably want to check:&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message Outputs &amp;gt; Email&#039;&#039;: Set your smtp server and authentication if required (so your Moodle site can send emails). The support contact for your site is also set on this page. &lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; System paths&#039;&#039;: Set the paths to du, dot and aspell binaries.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; HTTP&#039;&#039;: If you are behind a firewall you may need to set your proxy credentials in the &#039;Web proxy&#039; section.&lt;br /&gt;
* &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Location &amp;gt; Update timezones&#039;&#039;: Run this to make sure your timezone information is up to date. (more info [[Location]])&lt;br /&gt;
** [http://php.net/manual/en/timezones.php Set server&#039;s local timezone] inside &amp;lt;tt&amp;gt;php.ini&amp;lt;/tt&amp;gt; (should probably be inside &amp;lt;tt&amp;gt;/etc/php.ini&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/etc/php.d/date.ini&amp;lt;/tt&amp;gt;, depending on the underline OS):&lt;br /&gt;
**: &amp;lt;code ini&amp;gt;[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
date.timezone = &amp;quot;YOUR LOCAL TIMEZONE&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remaining tasks ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Configure Cron&#039;&#039;&#039;: Moodle&#039;s background tasks (e.g. sending out forum emails and performing course backups) are performed by a script which you can set to execute at specific times of the day. This is known as a cron script. Please refer to the [[Cron|Cron instructions]].&lt;br /&gt;
* &#039;&#039;&#039;Set up backups&#039;&#039;&#039;: See [[Site backup]] and [[Automated course backup]].&lt;br /&gt;
* &#039;&#039;&#039;Check mail works&#039;&#039;&#039;: [[Add a new user|Create a test user]] with a valid email address and [[message|send them a message]]. Do they receive an email copy of the message? If not, check the settings in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Message outputs &amp;gt; Email&#039;&#039;. Don&#039;t be tempted to skip this step (clue: email is used to recover lost passwords, including the administrator password when you forget it!)&lt;br /&gt;
* &#039;&#039;&#039;Secure your Moodle site&#039;&#039;&#039;: Read the [[Security recommendations]].&lt;br /&gt;
*&#039;&#039;&#039;Increasing the maximum upload size&#039;&#039;&#039;  See [[Installation FAQ]] Maximum upload file size - how to change it?&lt;br /&gt;
&lt;br /&gt;
=== Installation is complete :) ===&lt;br /&gt;
&lt;br /&gt;
* Create a new course: You can now [[Adding a new course|create a new course]] and have a play ;-)&lt;br /&gt;
&lt;br /&gt;
=== If something goes wrong... ===&lt;br /&gt;
&lt;br /&gt;
Here are some things you should try...&lt;br /&gt;
&lt;br /&gt;
* Check the [[Installation FAQ]]&lt;br /&gt;
* Check your file permissions carefully. Can your web server read (but not write) the Moodle program files? Can your web server read and write your Moodle data directory?&lt;br /&gt;
* Check your database permissions. Have you set up your database user with the correct rights and permissions for your configuration (especially if the web server and database server are different machines)?&lt;br /&gt;
* Create your [[Configuration file]] (config.php) by hand. Copy config-dist.php (in the root of the Moodle program directory) to config.php, edit it and set your database/site options there. Installation will continue from the right place. &lt;br /&gt;
* Once you have a config.php (see previous tip) you can edit it to turn on debugging (in section 8). This may give you extra information to help track down a problem. If you have access, check your web server error log(s).&lt;br /&gt;
* Re-check your php.ini / .htaccess settings. Are they appropriate (e.g. memory_limit), did you edit the correct php.ini / .htaccess file and (if required) did you re-start the web server after making changes?&lt;br /&gt;
* Did you include any non-core (optional) plugins, themes or other code before starting the installation script? If so, remove it and try again (it may be broken or incompatible).&lt;br /&gt;
* Explain your problem in the [http://moodle.org/mod/forum/view.php?id=28 Installation problems forum]. &#039;&#039;&#039;PLEASE&#039;&#039;&#039; list your software versions; explain what you did, what happened and what error messages you saw (if any); explain what you tried. There is no such thing as &#039;nothing&#039;, even a blank page is something!&lt;br /&gt;
&lt;br /&gt;
== Platform specific instructions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Much of this information is provided by the community. It may not have been checked and may be out of date. Please read in conjunction with the above installation instructions.&lt;br /&gt;
&lt;br /&gt;
* [[Windows installation]]&lt;br /&gt;
** [[Installing Moodle on SmarterASP.NET]]&lt;br /&gt;
* [[Unix or Linux Installation]]&lt;br /&gt;
* [[Mac Installation]]&lt;br /&gt;
* [[Amazon EC2 Cloud Services Installation]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://www.slideshare.net/gb2048/my-own-moodle Slideshare presentation by Gareth Barnard on installing a local installation of Moodle] and accompanying [https://drive.google.com/folderview?id=0B17B0rYH2zERU21sQnVweUZCUFk&amp;amp;usp=sharing  help guides]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=182086 New Video Tutorial- How to Install Moodle on Shared Hosting via cPanel (Not Fantastico)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=199542 Video Tutorial - Install Moodle on a Virtual Box from scratch] &lt;br /&gt;
&lt;br /&gt;
[[es:Instalaci%C3%B3n_de_moodle]]&lt;br /&gt;
[[de:Installation von Moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120146</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120146"/>
		<updated>2015-10-06T13:59:51Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* How can I tell what Cache store I am really using */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... A good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much memory should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==How can I tell what Cache store I am really using==&lt;br /&gt;
[[File:perf.png|thumb|300px]]&lt;br /&gt;
If you temporarily switch on performance debugging at &#039;&#039;&#039;Site administration  Development &amp;gt; Debugging &amp;gt; Performance info&#039;&#039;&#039; some useful information is displayed the the footer of all your pages. This includes information about the MUC cache objects set and retrieved as well as the cachestore they came from.&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039; cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of the caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to look.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120145</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120145"/>
		<updated>2015-10-06T13:59:11Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... A good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much memory should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==How can I tell what Cache store I am really using==&lt;br /&gt;
[[File:perf.png|thumb|300px]]&lt;br /&gt;
If you temporarily switch on performance debugging at &#039;&#039;&#039;Site administration  Development &amp;gt; Debugging &amp;gt; Performance info&#039;&#039;&#039; some useful information is displayed teh the footer of all your moodle pages. This includes information about the MUC cache objects set and retrieved as well as the cachestore they came from.&lt;br /&gt;
&lt;br /&gt;
Sometimes, even if you think you have set it up perfectly Moodle will silently fail over to using the default cache stores if it encounters a problem&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039; cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of the caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to look.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:perf.png&amp;diff=120144</id>
		<title>File:perf.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:perf.png&amp;diff=120144"/>
		<updated>2015-10-06T13:57:59Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Example of the on-screen performance information displayed in the footer when &amp;#039;Site administration &amp;gt; Development &amp;gt; Debugging &amp;gt; Performance&amp;#039; info is enabled&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of the on-screen performance information displayed in the footer when &#039;Site administration &amp;gt; Development &amp;gt; Debugging &amp;gt; Performance&#039; info is enabled&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120143</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120143"/>
		<updated>2015-10-06T13:39:01Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Where can I find more documentation on setting up the MUC? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... A good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039; cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of the caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to look.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120142</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120142"/>
		<updated>2015-10-06T13:38:49Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Where can I find more documentation on setting up the MUC? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... A good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039; cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of the caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120141</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120141"/>
		<updated>2015-10-06T13:38:10Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* What is that little grey triangle? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... A good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039; cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120140</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120140"/>
		<updated>2015-10-06T13:36:38Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* How can I make MUC faster? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... A good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039;cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120139</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120139"/>
		<updated>2015-10-06T13:07:15Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* What is that little grey triangle? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
[[File:muc-triangle.png|thumb|300px]]&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039;cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:muc-triangle.png&amp;diff=120138</id>
		<title>File:muc-triangle.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:muc-triangle.png&amp;diff=120138"/>
		<updated>2015-10-06T13:05:42Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: That little grey triangle when your default MUC mapping is not compatible with one or more of the cache definitions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;That little grey triangle when your default MUC mapping is not compatible with one or more of the cache definitions.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120137</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120137"/>
		<updated>2015-10-06T12:59:59Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* How much RAM should I allocate to MUC? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
Most importantly if you decide to implement an in memory cache like Memcached then monitor and understand its use in &#039;&#039;&#039;your&#039;&#039;&#039; deployment as this can vary wildly.&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039;cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120136</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120136"/>
		<updated>2015-10-06T12:57:48Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* What is wrong with the default file-system MUC? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
Not much at all, but the MUCs performance is dependant on the read/write speed of it&#039;s storage medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent) storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast yet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039;cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120135</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120135"/>
		<updated>2015-10-06T12:56:46Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Should I be using the MUC? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
If your site is already running fine then consider &#039;&#039;&#039;not changing anything&#039;&#039;&#039; as &amp;quot;[https://en.wikipedia.org/wiki/Program_optimization#When_to_optimize premature optimization is the root of all evil]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already speeds thing up greatly than if there was no MUC at all. By further configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUCs performance is dependant on the read/write speed of it&#039;s storage&lt;br /&gt;
medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent)  storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast vet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039;cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Template:Performance&amp;diff=120134</id>
		<title>Template:Performance</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Template:Performance&amp;diff=120134"/>
		<updated>2015-10-06T12:47:30Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;navtrail&amp;quot;&amp;gt;[[Main page]] ► [[Managing a Moodle site]]  ► [[Performance]]  ►  [[{{PAGENAME}}]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;sideblock right&amp;quot; style=&amp;quot;width: 14em;&amp;quot;&amp;gt;	&lt;br /&gt;
&amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;[[Performance]]&amp;lt;/div&amp;gt;	&lt;br /&gt;
&amp;lt;div class=&amp;quot;content&amp;quot;&amp;gt;&lt;br /&gt;
*[[Performance recommendations]]&lt;br /&gt;
*[[Performance settings]]&lt;br /&gt;
*[[Performance overview]]&lt;br /&gt;
*[[Caching]]&lt;br /&gt;
*[[Performance FAQ]]&lt;br /&gt;
*[[MUC FAQ]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Performance]]&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;This template will categorize articles that include it into [[:Category:Performance]].&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Talk:MUC_FAQ&amp;diff=120133</id>
		<title>Talk:MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Talk:MUC_FAQ&amp;diff=120133"/>
		<updated>2015-10-06T12:43:55Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Created page with &amp;quot;If you feel other questions could be well addressed here, either add them to the FAQ if you have the answers, or leave a comment here if you have just the question.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you feel other questions could be well addressed here, either add them to the FAQ if you have the answers, or leave a comment here if you have just the question.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120132</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120132"/>
		<updated>2015-10-06T12:41:59Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* How do I deploy Memcached */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already &lt;br /&gt;
speeds thing up greatly than if there was no MUC at all. By further&lt;br /&gt;
configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUCs performance is dependant on the read/write speed of it&#039;s storage&lt;br /&gt;
medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent)  storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast vet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
More details can be found in the main [https://docs.moodle.org/310/en/Caching#Memcached Caching documentaion].&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039;cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Performance&amp;diff=120131</id>
		<title>Performance</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Performance&amp;diff=120131"/>
		<updated>2015-10-06T12:36:57Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Managing a Moodle site}}&lt;br /&gt;
*[[Performance recommendations]]&lt;br /&gt;
*[[Performance settings]]&lt;br /&gt;
*[[Performance overview]]&lt;br /&gt;
*[[Caching]]&lt;br /&gt;
*[[How to check your database for corruption]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Performance FAQ]]&lt;br /&gt;
*[[MUC FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
[[de:Geschwindigkeit]]&lt;br /&gt;
[[es:Desempeño]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120130</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120130"/>
		<updated>2015-10-06T12:35:16Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* What is that little grey triangle? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already &lt;br /&gt;
speeds thing up greatly than if there was no MUC at all. By further&lt;br /&gt;
configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUCs performance is dependant on the read/write speed of it&#039;s storage&lt;br /&gt;
medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent)  storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast vet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is &#039;&#039;&#039;never&#039;&#039;&#039;cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t exist &#039;&#039;&#039;only&#039;&#039;&#039; when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly as may be the case with Memcached.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120129</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120129"/>
		<updated>2015-10-06T12:30:34Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already &lt;br /&gt;
speeds thing up greatly than if there was no MUC at all. By further&lt;br /&gt;
configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUCs performance is dependant on the read/write speed of it&#039;s storage&lt;br /&gt;
medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent)  storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast vet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is *never* cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t only when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120128</id>
		<title>MUC FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=MUC_FAQ&amp;diff=120128"/>
		<updated>2015-10-06T12:17:47Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Created page with &amp;quot;{{MUC FAQ}}  The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex off-putting beast, and this can lead to it either being ignored or, as is often t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{MUC FAQ}}&lt;br /&gt;
&lt;br /&gt;
The Moodle Unified Cache (MUC) on initial inspection  can appear to be a complex&lt;br /&gt;
off-putting beast, and this can lead to it either being ignored or, as is&lt;br /&gt;
often the case, poorly configured.&lt;br /&gt;
&lt;br /&gt;
Here is what you need to know (so you can ignore [https://docs.moodle.org/310/en/Caching the rest]).&lt;br /&gt;
&lt;br /&gt;
==What is the MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUC is a cache, a cache is a store of data which is easier/faster to&lt;br /&gt;
retrieve than if it came from it&#039;s source. It saves (computing) effort and makes Moodle&lt;br /&gt;
faster.&lt;br /&gt;
&lt;br /&gt;
==Should I be using the MUC?==&lt;br /&gt;
&lt;br /&gt;
Yes, and if you are using Moodle 2.4 or above you are already using the MUC.&lt;br /&gt;
&lt;br /&gt;
By default MUC uses the file system to store it&#039;s cached objects, this already &lt;br /&gt;
speeds thing up greatly than if there was no MUC at all. By further&lt;br /&gt;
configuring the MUC we are just trying to make it faster.&lt;br /&gt;
&lt;br /&gt;
==What is wrong with the default file-system MUC?==&lt;br /&gt;
&lt;br /&gt;
The MUCs performance is dependant on the read/write speed of it&#039;s storage&lt;br /&gt;
medium. &lt;br /&gt;
&lt;br /&gt;
Typically disks are slow but safe (persistent)  storage. MUC data does not need to kept safe&lt;br /&gt;
as it can always be regenerated so it can afford to be kept somewhere fast vet volatile, like RAM.&lt;br /&gt;
&lt;br /&gt;
==How can I make MUC faster?==&lt;br /&gt;
&lt;br /&gt;
Using a RAM based cache is the best way to make the MUC fast and there a few tools we can use for this, such as, tmpfs, Memcached, APC,&lt;br /&gt;
Redis and overtime probably more... I good place to start if you are unsure of any specific requirements is Memcached as it is common, well tested, fast and easy to deploy.&lt;br /&gt;
&lt;br /&gt;
==How do I deploy Memcached==&lt;br /&gt;
&lt;br /&gt;
This is by no means exhaustive, and will vary depending on your OS etc. But for simplicities sake...&lt;br /&gt;
&lt;br /&gt;
* Install Memcached in a way compatible with your operating system e.g. in Debian/Ubuntu&lt;br /&gt;
  apt-get install memcached&lt;br /&gt;
* Confiure Memcached, or at least become aware of it&#039;s default setup, e.g.&lt;br /&gt;
** 64MB of RAM allocation&lt;br /&gt;
** Runs on port 11211&lt;br /&gt;
* Make sure your PHP has the required support, e.g. in Debian/Ubuntu &lt;br /&gt;
  apt-get install php5-memcached&lt;br /&gt;
* In Moodle go to&lt;br /&gt;
**&#039;Site administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&lt;br /&gt;
**Under &#039;&#039;&#039;Installed cache stores&#039;&#039;&#039; you should see Memcached and an &#039;&#039;&#039;Add instance&#039;&#039;&#039; action. Click &#039;&#039;&#039;Add Instance&#039;&#039;&#039;.&lt;br /&gt;
**Give the store a name, i like &#039;Memcached_MUC&#039;&lt;br /&gt;
**In &#039;&#039;&#039;server&#039;&#039;&#039;, assuming the basic config above,  type &#039;localhost&#039;. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
**Scroll to the bottom of the &#039;&#039;&#039;Cache administration&#039;&#039;&#039; page you were returned to.&lt;br /&gt;
**Under &#039;&#039;&#039;Stores used when no mapping is present&#039;&#039;&#039; click &#039;&#039;&#039;Edit Mappings&#039;&#039;&#039;.&lt;br /&gt;
**In the &#039;&#039;&#039;Application&#039;&#039;&#039; drop down select your caches name. &#039;&#039;&#039;Save Changes&#039;&#039;&#039;.&lt;br /&gt;
* Profit&lt;br /&gt;
&lt;br /&gt;
==How much RAM should I allocate to MUC?==&lt;br /&gt;
Less then you probably think! The default on most Memcached deployments is&lt;br /&gt;
64MB and this is probably &#039;&#039;&#039;more&#039;&#039;&#039; than enough for a pretty standard Moodle&lt;br /&gt;
install. As a real world example, checking a live site with ~6000 individual user&lt;br /&gt;
logins, over the last 24 hours was using 11MB of Memcached MUC (Moodle 2.8 with 26 additional&lt;br /&gt;
plugins).&lt;br /&gt;
&lt;br /&gt;
==I&#039;m already using Memcached for sessions, can I just reuse that?==&lt;br /&gt;
Nope, afraid not. If the MUC purges so will sessions, all your users will be&lt;br /&gt;
logged out. That does not stop you using two memcached instances, one for&lt;br /&gt;
sessions and one MUC. An example of how to do this can be found [https://moopi.mrverrall.co.uk/course/view.php?id=4#section-5 here].&lt;br /&gt;
&lt;br /&gt;
==I have a cluster of servers, &amp;lt;further question here&amp;gt;?==&lt;br /&gt;
&lt;br /&gt;
You are probably beyond the target audience of this FAQ in terms of your system&lt;br /&gt;
administration foo. &lt;br /&gt;
&lt;br /&gt;
==What is that little grey triangle?==&lt;br /&gt;
&lt;br /&gt;
This happens when the default Application Cache does not support a requirement&lt;br /&gt;
of one or more of the &#039;&#039;&#039;cache definitions&#039;&#039;&#039;. Do not panic, it is not important. &lt;br /&gt;
&lt;br /&gt;
For example, of the default application caches only &#039;&#039;&#039;Event Invalidation&#039;&#039;&#039; is not supported&lt;br /&gt;
by Memcached. &lt;br /&gt;
&lt;br /&gt;
Event Invalidation requires &#039;&#039;&#039;Data Guarantee&#039;&#039;&#039;  which ensures data exists in the&lt;br /&gt;
cache once it is put there. It is *never* cleaned up to free space or because&lt;br /&gt;
it has not been recently used. Because (as discussed above/below?) Memcached&lt;br /&gt;
evicts objects form it&#039;s cache it cannot be used Event Invalidation.&lt;br /&gt;
&lt;br /&gt;
The Event Invalidation cache is used to ENSURE events are handled correctly,&lt;br /&gt;
i.e. the objects exist when they are created and don&#039;t only when they are purged,&lt;br /&gt;
this may not occur if the cache object vanishes unexpectedly.&lt;br /&gt;
&lt;br /&gt;
So Event Invalidation will just carry on using the file-system cache (or&lt;br /&gt;
whatever else you tell it too).&lt;br /&gt;
&lt;br /&gt;
==Where can I find more documentation on setting up the MUC?==&lt;br /&gt;
There is some great documemntaion on this site, the [https://docs.moodle.org/310/en/Caching Caching] page is probably your best place to start.&lt;br /&gt;
&lt;br /&gt;
If you are further interested in the nuts and bolts of teh caching system, e.g. cache features (ttl, data guarantee, etc) the [https://github.com/moodle/moodle/blob/master/cache/README.md developers api] is a good place to start.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Talk:Nginx&amp;diff=120108</id>
		<title>Talk:Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Talk:Nginx&amp;diff=120108"/>
		<updated>2015-10-05T15:54:45Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;ve removed the lines from this page instructing users to set the php configuration parameter [http://php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo cgi.fix-pathinfo]=0&lt;br /&gt;
&lt;br /&gt;
This line is included in a lot of on-line how-to guides for Nginx/PHP and is explained as a security restriction, see, [https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/ here] and [http://serverfault.com/questions/627903/is-the-php-option-cgi-fix-pathinfo-really-dangerous-with-nginx-php-fpm here]&lt;br /&gt;
&lt;br /&gt;
In summary, within the context of Nginx and php-fpm the best(?) way to handle potential PATH_INFO vulnerabilities as described in those articles is to use the default behaviour of php-fpm, i.e. within,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/etc/php5/fpm/pool.d/www.conf&#039;&#039;&#039; (debianised)&lt;br /&gt;
 security.limit_extensions = .php&lt;br /&gt;
&lt;br /&gt;
Either way will work just fine, but this is one step less with no real down sides...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Links:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/&amp;lt;br&amp;gt;&lt;br /&gt;
http://serverfault.com/questions/627903/is-the-php-option-cgi-fix-pathinfo-really-dangerous-with-nginx-php-fpm&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119733</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119733"/>
		<updated>2015-09-04T09:30:17Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* PHP-FPM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavours. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendments and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
PHP-FPM&#039;s default behaviour for pools is usually to restrict the execution of scripts to a specific extension, i.e. .php. You should ensure that this behaviour is configured within your particular package/distribution, e.g. for debian,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/etc/php5/fpm/pool.d/www.conf&#039;&#039;&#039;&lt;br /&gt;
 security.limit_extensions = .php&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000 (or your php-fpm socket);&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;&lt;br /&gt;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== XSendfile aka X-Accel-Redirect =====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;; # ensure the path ends with /&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is &#039;&#039;&#039;critical&#039;&#039;&#039; as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=307388&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Talk:Nginx&amp;diff=119732</id>
		<title>Talk:Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Talk:Nginx&amp;diff=119732"/>
		<updated>2015-09-04T09:25:30Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Created page with &amp;quot;I&amp;#039;ve removed the lines from this page instructing users to set the php configuration parameter [http://php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo cgi.fix-pathinfo]=0...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;ve removed the lines from this page instructing users to set the php configuration parameter [http://php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo cgi.fix-pathinfo]=0&lt;br /&gt;
&lt;br /&gt;
This line is included in a lot of on-line how-to guides for Nginx/PHP and is explained as a security restriction, see, [https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/ here] and [http://serverfault.com/questions/627903/is-the-php-option-cgi-fix-pathinfo-really-dangerous-with-nginx-php-fpm here]&lt;br /&gt;
&lt;br /&gt;
In summary, within the context of Nginx and php-fpm the best(?) way to handle potential PATH_INFO vulnerabilities as described in those articles is to use the default behaviour of php-fpm, i.e. within,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;/etc/php5/fpm/pool.d/www.conf&#039;&#039;&#039; (debianised)&lt;br /&gt;
 security.limit_extensions = .php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Links:&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/&amp;lt;br&amp;gt;&lt;br /&gt;
http://serverfault.com/questions/627903/is-the-php-option-cgi-fix-pathinfo-really-dangerous-with-nginx-php-fpm&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119649</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119649"/>
		<updated>2015-08-25T13:55:57Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavours. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendments and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000 (or your php-fpm socket);&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;&lt;br /&gt;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== XSendfile aka X-Accel-Redirect =====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;; # ensure the path ends with /&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is &#039;&#039;&#039;critical&#039;&#039;&#039; as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=307388&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119648</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119648"/>
		<updated>2015-08-25T13:53:49Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: I don&amp;#039;t believe cgi.fix_pathinfo=0 is necessary.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavours. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendments and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000 (or your php-fpm socket);&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;&lt;br /&gt;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== XSendfile aka X-Accel-Redirect =====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;; #make sure the path ends with /&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is important as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=307388&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119647</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=119647"/>
		<updated>2015-08-25T13:50:37Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Fixed spellings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavours. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendments and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
==== php.ini ====&lt;br /&gt;
Typically the php-fpm daemon with have it&#039;s own php.ini e.g. in debian it is /etc/php5/fpm/php.ini. The following setting is required,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;php.ini&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cgi.fix_pathinfo=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
====Slasharguments====&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    # NOTE: You should have &amp;quot;cgi.fix_pathinfo = 0;&amp;quot; in php.ini&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000 (or your php-fpm socket);&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;&lt;br /&gt;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== XSendfile aka X-Accel-Redirect ====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;; #make sure the path ends with /&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is important as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=307388&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118653</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118653"/>
		<updated>2015-05-28T15:58:22Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* server configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendmends and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
==== php.ini ====&lt;br /&gt;
Typically the php-fpm daemon with have it&#039;s own php.ini e.g. in debian it is /etc/php5/fpm/php.ini. The following setting is required,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;php.ini&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cgi.fix_pathinfo=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
====Slasharguments====&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    # NOTE: You should have &amp;quot;cgi.fix_pathinfo = 0;&amp;quot; in php.ini&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000 (or your php-fpm socket);&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;&lt;br /&gt;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== XSendfile aka X-Accel-Redirect ====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is important as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118652</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118652"/>
		<updated>2015-05-28T15:22:58Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendmends and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
==== php.ini ====&lt;br /&gt;
Typically the php-fpm daemon with have it&#039;s own php.ini e.g. in debian it is /etc/php5/fpm/php.ini. The following setting is required,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;php.ini&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cgi.fix_pathinfo=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
==== server configuration ====&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    # NOTE: You should have &amp;quot;cgi.fix_pathinfo = 0;&amp;quot; in php.ini&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000 (or your php-fpm socket);&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;&lt;br /&gt;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== XSendfile aka X-Accel-Redirect ====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is important as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118651</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118651"/>
		<updated>2015-05-28T15:14:46Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Nginx */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendmends and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
==== php.ini ====&lt;br /&gt;
Typically the php-fpm daemon with have it&#039;s own php.ini e.g. in debian it is /etc/php5/fpm/php.ini. The following setting is required,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;php.ini&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cgi.fix_pathinfo=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
==== fcig_params ====&lt;br /&gt;
The standard [http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param fastcgi_params] file included in Nginx is not compatible with moodle; save a new fastcgi_params file with the following parameters,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fastcgi_param QUERY_STRING $query_string;&lt;br /&gt;
fastcgi_param REQUEST_METHOD $request_method;&lt;br /&gt;
fastcgi_param CONTENT_TYPE $content_type;&lt;br /&gt;
fastcgi_param CONTENT_LENGTH $content_length;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param PATH_INFO $fastcgi_path_info;&lt;br /&gt;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;&lt;br /&gt;
fastcgi_param REQUEST_URI $request_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_URI $document_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_ROOT $document_root;&lt;br /&gt;
fastcgi_param SERVER_PROTOCOL $server_protocol;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;&lt;br /&gt;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param REMOTE_ADDR $remote_addr;&lt;br /&gt;
fastcgi_param REMOTE_PORT $remote_port;&lt;br /&gt;
fastcgi_param SERVER_ADDR $server_addr;&lt;br /&gt;
fastcgi_param SERVER_PORT $server_port;&lt;br /&gt;
fastcgi_param SERVER_NAME $server_name;&lt;br /&gt;
&lt;br /&gt;
# PHP only, required if PHP was built with --enable-force-cgi-redirect&lt;br /&gt;
fastcgi_param REDIRECT_STATUS 200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== server configuration ====&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    # NOTE: You should have &amp;quot;cgi.fix_pathinfo = 0;&amp;quot; in php.ini&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== XSendfile aka X-Accel-Redirect ====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is important as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118650</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118650"/>
		<updated>2015-05-28T13:24:37Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendmends and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
==== php.ini ====&lt;br /&gt;
Typically the php-fpm daemon with have it&#039;s own php.ini e.g. in debian it is /etc/php5/fpm/php.ini. The following setting is required,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;php.ini&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cgi.fix_pathinfo=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
==== fcig_params ====&lt;br /&gt;
The standard [http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param fastcgi_params] file included in Nginx is not compatible with moodle; save a new fastcgi_params file with the following parameters,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fastcgi_param QUERY_STRING $query_string;&lt;br /&gt;
fastcgi_param REQUEST_METHOD $request_method;&lt;br /&gt;
fastcgi_param CONTENT_TYPE $content_type;&lt;br /&gt;
fastcgi_param CONTENT_LENGTH $content_length;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;&lt;br /&gt;
fastcgi_param REQUEST_URI $request_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_URI $document_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_ROOT $document_root;&lt;br /&gt;
fastcgi_param SERVER_PROTOCOL $server_protocol;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;&lt;br /&gt;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param REMOTE_ADDR $remote_addr;&lt;br /&gt;
fastcgi_param REMOTE_PORT $remote_port;&lt;br /&gt;
fastcgi_param SERVER_ADDR $server_addr;&lt;br /&gt;
fastcgi_param SERVER_PORT $server_port;&lt;br /&gt;
fastcgi_param SERVER_NAME $server_name;&lt;br /&gt;
&lt;br /&gt;
# PHP only, required if PHP was built with --enable-force-cgi-redirect&lt;br /&gt;
fastcgi_param REDIRECT_STATUS 200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== server configuration ====&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    # NOTE: You should have &amp;quot;cgi.fix_pathinfo = 0;&amp;quot; in php.ini&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== XSendfile aka X-Accel-Redirect ====&lt;br /&gt;
&lt;br /&gt;
Setting Moodle and Nginx to use XSendfile functionality is a big win as it frees PHP from delivering files allowing Nginx to do what it does best, i.e. deliver files. &lt;br /&gt;
&lt;br /&gt;
Enable xsendfile for Nginx in Moodles config.php, this is documented in the config-dist.php, a minimal configuration look like this,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;&lt;br /&gt;
$CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
    &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Accompany this with a matching &#039;location&#039; block in your nginx server configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location /dataroot/ {&lt;br /&gt;
    internal;&lt;br /&gt;
    alias &amp;amp;lt;full_moodledata_path&amp;amp;gt;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The definition of &#039;internal&#039; here is important as it prevents client access to your dataroot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* Real &amp;lt;tt&amp;gt;PATH_INFO&amp;lt;/tt&amp;gt; support:&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=278916&lt;br /&gt;
* Internal rewriting to the HTTP GET &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
** https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
** https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=User_talk:Paul_Verrall&amp;diff=118621</id>
		<title>User talk:Paul Verrall</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=User_talk:Paul_Verrall&amp;diff=118621"/>
		<updated>2015-05-22T09:42:47Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=User:Paul_Verrall&amp;diff=118620</id>
		<title>User:Paul Verrall</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=User:Paul_Verrall&amp;diff=118620"/>
		<updated>2015-05-22T09:41:33Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: Created page with &amp;quot;I&amp;#039;m the systems administrator at Lancaster University Network Services. I work a lot with Moodle day to day but mostly on the nuts and bolts of keeping things running smoothly...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m the systems administrator at Lancaster University Network Services. I work a lot with Moodle day to day but mostly on the nuts and bolts of keeping things running smoothly rather than actually logging into a Moodle site.&lt;br /&gt;
&lt;br /&gt;
Asides from being a professional geek I also enjoy craft beers and all types of whisky of which I have many bottles.&lt;br /&gt;
&lt;br /&gt;
I run a small moodle site at [http://moopi.mrverrall.co.uk moopi.mrverrall.co.uk] to try and help dispel the myth that Moodle needs lots of server resources to run effectively.&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118618</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118618"/>
		<updated>2015-05-21T15:51:34Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendmends and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
Nginx is usually configured to interface with PHP via [http://php.net/manual/en/install.fpm.php php-fpm]. This is both fast and robust.&lt;br /&gt;
&lt;br /&gt;
==== php.ini ====&lt;br /&gt;
Typically the php-fpm daemon with have it&#039;s own php.ini e.g. in debian it is /etc/php5/fpm/php.ini. The following setting is required,&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;php.ini&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cgi.fix_pathinfo=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Nginx ===&lt;br /&gt;
&lt;br /&gt;
==== fcig_params ====&lt;br /&gt;
The standard [http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param fastcgi_params] file included in Nginx is not compatible with moodle; save a new fastcgi_params file with the following parameters,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fastcgi_param QUERY_STRING $query_string;&lt;br /&gt;
fastcgi_param REQUEST_METHOD $request_method;&lt;br /&gt;
fastcgi_param CONTENT_TYPE $content_type;&lt;br /&gt;
fastcgi_param CONTENT_LENGTH $content_length;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;&lt;br /&gt;
fastcgi_param REQUEST_URI $request_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_URI $document_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_ROOT $document_root;&lt;br /&gt;
fastcgi_param SERVER_PROTOCOL $server_protocol;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;&lt;br /&gt;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param REMOTE_ADDR $remote_addr;&lt;br /&gt;
fastcgi_param REMOTE_PORT $remote_port;&lt;br /&gt;
fastcgi_param SERVER_ADDR $server_addr;&lt;br /&gt;
fastcgi_param SERVER_PORT $server_port;&lt;br /&gt;
fastcgi_param SERVER_NAME $server_name;&lt;br /&gt;
&lt;br /&gt;
# PHP only, required if PHP was built with --enable-force-cgi-redirect&lt;br /&gt;
fastcgi_param REDIRECT_STATUS 200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== server configuration ====&lt;br /&gt;
Add the following &#039;slash arguments&#039; compatible (see [[Using slash arguments]]) &#039;location&#039; block to your vhosts &#039;server&#039; configuration in your nginx configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    # NOTE: You should have &amp;quot;cgi.fix_pathinfo = 0;&amp;quot; in php.ini&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
* https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118617</id>
		<title>Nginx</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Nginx&amp;diff=118617"/>
		<updated>2015-05-21T15:26:49Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: /* Slasharguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}[[Nginx]] [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is community-contributed documentation on Nginx configuration. Amendmends and additions are welcome.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Nginx configuration ==&lt;br /&gt;
&lt;br /&gt;
=== FastCGI ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fastcgi_param QUERY_STRING $query_string;&lt;br /&gt;
fastcgi_param REQUEST_METHOD $request_method;&lt;br /&gt;
fastcgi_param CONTENT_TYPE $content_type;&lt;br /&gt;
fastcgi_param CONTENT_LENGTH $content_length;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;&lt;br /&gt;
fastcgi_param REQUEST_URI $request_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_URI $document_uri;&lt;br /&gt;
fastcgi_param DOCUMENT_ROOT $document_root;&lt;br /&gt;
fastcgi_param SERVER_PROTOCOL $server_protocol;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;&lt;br /&gt;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;&lt;br /&gt;
&lt;br /&gt;
fastcgi_param REMOTE_ADDR $remote_addr;&lt;br /&gt;
fastcgi_param REMOTE_PORT $remote_port;&lt;br /&gt;
fastcgi_param SERVER_ADDR $server_addr;&lt;br /&gt;
fastcgi_param SERVER_PORT $server_port;&lt;br /&gt;
fastcgi_param SERVER_NAME $server_name;&lt;br /&gt;
&lt;br /&gt;
# PHP only, required if PHP was built with --enable-force-cgi-redirect&lt;br /&gt;
fastcgi_param REDIRECT_STATUS 200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slasharguments ===&lt;br /&gt;
&lt;br /&gt;
The function &#039;&#039;slash arguments&#039;&#039; is required for various features in Moodle to work correctly, as described in [[Using slash arguments]].&lt;br /&gt;
&lt;br /&gt;
In combination with the compatible fcgi_params above the following nginx configuration is compatible with slash arguments.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;nginx.conf location:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
location ~ [^/]\.php(/|$) {&lt;br /&gt;
    # NOTE: You should have &amp;quot;cgi.fix_pathinfo = 0;&amp;quot; in php.ini&lt;br /&gt;
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;&lt;br /&gt;
    include                  fastcgi_params;&lt;br /&gt;
    fastcgi_index            index.php;&lt;br /&gt;
    fastcgi_pass             127.0.0.1:9000;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* https://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm&lt;br /&gt;
* https://moodle.org/mod/forum/discuss.php?d=83445&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Nginx]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Upload_users&amp;diff=115238</id>
		<title>Upload users</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Upload_users&amp;diff=115238"/>
		<updated>2014-10-15T07:21:52Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Accounts}}&lt;br /&gt;
An administrator can upload multiple user accounts via text file in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Accounts &amp;gt; Upload users&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There are many robust options for uploading information (fields associated with a user) with this method: from enrolling users in multiple courses with course specific [[Roles|roles]] to updating user information in the [[User profile]] to deleting users from the site.&lt;br /&gt;
&lt;br /&gt;
Rather than uploading the text file, it can simply dragged from the desktop and dropped into the upload area, as demonstrated in the screencast [http://youtu.be/6E-TQXTkZB0 Drag and drop new users into Moodle 2.3] (by Mary Cooch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tip:&#039;&#039; It is usually not necessary to upload users in bulk with Upload users.  To keep maintenance work down you should first explore forms of authentication that do not require manual maintenance, such as [[External database authentication|connecting to existing external databases]] or letting the users create their own accounts ([[Self enrolment]]). See [[Authentication]] for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:uploadusersnew.png|thumb|500px|center|Initial upload users screen]]&lt;br /&gt;
&lt;br /&gt;
==Upload user process==&lt;br /&gt;
Here is an outline of the process:&lt;br /&gt;
&lt;br /&gt;
# Create file for uploading&lt;br /&gt;
# Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Accounts &amp;gt; Upload users&#039;&#039;&lt;br /&gt;
# Add file to upload&lt;br /&gt;
# Upload users preview - check settings and default user profile settings&lt;br /&gt;
# Upload users preview - click &amp;quot;Upload users&amp;quot;&lt;br /&gt;
# Upload users results - shows list of users, exceptions made in upload and summary of number of users&lt;br /&gt;
# Upload users results - click &amp;quot;Continue&amp;quot;&lt;br /&gt;
# Returns to Upload users screen&lt;br /&gt;
&lt;br /&gt;
==Updating users preview==&lt;br /&gt;
There are settings for the kind of Upload user function you want to perform on the &amp;quot;Upload users preview&amp;quot; page.&lt;br /&gt;
[[File:Upload users preview 2.0.JPG|thumb|center|Upload users preview in Moodle 2.x]]&lt;br /&gt;
&lt;br /&gt;
===Updating existing accounts===&lt;br /&gt;
&lt;br /&gt;
By default Moodle adds new user accounts and skips existing users lines where the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; matches an existing account. Set &amp;quot;Upload Type&amp;quot; to &#039;&#039;&#039;Add  new and update existing users&#039;&#039;&#039;, and existing user account will be updated.&lt;br /&gt;
*Add all, append number to usernames if needed&lt;br /&gt;
*Add new and update existing users&lt;br /&gt;
*Update existing users only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: errors updating existing accounts can affect your users badly. Be careful when using the options to update.&lt;br /&gt;
&lt;br /&gt;
===Additional Options===&lt;br /&gt;
&lt;br /&gt;
There are also fields settings to force password change, allow renames, allow deletes, prevent email address duplicates, standardise usernames and select for bulk operations(new users. updated users, all users).&lt;br /&gt;
&lt;br /&gt;
*Standardise usernames - This folds username to lowercase and strips out illegal characters.  This is roughly equivalent to: &lt;br /&gt;
&lt;br /&gt;
  $username = preg_replace(&#039;/[^-\.@_a-z0-9]/&#039;, &#039;&#039;, $username);&lt;br /&gt;
&lt;br /&gt;
===Set default user values===&lt;br /&gt;
&lt;br /&gt;
You may be able to set default user field values, if the fields were not included in the uploaded file on this page.&lt;br /&gt;
&lt;br /&gt;
==Upload user results ==&lt;br /&gt;
After accepting the preview settings by clicking on &amp;quot;Upload users&amp;quot;, you should see the the Upload users results screen.&lt;br /&gt;
[[File:Upload users results 2.0.JPG|thumb|center|The results screen; everything went well!]]&lt;br /&gt;
This screen will show you any exceptions or changes that were made to each user in the upload process.   For example if you were updating user information, the updated information will be shown.  Or if a user was not added that record will be highlighted.&lt;br /&gt;
&lt;br /&gt;
The screen will summarize how many users were uploaded or updated, indicate the number of weak passwords and the number of errors.&lt;br /&gt;
&lt;br /&gt;
==File formats for upload users file==&lt;br /&gt;
The upload users file has fields separated by a comma (or other delimiter) ONLY - no space.   The first line contains the valid field names.  The rest of the lines (records) contain information about each user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;:Tip:&#039;&#039; Avoid special characters in field information like quotes or other commas. Test a file with only one record before a large upload. Remember there are other ways to authenticate users on you site or enroll users in a course.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;:Tip:&#039;&#039; You can use a spread sheet program to create the file with the required columns and fields. Then save the file as &amp;quot;CSV (comma delimited)&amp;quot;. These files can be opened with simple text editors for verification. &lt;br /&gt;
&lt;br /&gt;
===Valid upload file for testing===&lt;br /&gt;
Here is an example of a simple valid upload file:&lt;br /&gt;
(Column headers on the first line of the file are only highlighted in bold in this example to distinguish it from the rest of the of the data/user details)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;username,password,firstname,lastname,email,course1,group1,cohort1&#039;&#039;&#039;&lt;br /&gt;
 jonest,verysecret,Tom,Jones,jonest@someplace.edu,math102,Section 1,year 3&lt;br /&gt;
 reznort,somesecret,Trent,Reznor,reznort@someplace.edu,math102,Section 3,year 4&lt;br /&gt;
&lt;br /&gt;
===Fields that can be included===&lt;br /&gt;
&#039;&#039;:Tip:&#039;&#039; We strongly recommend that you test a file that contains fields you proposed to use with one user before attempting a file upload for the first time.  http://demo.moodle.net might be a good place to see if your test file works.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Required fields&#039;&#039;&#039;: &lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;username,firstname,lastname,email&amp;lt;/code&amp;gt;&lt;br /&gt;
:Validity checks are performed for:&lt;br /&gt;
#&amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; can only contain alphabetical &#039;&#039;&#039;lowercase&#039;&#039;&#039; letters , numbers, hypen &#039;-&#039;, underscore &#039;_&#039;, period &#039;.&#039;, or at-sign &#039;@&#039; &lt;br /&gt;
#&amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; is in the form: &#039;&#039;name@example.com&#039;&#039; .&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Password field&#039;&#039;&#039;: &amp;quot;password&amp;quot; field is optional if &amp;quot;Create password if needed&amp;quot; setting is chosen (default). &lt;br /&gt;
**If included, values should meet the requirements for the site&#039;s [[Site_policies#Password_policy|Password policy]]. To force password change for a particular user, set the password field to &amp;lt;code&amp;gt;changeme&amp;lt;/code&amp;gt;. &lt;br /&gt;
**If omitted, a password will be generated for each user (during the next Cron job) and welcome e-mails sent out.&lt;br /&gt;
**Note: the text for the welcome e-mail is in the language settings. Please refer to this [https://moodle.org/mod/forum/discuss.php?d=210359&amp;amp;parent=917138 forum thread]for details.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Optional fields&#039;&#039;&#039;: To provide values other than the default include one or more of these&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;institution,department,city,country,lang,auth,timezone,idnumber,icq,phone1,phone2,address,url,description,mailformat,maildisplay,htmleditor,autosubscribe&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Additional name fields]]&#039;&#039;&#039;&lt;br /&gt;
*Country- use a country TWO LETTER CODE&lt;br /&gt;
*Some fields have a maximum number of characters that are allowed (notably institution should be &#039;&#039;&#039;at most 40 characters&#039;&#039;&#039; long).  See hints below.&lt;br /&gt;
*Maildisplay, htmleditor and autosubscribe can be set from an import screen.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Custom profile field names&#039;&#039;&#039;: (Optional). xxxxx is the real custom user profile field name (i.e. the unique shortname)&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;profile_field_xxxxx&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
: Create the custom fields BEFORE importing. Use the standard header. The &amp;quot;shortname&amp;quot; for your custom field is xxxxx (NB the shortname must be all lowercase, otherwise won&#039;t be recognised). The first record must include &amp;quot;profile_field_xxxxx&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
:&#039;&#039;&#039;Example&#039;&#039;&#039;: To create a custom field &amp;quot;genre&amp;quot;, you must write a shortname &amp;quot;genre&amp;quot; in the new field, and write &amp;quot;profile_field_genre&amp;quot; in the header of the .csv file.&lt;br /&gt;
&lt;br /&gt;
: For custom profile fields that are a menu, use the corresponding value (new in Moodle 2.3 onwards).&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Example&#039;&#039;&#039;: A custom field &#039;Department&#039; with one of three values &#039;HR&#039;, &#039;Marketing&#039; or &#039;Training&#039;. Just insert one of those three words (e.g. &#039;Training&#039;) as the value for that field. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Special fields&#039;&#039;&#039;: Used for changing of usernames or deleting of users&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*&#039;&#039;&#039;Enrolment fields&#039;&#039;&#039;: (Optional):&lt;br /&gt;
:&amp;lt;code&amp;gt;course1,type1,role1,group1,enrolperiod1,enrolstatus1,course2,type2,role2,group2,enrolperiod2,enrolstatus2&amp;lt;/code&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
:* Header fields must have a numeric suffix such that &amp;lt;code&amp;gt;type1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;role1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;group1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;enrolperiod1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enrolstatus1&amp;lt;/code&amp;gt; all apply to &amp;lt;code&amp;gt;course1&amp;lt;/code&amp;gt; for course&amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; to course&amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
:*&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; is the &amp;quot;shortname&amp;quot; of the course, if present the user will be enrolled in that course.&lt;br /&gt;
:* &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; sets the role to be used for the enrolment. A value of &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; is default course role, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;  is legacy Teacher role and &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; is legacy Non-editing Teacher.&lt;br /&gt;
:* &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; may be used to specify roles directly, using either role short name or id (numeric names of roles are not supported).&lt;br /&gt;
:* &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; may be used to assign users to groups in course, using name or id (numeric group names are not supported)&lt;br /&gt;
:* &amp;lt;code&amp;gt;enrolperiod&amp;lt;/code&amp;gt; may be used to set the enrolment duration, in days, for each course.&lt;br /&gt;
:* &amp;lt;code&amp;gt;enrolstatus&amp;lt;/code&amp;gt; can suspend users from a course when set to 1 or left blank for enrolled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Cohort field&#039;&#039;&#039;: (Optional):&lt;br /&gt;
:&amp;lt;code&amp;gt;cohort1&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
:Internal cohort id numbers or non-numeric Cohort IDs of existing cohorts must be used; names are not allowed.&lt;br /&gt;
*&#039;&#039;&#039;mnethostid&#039;&#039;&#039; (Optional)&lt;br /&gt;
&lt;br /&gt;
Existing [[MNet]]users can be added to courses, groups or cohorts as below:&lt;br /&gt;
#enrolling to courses: username+mnethostid+course required&lt;br /&gt;
# adding to group: username+mnethostid+course+group required&lt;br /&gt;
#adding to cohort: username+mnethostid+cohort required&lt;br /&gt;
#suspending/reviving accounts: username+mnethostid+suspended required&lt;br /&gt;
All other operations are ignored. You can not add users, delete them or update them (such as change names or email, profile fields, etc.)&lt;br /&gt;
&lt;br /&gt;
Commas within  a field must be encoded as &amp;amp;#44 - the script will decode these back to commas.&lt;br /&gt;
&lt;br /&gt;
For Boolean fields, use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for false and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for true.&lt;br /&gt;
&lt;br /&gt;
To prevent users from receiving a large number of emails from courses or forced subscription forums use the &#039;&#039;&#039;maildigest&#039;&#039;&#039;.  The options for this field are 0 = No digest, 1 = Complete digest and 2 = Digest with just subjects.&lt;br /&gt;
&lt;br /&gt;
==Advanced potentials of Upload user==&lt;br /&gt;
===Templates===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: This section needs checking and updating if necessary for Moodle 2.0. Please do so and remove this note when finished.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The default values are processed as templates in which the following codes are allowed:&lt;br /&gt;
&lt;br /&gt;
* %l - will be replaced by the lastname&lt;br /&gt;
* %f - will be replaced by the firstname&lt;br /&gt;
* %u - will be replaced by the username&lt;br /&gt;
* %% - will be replaced by the %&lt;br /&gt;
&lt;br /&gt;
Between the percent sign (%) and any code letter (l, f or u) the following modifiers are allowed:&lt;br /&gt;
&lt;br /&gt;
* (-) minus sign - the information specified by the code letter will be converted to lowercase&lt;br /&gt;
* (+) plus sign - the information specified by the code letter will be converted to UPPERCASE&lt;br /&gt;
* (~) tilde sign - the information specified by the code letter will be converted to Title Case&lt;br /&gt;
* a decimal number - the information specified by the code letter will be truncated to that many characters&lt;br /&gt;
&lt;br /&gt;
For example, if the firstname is John and the lastname is Doe, the following values will be obtained with the specified templates:&lt;br /&gt;
&lt;br /&gt;
* %l%f = DoeJohn&lt;br /&gt;
* %l%1f = DoeJ&lt;br /&gt;
* %-l%+f = doeJOHN&lt;br /&gt;
* %-f_%-l = john_doe&lt;br /&gt;
*&amp;lt;nowiki&amp;gt; http://www.example.com/~%u/&amp;lt;/nowiki&amp;gt; results in  &amp;lt;nowiki&amp;gt;http://www.example.com/~jdoe/&amp;lt;/nowiki&amp;gt; (if the username is jdoe or %-1f%-l)&lt;br /&gt;
&lt;br /&gt;
Template processing is done only on default values, and not on the values retrieved from the CSV file.&lt;br /&gt;
&lt;br /&gt;
In order to create correct Moodle usernames, the username is always converted to lowercase. Moreover, if the &amp;quot;Allow extended characters in usernames&amp;quot; option in the Site policies page is off, characters different to letters, digits, dash (-) and dot (.) are removed. For example if the firstname is John Jr. and the lastname is Doe, the username %-f_%-l will produce john jr._doe when Allow extended characters in usernames is on, and johnjr.doe when off.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;New username duplicate handling&amp;quot; setting is set to Append counter, an auto-increment counter will be append to duplicate usernames produced by the template. For example, if the CSV file contains the users named John Doe, Jane Doe and Jenny Doe without explicit usernames, the default username is %-1f%-l and New username duplicate handling is set to Append counter, then the usernames produced will be jdoe, jdoe2 and jdoe3.&lt;br /&gt;
&lt;br /&gt;
===Deleting accounts===&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; field is present, users with value 1 for it will be deleted. In this case, all the fields may be omitted, except for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. After uploading the file, be sure to change the &amp;quot;Upload type&amp;quot; to &amp;quot;Update existing users only&amp;quot; and the &amp;quot;Allow deletes&amp;quot; option to &amp;quot;Yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039;  A similar field is available for &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt;. This enables a user account to be temporarily disabled rather than completely removed.&lt;br /&gt;
&lt;br /&gt;
Deleting and uploading accounts could be done with a single CSV file. For example, the following file will add the user Tom Jones and delete the user reznort:&lt;br /&gt;
&lt;br /&gt;
 username,firstname,lastname,deleted&lt;br /&gt;
 jonest,Tom,Jones,0&lt;br /&gt;
 reznort,,,1&lt;br /&gt;
&lt;br /&gt;
==Encoding file format==&lt;br /&gt;
On the initial Upload user screen, you may select the file encoding format from a pull down list.  These include UTF-8 (the default), ASCII,  ISO-8859-1 to ISO-8859-11 or any one of over 36 formats.&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
&lt;br /&gt;
===Spreadsheet===&lt;br /&gt;
&lt;br /&gt;
If you use a spreadsheet program such as Excel to create your .csv file, check the resulting output in a text editor before you upload it.  It is possible to get trailing commas on each line from an empty field if you have added and deleted columns of information prior to saving the final file. Also check the character encoding. A csv file is a simple text file (ASCII or Unicode) that can be used to upload user accounts.&lt;br /&gt;
&lt;br /&gt;
Excel translates passwords that begin with - (minus) or + (plus) as zero. Even when saving as .csv and saying &amp;quot;Yes&amp;quot; to &amp;quot;Keep this format, and leave out any incompatible features.&amp;quot; Check for this before uploading, as a zero halts the upload process.&lt;br /&gt;
&lt;br /&gt;
If you use a formula in Excel to create fields (for example, the concatenate function to create a user name), then remember to copy the cells with the formula and use special paste with values checked to make them into an acceptable data for a csv file.&lt;br /&gt;
&lt;br /&gt;
The upload will also fail if you have trailing spaces at the end of your data fields. Often, this can not be removed with a simple Find &amp;quot; &amp;quot; and Replace with &amp;quot;&amp;quot;. If information has been copied from web sources than it is possible to include non-breaking spaces which will prevent your upload from being completed correctly. To find these invisible spaces, use the Find and Replace function in Excel. In the find field, hold alt and type 0160. Leave the replace field blank. &lt;br /&gt;
&lt;br /&gt;
===Country===&lt;br /&gt;
The country should be written as a two letter code, in capitals. For example, use BE for Belgium or NL for the Netherlands.  Using &amp;quot;be&amp;quot; or &amp;quot;nl&amp;quot; as a country code will result in a database error.&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039;  If you are having trouble working out the two-letter code for a country, you can consult the list of [http://www.iso.org/iso/country_names_and_code_elements country names and code elements] available on the ISO Website. A common error is to use UK for United Kingdom; it should be GB.&lt;br /&gt;
&lt;br /&gt;
===Field size limits===&lt;br /&gt;
Some fields have maximum character lengths.  Typically the file will import to the preview list screen but not finish the process.  Turn on debug to see the fields that are too long.  Common fields to cause problems are &amp;quot;Institution&amp;quot; which is limited to 40 characters, and &amp;quot;City&amp;quot;, also limited (20 characters).  The error will be &amp;quot;User not added - error&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Time zones===&lt;br /&gt;
&lt;br /&gt;
The entry is case sensitive so Europe/London will work but europe/london will not.&lt;br /&gt;
&lt;br /&gt;
===All fields listed here===&lt;br /&gt;
:All the fields that are valid are listed below, except for any custom fields you may have created. &lt;br /&gt;
firstname, lastname, username, email, city, country, lang, timezone, mailformat, maildisplay, maildigest, htmleditor, ajax, autosubscribe ,institution, department, idnumber, skype , msn, aim, yahoo, icq, phone1, phone2, address, url, description, descriptionformat, password, auth, oldusername , deleted, suspended, course1, course2, course3, course4&lt;br /&gt;
&lt;br /&gt;
===Enroll users to Cohorts (system groups)===&lt;br /&gt;
You can enroll users to any Cohort (system level group) by using only the &amp;quot;username&amp;quot; and the &amp;quot;Cohort ID&amp;quot;.&lt;br /&gt;
Here is a sample CSV file:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;username,cohort1&#039;&#039;&#039;&lt;br /&gt;
 teacher1,system-teachers&lt;br /&gt;
 teacher2,system-teachers&lt;br /&gt;
 teacher3,system-teachers&lt;br /&gt;
&lt;br /&gt;
Make sure you set &amp;quot;Upload type&amp;quot; to &amp;quot;Update existing users only&amp;quot; (So you are not asked to add firstname, lastname and email fields too)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://youtu.be/PFGLZnuu_JI Adding users by using a CSV in Moodle]  MoodleBites video on YouTube&lt;br /&gt;
*[[Flat file]] enrolment&lt;br /&gt;
* [[User profile fields]] for details of how to include data about custom user profile fields in the upload users file&lt;br /&gt;
* [[Upload courses]]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=36851 Can I auto enroll from Excel?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97903 Uploading users to custom roles]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=181259 User upload option: standardise usernames]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=144569 Matriculacion con flat file csv] - discussion in Spanish&lt;br /&gt;
&lt;br /&gt;
[[fr:Importer des utilisateurs]]&lt;br /&gt;
[[ja:ユーザのアップロード]]&lt;br /&gt;
[[de:Nutzerliste hochladen]]&lt;br /&gt;
[[es:Subir usuarios]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Upload_users&amp;diff=115233</id>
		<title>Upload users</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Upload_users&amp;diff=115233"/>
		<updated>2014-10-14T14:43:39Z</updated>

		<summary type="html">&lt;p&gt;Mrverrall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Accounts}}&lt;br /&gt;
An administrator can upload multiple user accounts via text file in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Accounts &amp;gt; Upload users&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There are many robust options for uploading information (fields associated with a user) with this method: from enrolling users in multiple courses with course specific [[Roles|roles]] to updating user information in the [[User profile]] to deleting users from the site.&lt;br /&gt;
&lt;br /&gt;
Rather than uploading the text file, it can simply dragged from the desktop and dropped into the upload area, as demonstrated in the screencast [http://youtu.be/6E-TQXTkZB0 Drag and drop new users into Moodle 2.3] (by Mary Cooch).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tip:&#039;&#039; It is usually not necessary to upload users in bulk with Upload users.  To keep maintenance work down you should first explore forms of authentication that do not require manual maintenance, such as [[External database authentication|connecting to existing external databases]] or letting the users create their own accounts ([[Self enrolment]]). See [[Authentication]] for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:uploadusersnew.png|thumb|500px|center|Initial upload users screen]]&lt;br /&gt;
&lt;br /&gt;
==Upload user process==&lt;br /&gt;
Here is an outline of the process:&lt;br /&gt;
&lt;br /&gt;
# Create file for uploading&lt;br /&gt;
# Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Accounts &amp;gt; Upload users&#039;&#039;&lt;br /&gt;
# Add file to upload&lt;br /&gt;
# Upload users preview - check settings and default user profile settings&lt;br /&gt;
# Upload users preview - click &amp;quot;Upload users&amp;quot;&lt;br /&gt;
# Upload users results - shows list of users, exceptions made in upload and summary of number of users&lt;br /&gt;
# Upload users results - click &amp;quot;Continue&amp;quot;&lt;br /&gt;
# Returns to Upload users screen&lt;br /&gt;
&lt;br /&gt;
==Updating users preview==&lt;br /&gt;
There are settings for the kind of Upload user function you want to perform on the &amp;quot;Upload users preview&amp;quot; page.&lt;br /&gt;
[[File:Upload users preview 2.0.JPG|thumb|center|Upload users preview in Moodle 2.x]]&lt;br /&gt;
&lt;br /&gt;
===Updating existing accounts===&lt;br /&gt;
&lt;br /&gt;
By default Moodle adds new user accounts and skips existing users lines where the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; matches an existing account. Set &amp;quot;Upload Type&amp;quot; to &#039;&#039;&#039;Add  new and update existing users&#039;&#039;&#039;, and existing user account will be updated.&lt;br /&gt;
*Add all, append number to usernames if needed&lt;br /&gt;
*Add new and update existing users&lt;br /&gt;
*Update existing users only&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: errors updating existing accounts can affect your users badly. Be careful when using the options to update.&lt;br /&gt;
&lt;br /&gt;
===Additional Options===&lt;br /&gt;
&lt;br /&gt;
There are also fields settings to force password change, allow renames, allow deletes, prevent email address duplicates, standardise usernames and select for bulk operations(new users. updated users, all users).&lt;br /&gt;
&lt;br /&gt;
*Standardise usernames - This folds username to lowercase and strips out illegal characters.  This is roughly equivalent to: &lt;br /&gt;
&lt;br /&gt;
  $username = preg_replace(&#039;/[^-\.@_a-z0-9]/&#039;, &#039;&#039;, $username);&lt;br /&gt;
&lt;br /&gt;
===Set default user values===&lt;br /&gt;
&lt;br /&gt;
You may be able to set default user field values, if the fields were not included in the uploaded file on this page.&lt;br /&gt;
&lt;br /&gt;
==Upload user results ==&lt;br /&gt;
After accepting the preview settings by clicking on &amp;quot;Upload users&amp;quot;, you should see the the Upload users results screen.&lt;br /&gt;
[[File:Upload users results 2.0.JPG|thumb|center|The results screen; everything went well!]]&lt;br /&gt;
This screen will show you any exceptions or changes that were made to each user in the upload process.   For example if you were updating user information, the updated information will be shown.  Or if a user was not added that record will be highlighted.&lt;br /&gt;
&lt;br /&gt;
The screen will summarize how many users were uploaded or updated, indicate the number of weak passwords and the number of errors.&lt;br /&gt;
&lt;br /&gt;
==File formats for upload users file==&lt;br /&gt;
The upload users file has fields separated by a comma (or other delimiter) ONLY - no space.   The first line contains the valid field names.  The rest of the lines (records) contain information about each user.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;:Tip:&#039;&#039; Avoid special characters in field information like quotes or other commas. Test a file with only one record before a large upload. Remember there are other ways to authenticate users on you site or enroll users in a course.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;:Tip:&#039;&#039; You can use a spread sheet program to create the file with the required columns and fields. Then save the file as &amp;quot;CSV (comma delimited)&amp;quot;. These files can be opened with simple text editors for verification. &lt;br /&gt;
&lt;br /&gt;
===Valid upload file for testing===&lt;br /&gt;
Here is an example of a simple valid upload file:&lt;br /&gt;
(Column headers on the first line of the file are only highlighted in bold in this example to distinguish it from the rest of the of the data/user details)&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;username,password,firstname,lastname,email,course1,group1,cohort1&#039;&#039;&#039;&lt;br /&gt;
 jonest,verysecret,Tom,Jones,jonest@someplace.edu,math102,Section 1,year 3&lt;br /&gt;
 reznort,somesecret,Trent,Reznor,reznort@someplace.edu,math102,Section 3,year 4&lt;br /&gt;
&lt;br /&gt;
===Fields that can be included===&lt;br /&gt;
&#039;&#039;:Tip:&#039;&#039; We strongly recommend that you test a file that contains fields you proposed to use with one user before attempting a file upload for the first time.  http://demo.moodle.net might be a good place to see if your test file works.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Required fields&#039;&#039;&#039;: &lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;username,firstname,lastname,email&amp;lt;/code&amp;gt;&lt;br /&gt;
:Validity checks are performed for:&lt;br /&gt;
#&amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; can only contain alphabetical &#039;&#039;&#039;lowercase&#039;&#039;&#039; letters , numbers, hypen &#039;-&#039;, underscore &#039;_&#039;, period &#039;.&#039;, or at-sign &#039;@&#039; &lt;br /&gt;
#&amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; is in the form: &#039;&#039;name@example.com&#039;&#039; .&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Password field&#039;&#039;&#039;: &amp;quot;password&amp;quot; field is optional if &amp;quot;Create password if needed&amp;quot; setting is chosen (default). &lt;br /&gt;
**If included, values should meet the requirements for the site&#039;s [[Site_policies#Password_policy|Password policy]]. To force password change for a particular user, set the password field to &amp;lt;code&amp;gt;changeme&amp;lt;/code&amp;gt;. &lt;br /&gt;
**If omitted, a password will be generated for each user (during the next Cron job) and welcome e-mails sent out.&lt;br /&gt;
**Note: the text for the welcome e-mail is in the language settings. Please refer to this [https://moodle.org/mod/forum/discuss.php?d=210359&amp;amp;parent=917138 forum thread]for details.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Optional fields&#039;&#039;&#039;: To provide values other than the default include one or more of these&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;institution,department,city,country,lang,auth,timezone,idnumber,icq,phone1,phone2,address,url,description,mailformat,maildisplay,htmleditor,autosubscribe&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Additional name fields]]&#039;&#039;&#039;&lt;br /&gt;
*Country- use a country TWO LETTER CODE&lt;br /&gt;
*Some fields have a maximum number of characters that are allowed (notably institution should be &#039;&#039;&#039;at most 40 characters&#039;&#039;&#039; long).  See hints below.&lt;br /&gt;
*Maildisplay, htmleditor and autosubscribe can be set from an import screen.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Custom profile field names&#039;&#039;&#039;: (Optional). xxxxx is the real custom user profile field name (i.e. the unique shortname)&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;profile_field_xxxxx&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
: Create the custom fields BEFORE importing. Use the standard header. The &amp;quot;shortname&amp;quot; for your custom field is xxxxx (NB the shortname must be all lowercase, otherwise won&#039;t be recognised). The first record must include &amp;quot;profile_field_xxxxx&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
:&#039;&#039;&#039;Example&#039;&#039;&#039;: To create a custom field &amp;quot;genre&amp;quot;, you must write a shortname &amp;quot;genre&amp;quot; in the new field, and write &amp;quot;profile_field_genre&amp;quot; in the header of the .csv file.&lt;br /&gt;
&lt;br /&gt;
: For custom profile fields that are a menu, use the corresponding value (new in Moodle 2.3 onwards).&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Example&#039;&#039;&#039;: A custom field &#039;Department&#039; with one of three values &#039;HR&#039;, &#039;Marketing&#039; or &#039;Training&#039;. Just insert one of those three words (e.g. &#039;Training&#039;) as the value for that field. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Special fields&#039;&#039;&#039;: Used for changing of usernames or deleting of users&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*&#039;&#039;&#039;Enrolment fields&#039;&#039;&#039;: (Optional):&lt;br /&gt;
:&amp;lt;code&amp;gt;course1,type1,role1,group1,enrolperiod1,enrolstatus1,course2,type2,role2,group2,enrolperiod2,enrolstatus2&amp;lt;/code&amp;gt; etc.&lt;br /&gt;
&lt;br /&gt;
:* Header fields must have a numeric suffix such that &amp;lt;code&amp;gt;type1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;role1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;group1&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;enrolperiod1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enrolstatus1&amp;lt;/code&amp;gt; all apply to &amp;lt;code&amp;gt;course1&amp;lt;/code&amp;gt; for course&amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; to course&amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
:*&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; is the &amp;quot;shortname&amp;quot; of the course, if present the user will be enrolled in that courses.&lt;br /&gt;
:* &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; sets the role to be used for the enrolment. A value of &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; is default course role, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;  is legacy Teacher role and &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; is legacy Non-editing Teacher.&lt;br /&gt;
:* &amp;lt;code&amp;gt;role&amp;lt;/code&amp;gt; may be used to specify roles directly, using either role short name or id (numeric names of roles are not supported).&lt;br /&gt;
:* &amp;lt;code&amp;gt;group&amp;lt;/code&amp;gt; may be used to assign users to groups in course, using name or id (numeric group names are not supported)&lt;br /&gt;
:* &amp;lt;code&amp;gt;enrolperiod&amp;lt;/code&amp;gt; may be used to set the enrolment duration, in days, for each course.&lt;br /&gt;
:* &amp;lt;code&amp;gt;enrolstatus&amp;lt;/code&amp;gt; can suspend users from a course when set to 1 or left blank for enrolled.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Cohort field&#039;&#039;&#039;: (Optional):&lt;br /&gt;
:&amp;lt;code&amp;gt;cohort1&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
:Internal cohort id numbers or non-numeric Cohort IDs of existing cohorts must be used; names are not allowed.&lt;br /&gt;
*&#039;&#039;&#039;mnethostid&#039;&#039;&#039; (Optional)&lt;br /&gt;
&lt;br /&gt;
Existing [[MNet]]users can be added to courses, groups or cohorts as below:&lt;br /&gt;
#enrolling to courses: username+mnethostid+course required&lt;br /&gt;
# adding to group: username+mnethostid+course+group required&lt;br /&gt;
#adding to cohort: username+mnethostid+cohort required&lt;br /&gt;
#suspending/reviving accounts: username+mnethostid+suspended required&lt;br /&gt;
All other operations are ignored. You can not add users, delete them or update them (such as change names or email, profile fields, etc.)&lt;br /&gt;
&lt;br /&gt;
Commas within  a field must be encoded as &amp;amp;#44 - the script will decode these back to commas.&lt;br /&gt;
&lt;br /&gt;
For Boolean fields, use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for false and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for true.&lt;br /&gt;
&lt;br /&gt;
To prevent users from receiving a large number of emails from courses or forced subscription forums use the &#039;&#039;&#039;maildigest&#039;&#039;&#039;.  The options for this field are 0 = No digest, 1 = Complete digest and 2 = Digest with just subjects.&lt;br /&gt;
&lt;br /&gt;
==Advanced potentials of Upload user==&lt;br /&gt;
===Templates===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: This section needs checking and updating if necessary for Moodle 2.0. Please do so and remove this note when finished.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The default values are processed as templates in which the following codes are allowed:&lt;br /&gt;
&lt;br /&gt;
* %l - will be replaced by the lastname&lt;br /&gt;
* %f - will be replaced by the firstname&lt;br /&gt;
* %u - will be replaced by the username&lt;br /&gt;
* %% - will be replaced by the %&lt;br /&gt;
&lt;br /&gt;
Between the percent sign (%) and any code letter (l, f or u) the following modifiers are allowed:&lt;br /&gt;
&lt;br /&gt;
* (-) minus sign - the information specified by the code letter will be converted to lowercase&lt;br /&gt;
* (+) plus sign - the information specified by the code letter will be converted to UPPERCASE&lt;br /&gt;
* (~) tilde sign - the information specified by the code letter will be converted to Title Case&lt;br /&gt;
* a decimal number - the information specified by the code letter will be truncated to that many characters&lt;br /&gt;
&lt;br /&gt;
For example, if the firstname is John and the lastname is Doe, the following values will be obtained with the specified templates:&lt;br /&gt;
&lt;br /&gt;
* %l%f = DoeJohn&lt;br /&gt;
* %l%1f = DoeJ&lt;br /&gt;
* %-l%+f = doeJOHN&lt;br /&gt;
* %-f_%-l = john_doe&lt;br /&gt;
*&amp;lt;nowiki&amp;gt; http://www.example.com/~%u/&amp;lt;/nowiki&amp;gt; results in  &amp;lt;nowiki&amp;gt;http://www.example.com/~jdoe/&amp;lt;/nowiki&amp;gt; (if the username is jdoe or %-1f%-l)&lt;br /&gt;
&lt;br /&gt;
Template processing is done only on default values, and not on the values retrieved from the CSV file.&lt;br /&gt;
&lt;br /&gt;
In order to create correct Moodle usernames, the username is always converted to lowercase. Moreover, if the &amp;quot;Allow extended characters in usernames&amp;quot; option in the Site policies page is off, characters different to letters, digits, dash (-) and dot (.) are removed. For example if the firstname is John Jr. and the lastname is Doe, the username %-f_%-l will produce john jr._doe when Allow extended characters in usernames is on, and johnjr.doe when off.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;New username duplicate handling&amp;quot; setting is set to Append counter, an auto-increment counter will be append to duplicate usernames produced by the template. For example, if the CSV file contains the users named John Doe, Jane Doe and Jenny Doe without explicit usernames, the default username is %-1f%-l and New username duplicate handling is set to Append counter, then the usernames produced will be jdoe, jdoe2 and jdoe3.&lt;br /&gt;
&lt;br /&gt;
===Deleting accounts===&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; field is present, users with value 1 for it will be deleted. In this case, all the fields may be omitted, except for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. After uploading the file, be sure to change the &amp;quot;Upload type&amp;quot; to &amp;quot;Update existing users only&amp;quot; and the &amp;quot;Allow deletes&amp;quot; option to &amp;quot;Yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039;  A similar field is available for &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt;. This enables a user account to be temporarily disabled rather than completely removed.&lt;br /&gt;
&lt;br /&gt;
Deleting and uploading accounts could be done with a single CSV file. For example, the following file will add the user Tom Jones and delete the user reznort:&lt;br /&gt;
&lt;br /&gt;
 username,firstname,lastname,deleted&lt;br /&gt;
 jonest,Tom,Jones,0&lt;br /&gt;
 reznort,,,1&lt;br /&gt;
&lt;br /&gt;
==Encoding file format==&lt;br /&gt;
On the initial Upload user screen, you may select the file encoding format from a pull down list.  These include UTF-8 (the default), ASCII,  ISO-8859-1 to ISO-8859-11 or any one of over 36 formats.&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
&lt;br /&gt;
===Spreadsheet===&lt;br /&gt;
&lt;br /&gt;
If you use a spreadsheet program such as Excel to create your .csv file, check the resulting output in a text editor before you upload it.  It is possible to get trailing commas on each line from an empty field if you have added and deleted columns of information prior to saving the final file. Also check the character encoding. A csv file is a simple text file (ASCII or Unicode) that can be used to upload user accounts.&lt;br /&gt;
&lt;br /&gt;
Excel translates passwords that begin with - (minus) or + (plus) as zero. Even when saving as .csv and saying &amp;quot;Yes&amp;quot; to &amp;quot;Keep this format, and leave out any incompatible features.&amp;quot; Check for this before uploading, as a zero halts the upload process.&lt;br /&gt;
&lt;br /&gt;
If you use a formula in Excel to create fields (for example, the concatenate function to create a user name), then remember to copy the cells with the formula and use special paste with values checked to make them into an acceptable data for a csv file.&lt;br /&gt;
&lt;br /&gt;
The upload will also fail if you have trailing spaces at the end of your data fields. Often, this can not be removed with a simple Find &amp;quot; &amp;quot; and Replace with &amp;quot;&amp;quot;. If information has been copied from web sources than it is possible to include non-breaking spaces which will prevent your upload from being completed correctly. To find these invisible spaces, use the Find and Replace function in Excel. In the find field, hold alt and type 0160. Leave the replace field blank. &lt;br /&gt;
&lt;br /&gt;
===Country===&lt;br /&gt;
The country should be written as a two letter code, in capitals. For example, use BE for Belgium or NL for the Netherlands.  Using &amp;quot;be&amp;quot; or &amp;quot;nl&amp;quot; as a country code will result in a database error.&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039;  If you are having trouble working out the two-letter code for a country, you can consult the list of [http://www.iso.org/iso/country_names_and_code_elements country names and code elements] available on the ISO Website. A common error is to use UK for United Kingdom; it should be GB.&lt;br /&gt;
&lt;br /&gt;
===Field size limits===&lt;br /&gt;
Some fields have maximum character lengths.  Typically the file will import to the preview list screen but not finish the process.  Turn on debug to see the fields that are too long.  Common fields to cause problems are &amp;quot;Institution&amp;quot; which is limited to 40 characters, and &amp;quot;City&amp;quot;, also limited (20 characters).  The error will be &amp;quot;User not added - error&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Time zones===&lt;br /&gt;
&lt;br /&gt;
The entry is case sensitive so Europe/London will work but europe/london will not.&lt;br /&gt;
&lt;br /&gt;
===All fields listed here===&lt;br /&gt;
:All the fields that are valid are listed below, except for any custom fields you may have created. &lt;br /&gt;
firstname, lastname, username, email, city, country, lang, timezone, mailformat, maildisplay, maildigest, htmleditor, ajax, autosubscribe ,institution, department, idnumber, skype , msn, aim, yahoo, icq, phone1, phone2, address, url, description, descriptionformat, password, auth, oldusername , deleted, suspended, course1, course2, course3, course4&lt;br /&gt;
&lt;br /&gt;
===Enroll users to Cohorts (system groups)===&lt;br /&gt;
You can enroll users to any Cohort (system level group) by using only the &amp;quot;username&amp;quot; and the &amp;quot;Cohort ID&amp;quot;.&lt;br /&gt;
Here is a sample CSV file:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;username,cohort1&#039;&#039;&#039;&lt;br /&gt;
 teacher1,system-teachers&lt;br /&gt;
 teacher2,system-teachers&lt;br /&gt;
 teacher3,system-teachers&lt;br /&gt;
&lt;br /&gt;
Make sure you set &amp;quot;Upload type&amp;quot; to &amp;quot;Update existing users only&amp;quot; (So you are not asked to add firstname, lastname and email fields too)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://youtu.be/PFGLZnuu_JI Adding users by using a CSV in Moodle]  MoodleBites video on YouTube&lt;br /&gt;
*[[Flat file]] enrolment&lt;br /&gt;
* [[User profile fields]] for details of how to include data about custom user profile fields in the upload users file&lt;br /&gt;
* [[Upload courses]]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=36851 Can I auto enroll from Excel?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97903 Uploading users to custom roles]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=181259 User upload option: standardise usernames]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=144569 Matriculacion con flat file csv] - discussion in Spanish&lt;br /&gt;
&lt;br /&gt;
[[fr:Importer des utilisateurs]]&lt;br /&gt;
[[ja:ユーザのアップロード]]&lt;br /&gt;
[[de:Nutzerliste hochladen]]&lt;br /&gt;
[[es:Subir usuarios]]&lt;/div&gt;</summary>
		<author><name>Mrverrall</name></author>
	</entry>
</feed>