<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/37/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Howardsmiller</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/37/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Howardsmiller"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/Special:Contributions/Howardsmiller"/>
	<updated>2026-04-14T23:21:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Performance_recommendations&amp;diff=135615</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Performance_recommendations&amp;diff=135615"/>
		<updated>2019-09-30T08:10:31Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* PHP performance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
It can be interesting to install and use the [https://moodle.org/plugins/report_benchmark Benchmark plugin] in order to find the bottlenecks of your system that specifically affect Moodle.&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore and cache areas (see [[Caching]]), but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
On very large, load-balanced, systems the performance of the shared components become critical. It&#039;s important that your shared file areas are properly tuned and that you use an effective cache (Redis is highly recommended). A good understanding of these areas of system administration should be considered a minimum requirement. &lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* If your &#039;moodledata&#039; area is going to be on relatively slow storage (e.g. NFS mount on to a NAS device) you will  have performance issues with the default cache configuration (which writes to this storage). See the page on [[Caching]] and choose an alternative. Redis is recommended. Using [https://en.wikipedia.org/wiki/GlusterFS GlusterFS] / [https://en.wikipedia.org/wiki/OCFS2 OCFS2] / [https://en.wikipedia.org/wiki/GFS2 GFS2] on a [https://en.wikipedia.org/wiki/Storage_Area_Network SAN] device and [https://en.wikipedia.org/wiki/Fibre_Channel Fiber Channel] could improve performance (See more info on the Moodle [https://moodle.org/mod/forum/discuss.php?d=214680#p1123124 forum thread], [https://moodle.org/mod/forum/discuss.php?d=310501#p1242382 NFS performance tuing] )&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the [https://moodle.org/mod/forum/discuss.php?d=310501#p1242382 &amp;quot;async&amp;quot; and &amp;quot;noatime&amp;quot;] options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* PHP contains a built-in accelerator. Make sure it is enabled. &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini. The default value for the memory_limit directive is 128M. On some sites, it may need to be larger - especially for some backup operations. &lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
* Use [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html PHP-FPM] (with apache).&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
==== APC ====&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
==== eAccelerator ====&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
==== MemCached ====&lt;br /&gt;
Memcached server (daemon)&lt;br /&gt;
* [https://www.tecmint.com/install-memcached-on-centos-7/ Installing Memcached on CentOS 7.x (linux)] (as of php 7.x, only memcached is available)&lt;br /&gt;
* [https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-memcached-on-centos-7 How To Install and Secure Memcached on CentOS 7]&lt;br /&gt;
* [https://wiki.zimbra.com/wiki/Blocking_Memcached_Attack#Iptables_rules_for_Redhat_based_servers Iptables rules for Redhat based servers]&lt;br /&gt;
Memcached PHP 7.1 extension &lt;br /&gt;
* [https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/repoview/php71u-pecl-memcached.html php71u-pecl-memcached] from IUS CentOS 7.x repository.&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; directive correctly (&#039;&#039;&#039;MaxClients&#039;&#039;&#039; before Apache 2.4). Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxRequestWorkers = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxRequestWorkers from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxRequestWorkers higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxConnectionsPerChild&#039;&#039;&#039; (&#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; before Apache 2.4) in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
* Use Apache [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html event] [http://httpd.apache.org/docs/current/mpm.html MPM] (and not the default Prefork or Worker)&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
===X-Sendfile===&lt;br /&gt;
&lt;br /&gt;
X-Sendfile modules improve performance when sending large files from Moodle. It is recommended to configure your web server and Moodle to use this feature of available.&lt;br /&gt;
&lt;br /&gt;
Configure web server:&lt;br /&gt;
* Apache - https://tn123.org/mod_xsendfile/&lt;br /&gt;
* Lighttpd - http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file&lt;br /&gt;
* Nginx - http://wiki.nginx.org/XSendfile&lt;br /&gt;
&lt;br /&gt;
Enable support in config.php (see config-dist.php):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Sendfile&#039;;           // Apache {@see https://tn123.org/mod_xsendfile/}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-LIGHTTPD-send-file&#039;; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;     // Nginx {@see http://wiki.nginx.org/XSendfile}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure file location prefixes if your server implementation requires it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
//         &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot,&lt;br /&gt;
//         &#039;/cachedir/&#039; =&amp;gt; &#039;/var/www/moodle/cache&#039;,    // for custom $CFG-&amp;gt;cachedir locations&lt;br /&gt;
//         &#039;/localcachedir/&#039; =&amp;gt; &#039;/var/local/cache&#039;,    // for custom $CFG-&amp;gt;localcachedir locations&lt;br /&gt;
//         &#039;/tempdir/&#039;  =&amp;gt; &#039;/var/www/moodle/temp&#039;,     // for custom $CFG-&amp;gt;tempdir locations&lt;br /&gt;
//         &#039;/filedir&#039;   =&amp;gt; &#039;/var/www/moodle/filedir&#039;,  // for custom $CFG-&amp;gt;filedir locations&lt;br /&gt;
//     );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Splitting &#039;&#039;&#039;mdl_log&#039;&#039;&#039; to several tables and using a VIEW with UNION to read them as one. (See Tim Hunt [https://moodle.org/mod/forum/discuss.php?d=243531#p1104165 explanation] on the Moodle forums)&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cli/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming too many resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. This is being tested to optimize the SQL query.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].). The following suggestions were described by [https://moodle.org/user/view.php?id=94615&amp;amp;course=5 Al Rachels] in [https://moodle.org/mod/forum/discuss.php?d=347126 this forum thread]:&lt;br /&gt;
** make sure both Moodle, and the operating system, are installed on a [https://en.wikipedia.org/wiki/Solid-state_drive solid state drive]&lt;br /&gt;
** upgrade to and use [https://docs.moodle.org/dev/Moodle_and_PHP7 PHP 7]&lt;br /&gt;
** run MySQLTuner and implement its recommendations&lt;br /&gt;
&lt;br /&gt;
See [[Performance settings]] for more information on performance-related Moodle settings.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
*[http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html Performance enhacements for Apache and PHP (Apache Event MPM and PHP-FPM)]&lt;br /&gt;
*[https://scholarlms.net/performance-recommendations/ Performance recommendations]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=243531 Moodle 2.5 performance testing at the OU]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=273602 100 active users limit with 4vCPU]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=336603#p1356423 Performance Tip ... shared...]&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones sobre desempeño]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Performance_recommendations&amp;diff=135614</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Performance_recommendations&amp;diff=135614"/>
		<updated>2019-09-30T08:08:28Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Hardware configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
It can be interesting to install and use the [https://moodle.org/plugins/report_benchmark Benchmark plugin] in order to find the bottlenecks of your system that specifically affect Moodle.&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore and cache areas (see [[Caching]]), but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
On very large, load-balanced, systems the performance of the shared components become critical. It&#039;s important that your shared file areas are properly tuned and that you use an effective cache (Redis is highly recommended). A good understanding of these areas of system administration should be considered a minimum requirement. &lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* If your &#039;moodledata&#039; area is going to be on relatively slow storage (e.g. NFS mount on to a NAS device) you will  have performance issues with the default cache configuration (which writes to this storage). See the page on [[Caching]] and choose an alternative. Redis is recommended. Using [https://en.wikipedia.org/wiki/GlusterFS GlusterFS] / [https://en.wikipedia.org/wiki/OCFS2 OCFS2] / [https://en.wikipedia.org/wiki/GFS2 GFS2] on a [https://en.wikipedia.org/wiki/Storage_Area_Network SAN] device and [https://en.wikipedia.org/wiki/Fibre_Channel Fiber Channel] could improve performance (See more info on the Moodle [https://moodle.org/mod/forum/discuss.php?d=214680#p1123124 forum thread], [https://moodle.org/mod/forum/discuss.php?d=310501#p1242382 NFS performance tuing] )&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the [https://moodle.org/mod/forum/discuss.php?d=310501#p1242382 &amp;quot;async&amp;quot; and &amp;quot;noatime&amp;quot;] options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). PHP 5.5 (and newer) includes OpCache and is fully supported and recommended by Moodle&lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
* Use [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html PHP-FPM] (with apache).&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
==== APC ====&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
==== eAccelerator ====&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
==== MemCached ====&lt;br /&gt;
Memcached server (daemon)&lt;br /&gt;
* [https://www.tecmint.com/install-memcached-on-centos-7/ Installing Memcached on CentOS 7.x (linux)] (as of php 7.x, only memcached is available)&lt;br /&gt;
* [https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-memcached-on-centos-7 How To Install and Secure Memcached on CentOS 7]&lt;br /&gt;
* [https://wiki.zimbra.com/wiki/Blocking_Memcached_Attack#Iptables_rules_for_Redhat_based_servers Iptables rules for Redhat based servers]&lt;br /&gt;
Memcached PHP 7.1 extension &lt;br /&gt;
* [https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/repoview/php71u-pecl-memcached.html php71u-pecl-memcached] from IUS CentOS 7.x repository.&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; directive correctly (&#039;&#039;&#039;MaxClients&#039;&#039;&#039; before Apache 2.4). Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxRequestWorkers = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxRequestWorkers from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxRequestWorkers higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxConnectionsPerChild&#039;&#039;&#039; (&#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; before Apache 2.4) in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
* Use Apache [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html event] [http://httpd.apache.org/docs/current/mpm.html MPM] (and not the default Prefork or Worker)&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
===X-Sendfile===&lt;br /&gt;
&lt;br /&gt;
X-Sendfile modules improve performance when sending large files from Moodle. It is recommended to configure your web server and Moodle to use this feature of available.&lt;br /&gt;
&lt;br /&gt;
Configure web server:&lt;br /&gt;
* Apache - https://tn123.org/mod_xsendfile/&lt;br /&gt;
* Lighttpd - http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file&lt;br /&gt;
* Nginx - http://wiki.nginx.org/XSendfile&lt;br /&gt;
&lt;br /&gt;
Enable support in config.php (see config-dist.php):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Sendfile&#039;;           // Apache {@see https://tn123.org/mod_xsendfile/}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-LIGHTTPD-send-file&#039;; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;     // Nginx {@see http://wiki.nginx.org/XSendfile}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure file location prefixes if your server implementation requires it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
//         &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot,&lt;br /&gt;
//         &#039;/cachedir/&#039; =&amp;gt; &#039;/var/www/moodle/cache&#039;,    // for custom $CFG-&amp;gt;cachedir locations&lt;br /&gt;
//         &#039;/localcachedir/&#039; =&amp;gt; &#039;/var/local/cache&#039;,    // for custom $CFG-&amp;gt;localcachedir locations&lt;br /&gt;
//         &#039;/tempdir/&#039;  =&amp;gt; &#039;/var/www/moodle/temp&#039;,     // for custom $CFG-&amp;gt;tempdir locations&lt;br /&gt;
//         &#039;/filedir&#039;   =&amp;gt; &#039;/var/www/moodle/filedir&#039;,  // for custom $CFG-&amp;gt;filedir locations&lt;br /&gt;
//     );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Splitting &#039;&#039;&#039;mdl_log&#039;&#039;&#039; to several tables and using a VIEW with UNION to read them as one. (See Tim Hunt [https://moodle.org/mod/forum/discuss.php?d=243531#p1104165 explanation] on the Moodle forums)&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cli/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming too many resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. This is being tested to optimize the SQL query.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].). The following suggestions were described by [https://moodle.org/user/view.php?id=94615&amp;amp;course=5 Al Rachels] in [https://moodle.org/mod/forum/discuss.php?d=347126 this forum thread]:&lt;br /&gt;
** make sure both Moodle, and the operating system, are installed on a [https://en.wikipedia.org/wiki/Solid-state_drive solid state drive]&lt;br /&gt;
** upgrade to and use [https://docs.moodle.org/dev/Moodle_and_PHP7 PHP 7]&lt;br /&gt;
** run MySQLTuner and implement its recommendations&lt;br /&gt;
&lt;br /&gt;
See [[Performance settings]] for more information on performance-related Moodle settings.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
*[http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html Performance enhacements for Apache and PHP (Apache Event MPM and PHP-FPM)]&lt;br /&gt;
*[https://scholarlms.net/performance-recommendations/ Performance recommendations]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=243531 Moodle 2.5 performance testing at the OU]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=273602 100 active users limit with 4vCPU]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=336603#p1356423 Performance Tip ... shared...]&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones sobre desempeño]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Performance_recommendations&amp;diff=135613</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Performance_recommendations&amp;diff=135613"/>
		<updated>2019-09-30T08:07:09Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Scalability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made has had any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
It can be interesting to install and use the [https://moodle.org/plugins/report_benchmark Benchmark plugin] in order to find the bottlenecks of your system that specifically affect Moodle.&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore and cache areas (see [[Caching]]), but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
On very large, load-balanced, systems the performance of the shared components become critical. It&#039;s important that your shared file areas are properly tuned and that you use an effective cache (Redis is highly recommended). A good understanding of these areas of system administration should be considered a minimum requirement. &lt;br /&gt;
&lt;br /&gt;
===Server cluster===&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=88214 Installation for 3000 simultaneous users]&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (e.g. 4GB or more). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* If your &#039;moodledata&#039; area is going to be on relatively slow storage (e.g. NFS mount on to a NAS device) you will probably have performance issues with the default cache configuration (which writes to this storage). See the page on [[Caching]] and consider an alternative. Using [https://en.wikipedia.org/wiki/GlusterFS GlusterFS] / [https://en.wikipedia.org/wiki/OCFS2 OCFS2] / [https://en.wikipedia.org/wiki/GFS2 GFS2] on a [https://en.wikipedia.org/wiki/Storage_Area_Network SAN] device and [https://en.wikipedia.org/wiki/Fibre_Channel Fiber Channel] could improve performance (See more info on the Moodle [https://moodle.org/mod/forum/discuss.php?d=214680#p1123124 forum thread], [https://moodle.org/mod/forum/discuss.php?d=310501#p1242382 NFS performance tuing] )&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the [https://moodle.org/mod/forum/discuss.php?d=310501#p1242382 &amp;quot;async&amp;quot; and &amp;quot;noatime&amp;quot;] options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules], full text [http://developer.yahoo.com/performance/rules.html Best Practices for Speeding Up Your Web Site], &amp;lt;strike&amp;gt;([http://video.yahoo.com/video/play?vid=1040890 video])&amp;lt;/strike&amp;gt; for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache], [http://sourceforge.net/projects/wincache WinCache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). PHP 5.5 (and newer) includes OpCache and is fully supported and recommended by Moodle&lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS6 ISAPI module&#039;&#039;&#039; (rather than a CGI). IIS 7.0/7.5 (Windows Server 2008/R2) users should choose a FastCGI installation for best performance.&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
* Also see [[PHP_settings_by_Moodle_version]]&lt;br /&gt;
* Use [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html PHP-FPM] (with apache).&lt;br /&gt;
&lt;br /&gt;
===Install HowTo===&lt;br /&gt;
==== APC ====&lt;br /&gt;
* [http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html APC on CentOS 5.x (linux)]&lt;br /&gt;
* [http://fplanque.com/dev/linux/install-apc-php-cache-debian-lenny APC on Debian (linux)]&lt;br /&gt;
==== eAccelerator ====&lt;br /&gt;
* [http://noveckg.blogspot.com/2010/02/installing-eaccelerator-cache-for-php.html Installing eAccelerator on CentOS 5.x (linux)]&lt;br /&gt;
* [https://docs.moodle.org/en/Installing_eAccelerator_In_Ubuntu_Server/ Installing eAccelerator on Ubuntu Server (linux)]&lt;br /&gt;
==== MemCached ====&lt;br /&gt;
Memcached server (daemon)&lt;br /&gt;
* [https://www.tecmint.com/install-memcached-on-centos-7/ Installing Memcached on CentOS 7.x (linux)] (as of php 7.x, only memcached is available)&lt;br /&gt;
* [https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-memcached-on-centos-7 How To Install and Secure Memcached on CentOS 7]&lt;br /&gt;
* [https://wiki.zimbra.com/wiki/Blocking_Memcached_Attack#Iptables_rules_for_Redhat_based_servers Iptables rules for Redhat based servers]&lt;br /&gt;
Memcached PHP 7.1 extension &lt;br /&gt;
* [https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/repoview/php71u-pecl-memcached.html php71u-pecl-memcached] from IUS CentOS 7.x repository.&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; directive correctly (&#039;&#039;&#039;MaxClients&#039;&#039;&#039; before Apache 2.4). Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxRequestWorkers = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB but Moodle can easily use up to 100MB per process, so a general rule of thumb is to divide your available memory in megabytes by 100 to get a conservative setting for MaxClients. You are quite likely to find yourself lowering the MaxRequestWorkers from its default of 150 on a Moodle server. To get a more accurate estimate read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxRequestWorkers&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxRequestWorkers higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxConnectionsPerChild&#039;&#039;&#039; (&#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; before Apache 2.4) in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
* Compression reduces response times by reducing the size of the HTTP response&lt;br /&gt;
# Install and enable mod_deflate - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;ifModule mod_deflate.c&amp;gt;&lt;br /&gt;
   AddOutputFilterByType DEFLATE text/html text/plain text/xml text/x-js text/javascript text/css application/javascript&lt;br /&gt;
 &amp;lt;/ifmodule&amp;gt;&lt;br /&gt;
* Use Apache [http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html event] [http://httpd.apache.org/docs/current/mpm.html MPM] (and not the default Prefork or Worker)&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd, NginX and Cherokee performance===&lt;br /&gt;
You can increase server performance by using a &#039;&#039;&#039;light-weight&#039;&#039;&#039; webserver like [http://www.lighttpd.net/ lighttpd],  [http://nginx.net/ nginx] or [http://www.cherokee-project.com/ cherokee] in combination with PHP in FastCGI-mode. Lighttpd was originally created as a proof-of-concept[http://www.lighttpd.net/story] to address the [http://www.kegel.com/c10k.html C10k problem] and while primarily recommended for memory-limited servers, its design origins and asynchronous-IO model make it a suitable and proven[http://blog.lighttpd.net/articles/2006/12/28/lighttpd-powers-5-alexa-top-250-sites] alternative HTTP server for high-load websites and web apps, including Moodle. See the [[lighttpd | MoodleDocs Lighttpd page]] for additional information, configuration example and links.&lt;br /&gt;
&lt;br /&gt;
Alternatively, both [http://www.lighttpd.net/ lighttpd] and [http://nginx.net/ nginx] are capable of performing as a load-balancer and/or reverse-proxy to alleviate load on back-end servers[http://www.linuxjournal.com/article/10108], providing benefit without requiring an actual software change on existing servers.&lt;br /&gt;
&lt;br /&gt;
Do note that these are likely to be the least tested server environments of all particularly if you are using advanced features such as web services and/or Moodle Networking. They are probably best considered for heavily used Moodle sites with relatively simple configurations.&lt;br /&gt;
&lt;br /&gt;
===X-Sendfile===&lt;br /&gt;
&lt;br /&gt;
X-Sendfile modules improve performance when sending large files from Moodle. It is recommended to configure your web server and Moodle to use this feature of available.&lt;br /&gt;
&lt;br /&gt;
Configure web server:&lt;br /&gt;
* Apache - https://tn123.org/mod_xsendfile/&lt;br /&gt;
* Lighttpd - http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file&lt;br /&gt;
* Nginx - http://wiki.nginx.org/XSendfile&lt;br /&gt;
&lt;br /&gt;
Enable support in config.php (see config-dist.php):&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Sendfile&#039;;           // Apache {@see https://tn123.org/mod_xsendfile/}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-LIGHTTPD-send-file&#039;; // Lighttpd {@see http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file}&lt;br /&gt;
//     $CFG-&amp;gt;xsendfile = &#039;X-Accel-Redirect&#039;;     // Nginx {@see http://wiki.nginx.org/XSendfile}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure file location prefixes if your server implementation requires it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//     $CFG-&amp;gt;xsendfilealiases = array(&lt;br /&gt;
//         &#039;/dataroot/&#039; =&amp;gt; $CFG-&amp;gt;dataroot,&lt;br /&gt;
//         &#039;/cachedir/&#039; =&amp;gt; &#039;/var/www/moodle/cache&#039;,    // for custom $CFG-&amp;gt;cachedir locations&lt;br /&gt;
//         &#039;/localcachedir/&#039; =&amp;gt; &#039;/var/local/cache&#039;,    // for custom $CFG-&amp;gt;localcachedir locations&lt;br /&gt;
//         &#039;/tempdir/&#039;  =&amp;gt; &#039;/var/www/moodle/temp&#039;,     // for custom $CFG-&amp;gt;tempdir locations&lt;br /&gt;
//         &#039;/filedir&#039;   =&amp;gt; &#039;/var/www/moodle/filedir&#039;,  // for custom $CFG-&amp;gt;filedir locations&lt;br /&gt;
//     );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://mysqltuner.com/ MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 #(table_open_cache in MySQL &amp;gt; 5.1.2)&lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache(table_open_cache in MySQL &amp;gt; 5.1.2) then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL (like [http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server this one]), and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Splitting &#039;&#039;&#039;mdl_log&#039;&#039;&#039; to several tables and using a VIEW with UNION to read them as one. (See Tim Hunt [https://moodle.org/mod/forum/discuss.php?d=243531#p1104165 explanation] on the Moodle forums)&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cli/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming too many resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. This is being tested to optimize the SQL query.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. However, it has been getting better in recent versions, and we don&#039;t know of any good, up-to-date performance measurements. (Here is a [http://moodle.org/mod/forum/discuss.php?d=68579 case study from 2007 with 300 quiz users].). The following suggestions were described by [https://moodle.org/user/view.php?id=94615&amp;amp;course=5 Al Rachels] in [https://moodle.org/mod/forum/discuss.php?d=347126 this forum thread]:&lt;br /&gt;
** make sure both Moodle, and the operating system, are installed on a [https://en.wikipedia.org/wiki/Solid-state_drive solid state drive]&lt;br /&gt;
** upgrade to and use [https://docs.moodle.org/dev/Moodle_and_PHP7 PHP 7]&lt;br /&gt;
** run MySQLTuner and implement its recommendations&lt;br /&gt;
&lt;br /&gt;
See [[Performance settings]] for more information on performance-related Moodle settings.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle: [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance] forum&lt;br /&gt;
*[http://opensourceelearning.blogspot.be/2012/10/why-your-moodle-site-is-slow-five.html Why Your Moodle Site is Slow: Five Simple Settings] blog post from Jonathan Moore &lt;br /&gt;
*I teach with Moodle perfomance testing: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/&lt;br /&gt;
*[http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs 2.5.2 performance and MUC APC cahe store]&lt;br /&gt;
*[http://jfilip.ca/2013/09/25/moodle-performance-testing-2-4-6-vs-2-5-2-vs-2-6dev/ Moodle performance testing 2.4.6 vs 2.5.2 vs 2.6dev]&lt;br /&gt;
*[http://jfilip.ca/2013/09/24/moodle-performance-analysis-revisted-now-with-mariadb/ Moodle performance analysis revisited (now with MariaDB)]&lt;br /&gt;
*[http://tjhunt.blogspot.ca/2013/05/performance-testing-moodle.html Tim Hunt&#039;s blog (May 2, 2013) on performance testing Moodle]&lt;br /&gt;
*[http://newrelic.com/ New Relic, Application Performance Monitoring]&lt;br /&gt;
*[http://blog.bitnami.com/2014/06/performance-enhacements-for-apache-and.html Performance enhacements for Apache and PHP (Apache Event MPM and PHP-FPM)]&lt;br /&gt;
*[https://scholarlms.net/performance-recommendations/ Performance recommendations]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=240391#unread Advice on optimising php/db code in moodle2+]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=243531 Moodle 2.5 performance testing at the OU]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=273602 100 active users limit with 4vCPU]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=336603#p1356423 Performance Tip ... shared...]&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones sobre desempeño]]&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[de:Geschwindigkeitsempfehlungen]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=File_upload_size&amp;diff=134977</id>
		<title>File upload size</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=File_upload_size&amp;diff=134977"/>
		<updated>2019-08-01T14:27:47Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Restricting the File size - how it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Upload file size restrictions==&lt;br /&gt;
&lt;br /&gt;
Probably the most frequently asked question on moodle.org is &amp;quot;How do I increase the upload file size limit?&amp;quot; The changes that need be made are the same in all versions of Moodle, just in different OS&#039; they need be made in different places. Upload file sizes are restricted in a number of ways and each one in this list restricts the following ones:&lt;br /&gt;
&lt;br /&gt;
# Server level&lt;br /&gt;
# Moodle site level&lt;br /&gt;
# Course level&lt;br /&gt;
# Activity level&lt;br /&gt;
&lt;br /&gt;
This is a contentious issue, mainly because you might think that it should be set inside the Moodle. Unfortunately, this is not so, these are environment issues that need to be set in the server and PHP folders, Moodle cannot work outside itself. &lt;br /&gt;
&lt;br /&gt;
==Physical access to Server==&lt;br /&gt;
These instructions assume you have full physical and administrative access to your server. If you are using a hosted server then you will probably need to look into other ways to increase your file upload size. &lt;br /&gt;
&lt;br /&gt;
There are positives and negatives to both methods below. If you modify the php.ini file then the changes will effect all php applications on your server. Since PHP5 you can only have one php.ini file on your server. The php.ini method will work with all web servers though. The .htaccess method will only effect the folder and all subfolders that it is placed in, but you must have certain settings enabled in Apache.&lt;br /&gt;
&lt;br /&gt;
==Restricting the File size - how it works==&lt;br /&gt;
The Host may set a limit on the maximum file upload size in the Server environment, which you may override if the Host allows you to. PHP has a setting that it uses to limit the size of the file that it handles in upload. The Host has set that figure in the php.ini based on their particular perceptions and their clientele need. This size appears in Moodle in the &#039;&#039;&#039;Site administration &amp;gt; Security &amp;gt; Site security settings &amp;gt; Maximum uploaded file size&#039;&#039;&#039; drop-down combo box. You can change this at any time to suit your site need. In the Course Settings page, there is also a further restriction that can be made. At no time can the Course setting over-ride the Site setting, nor can the Site setting over-ride the php.ini setting, which cannot over-ride the Server setting. The only exception to this rule is that you can manipulate both the Server and the PHP settings, and how to do that is described below.&lt;br /&gt;
&lt;br /&gt;
==Modifying the php.ini file==&lt;br /&gt;
These instructions show you how to change the file upload size by editing your php.ini file.&lt;br /&gt;
&lt;br /&gt;
For the most part these instructions amount to the following.&lt;br /&gt;
In the file /etc/php5/apache2/php.ini you need to change &amp;quot;post_max_size&amp;quot;, &amp;quot;upload_max_filesize&amp;quot; and &amp;quot;max_execution_time&amp;quot; to values that suit your needs using whatever editor you are used to. &lt;br /&gt;
&lt;br /&gt;
Below are some line by line instructions for various installations of Moodle.&lt;br /&gt;
&lt;br /&gt;
====Ubuntu Linux Instructions====&lt;br /&gt;
&lt;br /&gt;
These instructions assume that you have installed the standard Moodle package, PHP 5 and Apache 2 via apt-get and left it all as a default install. If you have compiled yourself I presume that you will know where your php.ini files are!&lt;br /&gt;
&lt;br /&gt;
You need to edit the following three settings in your php.ini file located at: /etc/php5/apache2/&lt;br /&gt;
Here are a set of instructions to follow line by line.&lt;br /&gt;
&lt;br /&gt;
*Type &amp;quot;sudo nano /etc/php5/apache2/php.ini&amp;quot;&lt;br /&gt;
*Press Ctrl and W and type &amp;quot;post_max_size&amp;quot; &lt;br /&gt;
*Change the value to the number of Mb you want your site to accept as uploads&lt;br /&gt;
*Press Ctrl and W and type &amp;quot;upload_max_filesize&amp;quot; &lt;br /&gt;
*Change the value to the number of Mb you want your site to accept as uploads&lt;br /&gt;
*Press Ctrl and W and type &amp;quot;max_execution_time&amp;quot; &lt;br /&gt;
*Change the value to 600&lt;br /&gt;
*Press Ctrl and O&lt;br /&gt;
*Press Ctrl and X&lt;br /&gt;
*Type sudo apachectl restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size NGINX] system administrators should also add &amp;quot;client_max_body_size XXXm;&amp;quot; to the &amp;quot;http&amp;quot; section of their nginx main configuration file. ([https://rtcamp.com/tutorials/php/increase-file-upload-size-limit/#change-in-nginx-config see more info]) if you have SSL, that will require you to set the above for the SSL &#039;&#039;server&#039;&#039; and &#039;&#039;location&#039;&#039; too.&lt;br /&gt;
&lt;br /&gt;
Your new file size limit should now appear in Administration &amp;gt; Security &amp;gt; Site Policies &amp;gt; Maximum uploaded file size&lt;br /&gt;
&lt;br /&gt;
====XAMPP on Mac Instructions====&lt;br /&gt;
&lt;br /&gt;
These are instructions for how to do this for Moodle on a Mac using the [http://download.moodle.org/macosx/ XAMPP sample download package available]. (This is not for a OS X production server.)&lt;br /&gt;
&lt;br /&gt;
* Close down Apache and MySQL if they are running via the XAMPP Control app and close the XAMPP Control app &lt;br /&gt;
* Open Finder and go to Applications&lt;br /&gt;
* Navigate down and open the folder &#039;&#039;XAMPP&#039;&#039; / &#039;&#039;xamppfiles&#039;&#039; / &#039;&#039;etc&#039;&#039;&lt;br /&gt;
* Open the file &#039;&#039;php.ini&#039;&#039; with TextEdit (or another plain text editor)&lt;br /&gt;
* Search for the &#039;&#039;post_max_size&#039;&#039; setting and up this from 128M (the default) to more; 500M is the maximum&lt;br /&gt;
* Do the same for &#039;&#039;upload_max_filesize&#039;&#039; (make the numbers the same)&lt;br /&gt;
* Search for the &#039;&#039;max_execution_time&#039;&#039; setting and up this to 300 (or more if you get timeouts on uploads)&lt;br /&gt;
* Save the php.ini file &lt;br /&gt;
* restart Apache and MySQL as usual&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: You may get a &amp;quot;permission denied&amp;quot; error when saving the php.ini file unless you are logged in with  admin access to your Mac. To work around this, you can set the &#039;&#039;/etc&#039;&#039; directory in which the php.ini file is located to be writable temporarily. For how to do that, see [http://answers.yahoo.com/question/index?qid=20090115235753AA4DtJ0 here] or [http://www.ehow.com/how_2314896_fix-permissions-mac-os-x.html here].&lt;br /&gt;
&lt;br /&gt;
====Windows XP and Server 2003 Instructions====&lt;br /&gt;
&lt;br /&gt;
These instructions presume that you have downloaded the latest PHP 5.3.x Windows zip package and extracted it to C:\PHP. If you have installed PHP to another location then change all references to &amp;quot;C:\PHP&amp;quot; to the location you installed PHP too.&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|[[Image:lightbulb.png]]&lt;br /&gt;
|Download and install any text editor that can save the file in a UTF-8 format, [http://www.crimsoneditor.com Crimson Editor] is one such, NotePad++ is another, use that instead of either Wordpad or Notepad! The issue is that WordPad or Notepad will include hidden characters that may not be compatible with the requirements of PHP.   &lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
*Open C:\PHP&lt;br /&gt;
*Right Click the &#039;&#039;&#039;php.ini&#039;&#039;&#039; file in this folder and choose &amp;quot;Open with...&amp;quot; selecting your editor of choice. &lt;br /&gt;
*Press Ctrl + F and type &amp;quot;post_max_size&amp;quot; (click Find...&amp;quot;, where needed) &lt;br /&gt;
*Change the value to the number of Mb you want your site to accept as uploads&lt;br /&gt;
*Press Ctrl + F and type &amp;quot;upload_max_filesize&amp;quot; (click Find...&amp;quot;, where needed)&lt;br /&gt;
*Change the value to the number of Mb you want your site to accept as uploads&lt;br /&gt;
*Press Ctrl + F and type &amp;quot;max_execution_time&amp;quot; (click Find...&amp;quot;, where needed)&lt;br /&gt;
*Change the value to 600&lt;br /&gt;
*Press Ctrl and S or the save button. &lt;br /&gt;
*Exit your editor. &lt;br /&gt;
*Restart your webserver to reload PHP with the edited changes. &lt;br /&gt;
**&#039;&#039;&#039;For IIS&#039;&#039;&#039;&lt;br /&gt;
**Open the Start Menu on your server and select &amp;quot;Run&amp;quot;&lt;br /&gt;
**Type &amp;quot;iisreset /RESTART&amp;quot;&lt;br /&gt;
**For &#039;&#039;&#039;Apache 2 and Windows XP&#039;&#039;&#039;&lt;br /&gt;
**Go to Start &amp;gt; All Programs &amp;gt; Apache &amp;gt; Restart&lt;br /&gt;
**&#039;&#039;&#039;For Apache 2 and Windows Server&#039;&#039;&#039;&lt;br /&gt;
**The following command will work as long as you have installed Apache 2 as a service on your Windows Server&lt;br /&gt;
**Open your Start Menu on your server and select &amp;quot;Run&amp;quot;&lt;br /&gt;
**Type &amp;quot;httpd -k restart&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Your new file size limit should now appear in Administration &amp;gt; Security &amp;gt; Site Policies &amp;gt; Maximum uploaded file size&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; These instructions also cover the Xampp Windows installer. Just replace C:\PHP with C:\Moodle\server\php and to restart your Moodle with a normal stop-start.&lt;br /&gt;
&lt;br /&gt;
==Modifying the apache config file==&lt;br /&gt;
====Ubuntu Linux Instructions====&lt;br /&gt;
You may also need to edit the config.php file in the moodle directory:&lt;br /&gt;
*Type &amp;quot;gksudo nautilus&amp;quot; to get root permissions&lt;br /&gt;
*Navigate to /etc/moodle&lt;br /&gt;
*Open apache.conf&lt;br /&gt;
*Go to the &amp;quot;&amp;lt;IfModule mod_php5.c&amp;gt;&amp;quot; section&lt;br /&gt;
*Change &amp;quot;php_value upload_max_filesize = 2M&amp;quot; to a higher value&lt;br /&gt;
*Change &amp;quot;php_value post_max_size = 2M&amp;quot; to a higher value&lt;br /&gt;
*Go to the &amp;quot;&amp;lt;IfModule mod_php4.c&amp;gt;&amp;quot; section&lt;br /&gt;
*Change &amp;quot;php_value upload_max_filesize = 2M&amp;quot; to a higher value&lt;br /&gt;
*Change &amp;quot;php_value post_max_size = 2M&amp;quot; to a higher value&lt;br /&gt;
*Save file&lt;br /&gt;
*Type sudo /etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
===Modifying the .htaccess file===&lt;br /&gt;
&lt;br /&gt;
The following instructions will only work on an Apache web server, and also the Apache server must have Overrides allowed. Traditionally, you could only use .htaccess files when PHP was run as a module of Apache, but with Apache 2.2, this appears to no longer be the case. You can now use the .htaccess file in either module or cgi forms. As well, allowing the use of .htaccess files will cause a performance hit on the server, not a desirable outcome either - so check with your Host. &lt;br /&gt;
&lt;br /&gt;
The .htaccess file is a distributed configuration file, that is, it can be used on a per-folder basis to configure each user&#039;s folder and sub-folders. You cannot alter the &amp;quot;AllowOverrides&amp;quot; directive in the Apache configuration file with a .htaccess file, only the Host can set that manually. Usually the Host will place a .htaccess file into your site Root if they do allow you to override the server settings. You can edit it the same as below, and the overrides you set will work. Alternatively, you may create your own .htaccess file in your text editor. It may also be called something else, like .config. If you have any file that starts with a ., you might want to open it in your text editor, just out of curiosity. &lt;br /&gt;
&lt;br /&gt;
Create a file called .htaccess in Moodle&#039;s main directory (where &#039;index.php&#039; is located, not the &#039;moodledata&#039; directory) that contains the following information:&lt;br /&gt;
&lt;br /&gt;
 php_value upload_max_filesize 20971520&lt;br /&gt;
 php_value post_max_size 20971520&lt;br /&gt;
 php_value max_execution_time 600&lt;br /&gt;
&lt;br /&gt;
20971520 is the integer value for 20Mb. You can use the following site to [http://www.onlineconversion.com/computer_base2.htm convert MegaBytes to Bytes].&lt;br /&gt;
&lt;br /&gt;
For a more complete description of how to edit the .htacess file, look at this page, [http://httpd.apache.org/docs/current/howto/htaccess.html Apache Tutorial: .htaccess files]&lt;br /&gt;
&lt;br /&gt;
===Modifying the IIS 7.0/7.5 configuration (Windows Server 2008, Windows Server 2008 R2)===&lt;br /&gt;
First increase activity and request time outs (allows large files to succeed on slow connections)&lt;br /&gt;
 FastCGI Settings &amp;gt; Edit (Right-click on PHP application)&lt;br /&gt;
 Set Process Model &amp;gt; Activity Timeout to &#039;3600&#039; (one hour)&lt;br /&gt;
 Set Process Model &amp;gt; Request Timeout to &#039;3600&#039; (one hour)&lt;br /&gt;
Next set &#039;Maximum allowed content length&#039;&lt;br /&gt;
 Request Filtering &amp;gt; Edit Feature Settings:&lt;br /&gt;
 Set &#039;Maximum allowed content length&#039; to your desired file size (in bytes) e.g. &#039;536870912&#039; for 512MB (default is approximately 28.6MB)&lt;br /&gt;
&lt;br /&gt;
==Hosted Server==&lt;br /&gt;
Things can be a little different with a hosted server for uploaded and downloaded file size.  You are probably going to  to be told to create or change a .htaccess file, or to modify a php.ini file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|[[Image:lightbulb.png]]&lt;br /&gt;
|It might be a good idea to talk to with your service provider before you attempt anything.  They probably have instructions on &amp;quot;how to&amp;quot; and may have their own limits for uploaded file size. Some hosts measure the file size in gigabytes and others in megabytes.  If you are unhappy with their limits, then check your contract and consider changing your provider to one that has a limit and price that you like.&lt;br /&gt;
|}   &lt;br /&gt;
&lt;br /&gt;
===.htaccess with hosted server===&lt;br /&gt;
The one purpose of an .htaccess file is to override the the current limitations of both the server and the php.ini file.  Your hosted server should inform you where that file needs be placed in your Moodle, but generally in the root is sufficient. They may already have a standard file you can use, if so, use it - but perhaps not.  &lt;br /&gt;
&lt;br /&gt;
To the .htaccess file add the lines:&lt;br /&gt;
  php_value upload_max_filesize 128M&lt;br /&gt;
  php_value post_max_size 128M&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
This will limit uploads to 128MB, but you can make it any size you agree with your provider. The wording may vary slightly, according to the demands of the server.&lt;br /&gt;
&lt;br /&gt;
===php.ini with hosted server===&lt;br /&gt;
Some servers will not allow you to change the moodle root .htaccess file and tell you to use a php.ini file for php directives.  Here you can use the instruction located in the section above called [[File_upload_size#Modifying_the_php.ini_file|Modifying the php.ini file]].&lt;br /&gt;
&lt;br /&gt;
Find the php.ini file in your moodle subfolder on your hosted server. You might want to copy the file as a backup just in case.  Edit php.ini, find &amp;quot;upload_max_filesize&amp;quot; and post_max_size in the code.  After the = change the number.  Here the max filesize is 20 megabytes.  &lt;br /&gt;
&lt;br /&gt;
 upload_max_filesize = 20M&lt;br /&gt;
 post_max_size = 20M&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|[[Image:lightbulb.png]]&lt;br /&gt;
|Still not changed? Some hosts using cpanel have a php config program under services/software. Use the &amp;quot;Single php.ini&amp;quot; option and make sure you note the location of the php.ini file to modify. This changes the .htaccess file in the same area and thus the server limit for all programs using php.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|[[Image:lightbulb.png]]&lt;br /&gt;
|Still not changed? [http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size NGINX] system administrators should also add client_max_body_size XXXm; to the &amp;quot;http&amp;quot; section of their nginx main configuration file. ([https://rtcamp.com/tutorials/php/increase-file-upload-size-limit/#change-in-nginx-config see more info]) if you have SSL, that will require you to set the above for the SSL &#039;&#039;server&#039;&#039; and &#039;&#039;location&#039;&#039; too.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*[[Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F|Administration FAQ Doc page]]&lt;br /&gt;
*[[Site_policies#Maximum_uploaded_file_size|Site Policies Doc page]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=39625 Detailed instructions to increase the maximum allowed size for uploaded files] forum discussion&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=97907 Instructions to increase maximum allowed size on hosted servers] forum discussion&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=124441 Help on changing the maximum upload size when installing Moodle via apt-get] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[es:Tamaño de archivo subido]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ|File]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Antivirus_plugins&amp;diff=133419</id>
		<title>Antivirus plugins</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Antivirus_plugins&amp;diff=133419"/>
		<updated>2019-03-27T21:23:36Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}&lt;br /&gt;
An administrator can enable and configure virus scanners for use on uploaded files via &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Antivirus plugins &amp;gt; Manage antivirus plugins&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
ClamAV antivirus is available as a standard plugin. It&#039;s likely that more antivirus plugins will be available in future from the [https://moodle.org/plugins/ Moodle plugins directory].&lt;br /&gt;
&lt;br /&gt;
==ClamAV antivirus==&lt;br /&gt;
&lt;br /&gt;
To make use of ClamAV antivirus, ClamAV® should be installed on your server. See http://www.clamav.net for more information.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* RHEL/CentOS and [https://en.wikipedia.org/wiki/Security-Enhanced_Linux SELinux]: https://moodle.org/mod/forum/discuss.php?d=316066&lt;br /&gt;
* RHEL/CentOS and [https://access.redhat.com/blogs/766093/posts/1976243 PrivateTmp]: https://moodle.org/mod/forum/discuss.php?d=364706&lt;br /&gt;
* Offboarding ClamScan from web nodes https://moodle.org/mod/forum/discuss.php?d=382731&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[eu:Antibirusa]]&lt;br /&gt;
[[de:Antivirus]]&lt;br /&gt;
[[es:Plugins antivirus]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Antivirus_plugins&amp;diff=133418</id>
		<title>Antivirus plugins</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Antivirus_plugins&amp;diff=133418"/>
		<updated>2019-03-27T21:22:43Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}&lt;br /&gt;
An administrator can enable and configure virus scanners for use on uploaded files via &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Antivirus plugins &amp;gt; Manage antivirus plugins&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
ClamAV antivirus is available as a standard plugin. It&#039;s likely that more antivirus plugins will be available in future from the [https://moodle.org/plugins/ Moodle plugins directory].&lt;br /&gt;
&lt;br /&gt;
==ClamAV antivirus==&lt;br /&gt;
&lt;br /&gt;
To make use of ClamAV antivirus, ClamAV® should be installed on your server. See http://www.clamav.net for more information.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* RHEL/CentOS and [https://en.wikipedia.org/wiki/Security-Enhanced_Linux SELinux]: https://moodle.org/mod/forum/discuss.php?d=316066&lt;br /&gt;
* RHEL/CentOS and [https://access.redhat.com/blogs/766093/posts/1976243 PrivateTmp]: https://moodle.org/mod/forum/discuss.php?d=364706&lt;br /&gt;
* Offboarding ClamScan from web notes https://moodle.org/mod/forum/discuss.php?d=382731&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[eu:Antibirusa]]&lt;br /&gt;
[[de:Antivirus]]&lt;br /&gt;
[[es:Plugins antivirus]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Antivirus_plugins&amp;diff=133417</id>
		<title>Antivirus plugins</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Antivirus_plugins&amp;diff=133417"/>
		<updated>2019-03-27T21:22:15Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}&lt;br /&gt;
An administrator can enable and configure virus scanners for use on uploaded files via &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Antivirus plugins &amp;gt; Manage antivirus plugins&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
ClamAV antivirus is available as a standard plugin. It&#039;s likely that more antivirus plugins will be available in future from the [https://moodle.org/plugins/ Moodle plugins directory].&lt;br /&gt;
&lt;br /&gt;
==ClamAV antivirus==&lt;br /&gt;
&lt;br /&gt;
To make use of ClamAV antivirus, ClamAV® should be installed on your server. See http://www.clamav.net for more information.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* RHEL/CentOS and [https://en.wikipedia.org/wiki/Security-Enhanced_Linux SELinux]: https://moodle.org/mod/forum/discuss.php?d=316066&lt;br /&gt;
* RHEL/CentOS and [https://access.redhat.com/blogs/766093/posts/1976243 PrivateTmp]: https://moodle.org/mod/forum/discuss.php?d=364706&lt;br /&gt;
* Offboarding ClamScan from web notes [https://moodle.org/mod/forum/discuss.php?d=382731]&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[eu:Antibirusa]]&lt;br /&gt;
[[de:Antivirus]]&lt;br /&gt;
[[es:Plugins antivirus]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Upgrading&amp;diff=132791</id>
		<title>Upgrading</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Upgrading&amp;diff=132791"/>
		<updated>2018-12-10T14:19:52Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Bad security advice sorted&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}	&lt;br /&gt;
&#039;&#039;This page explains in detail how to upgrade Moodle. For a summary of the process, see [[Upgrade overview]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Check the requirements==&lt;br /&gt;
&lt;br /&gt;
Before upgrading, check that your server meets all requirements for {{Version}} in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; [[Environment]]&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
See the [{{Release notes}} release notes] in the dev docs for both [{{Release notes}}#Server_requirements server] and [{{Release notes}}#Client_requirements client] software requirements.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* You can only upgrade to Moodle {{Version}} from Moodle 3.1 or later. If upgrading from earlier versions, you must [https://docs.moodle.org/31/en/Upgrading_to_Moodle_3.1 upgrade to 3.1] as a first step.&lt;br /&gt;
&lt;br /&gt;
==Before upgrading==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Consider setting the [[Upgrade key|upgrade key]] for your site.&lt;br /&gt;
&lt;br /&gt;
== Backup important data ==&lt;br /&gt;
&lt;br /&gt;
There are three areas that should be backed up before any upgrade:&lt;br /&gt;
#Moodle software (For example, everything in server/htdocs/moodle)&lt;br /&gt;
#Moodle uploaded files (For example, server/moodledata)&lt;br /&gt;
#Moodle database (For example, your Postgres or MySQL database dump)&lt;br /&gt;
&lt;br /&gt;
See [[Site backup]] for more specific information.&lt;br /&gt;
&lt;br /&gt;
== Check for plugin updates ==&lt;br /&gt;
&lt;br /&gt;
If you have [[Automatic updates deployment]] enabled, you will be able to update installed plugins automatically during the upgrade. Just make sure you check for available updates (via the button for it) at the Plugins check screen.&lt;br /&gt;
&lt;br /&gt;
If you are updating plugins manually, it is a good moment now to check in the [http://moodle.org/plugins Moodle Plugins directory] whether there is a {{Version}} version available for any plugins (including themes) that you have previously installed on your site. If so, download the plugin package. In the next step, you will copy it to the appropriate location in your Moodle code (see [[Installing plugins]]).&lt;br /&gt;
&lt;br /&gt;
The upgrade of the plugin will then happen as part of the Moodle upgrade process.&lt;br /&gt;
&lt;br /&gt;
If an out-of-date plugin causes your upgrade to fail, you can usually delete the plugin code rather than uninstalling it from within Moodle so that the data associated with it is not deleted.&lt;br /&gt;
&lt;br /&gt;
==Put your site into maintenance mode==&lt;br /&gt;
Before you begin upgrading your site, you should put it into [[Maintenance_mode | maintenance mode]] to stop any non-admin users from logging in. Then you should wait for any currently running cron processes to complete before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Install the new Moodle software ==&lt;br /&gt;
You can fetch the current version of the software through &lt;br /&gt;
&lt;br /&gt;
wget http://sourceforge.net/projects/moodle/files/Moodle/stable{{Version2}}/moodle-latest-{{Version2}}.tgz&lt;br /&gt;
&lt;br /&gt;
=== Standard install package ===&lt;br /&gt;
&lt;br /&gt;
# Move your old Moodle software program files to another location. &#039;&#039;Do NOT copy new files over the old files.&#039;&#039;&lt;br /&gt;
# Unzip or unpack the upgrade file so that all the new Moodle software program files are in the location the old files used to be in on the server. Moodle will adjust SQL and moodledata if it needs to in the upgrade.&lt;br /&gt;
# Copy your old [[Configuration file|config.php file]] back to the new Moodle directory. &lt;br /&gt;
# As mentioned above, if you had installed any plugins on your site you should add them to the new code tree (Moodle directory structure) now. It is important to check that you get the correct version for your new version of Moodle. Be particularly careful that you do not overwrite any code in the new version of Moodle and that you place the plugin folders in the correct directory (the same directory that they are in in the current installation.)&lt;br /&gt;
# Your moodledata folder should be located separately to your Moodle code folder and, as such, should not need anything done to it.  Moodle 3.0 will throw a warning if it is located in a web accessible folder and the moodledata should never be located in the Moodle code folder.  If you are moving your installation to a new server or new location on your server, then you will need to follow the Migration documents.&lt;br /&gt;
&lt;br /&gt;
====Linux====&lt;br /&gt;
 mv moodle moodle.backup&lt;br /&gt;
 tar xvzf moodle-{{Version}}.tgz&lt;br /&gt;
&lt;br /&gt;
Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one (&#039;&#039;&#039;check that custom plugins are the correct version for your new Moodle first&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 cp moodle.backup/config.php moodle&lt;br /&gt;
 cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme&lt;br /&gt;
 cp -pr moodle.backup/mod/mymod moodle/mod/mymod&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to make moodle/config.php (and the rest of the source code) readable by your www server. For maximum security the files should not be writeable by your server. This is especially important on a &#039;production&#039; server open to the public internet. &lt;br /&gt;
&lt;br /&gt;
chown -R root:root moodle (Linux debian - or even create a user especially for moodle. &#039;&#039;&#039;Don&#039;t&#039;&#039;&#039; use the web server user, e.g. www-data)&lt;br /&gt;
chmod -R 755 moodle&lt;br /&gt;
&lt;br /&gt;
If you use cron, take care that cron.php is executeable and uses the correct php command: &lt;br /&gt;
 chmod 740 admin/cli/cron.php (some configurations need chmod 750 or chmod 755)&lt;br /&gt;
 copy the first line from cron.php (if it looks like &#039;#!/usr/local/bin/php&#039; or &#039;#!/usr/local/bin/php5.3&#039;, no need to copy &#039;&amp;lt;?php&#039;) &lt;br /&gt;
if necessary.  However, for a simple upgrade, there should be no need to change anything with cron.&lt;br /&gt;
&lt;br /&gt;
=== Using Git ===&lt;br /&gt;
&lt;br /&gt;
You can use Git for updating or upgrading your Moodle. See [[Git for Administrators]] for details.&lt;br /&gt;
&lt;br /&gt;
===Command line upgrade===&lt;br /&gt;
&lt;br /&gt;
On Linux servers, Moodle {{Version}} supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.&lt;br /&gt;
&lt;br /&gt;
== Finishing the upgrade ==&lt;br /&gt;
&lt;br /&gt;
The last step is to trigger the upgrade processes within Moodle. &lt;br /&gt;
&lt;br /&gt;
If you put your site into Maintenance mode earlier; take it out now!&lt;br /&gt;
&lt;br /&gt;
To do this just go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Notifications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Moodle will automatically detect the new version and perform all the SQL database or file system upgrades that are necessary. If there is anything it can&#039;t do itself (very rare) then you will see messages telling you what you need to do.&lt;br /&gt;
&lt;br /&gt;
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!&lt;br /&gt;
&lt;br /&gt;
Note: If you are running multiple servers then you should purge all caches manually (via &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Development &amp;gt; Purge all caches&#039;&#039;) after completing the upgrade on all servers.&lt;br /&gt;
&lt;br /&gt;
===Fatal error: Maximum execution time of 30 seconds exceeded...===&lt;br /&gt;
&lt;br /&gt;
If your server uses a main language other than English, you may encounter a &#039;Fatal error: Maximum execution time of 30 seconds exceeded&#039; when you try to upgrade it. You can increase max_execution_time = 160 on php.ini to allow the scripts enough time to process the language update. Otherwise, you can switch to English as the default language before doing the upgrade and back to your original language after a succcessful upgrade. See the forum discussion at https://moodle.org/mod/forum/discuss.php?d=119598.&lt;br /&gt;
&lt;br /&gt;
==After upgrading==&lt;br /&gt;
&lt;br /&gt;
The config.php file from your installation should work fine but if you take a look at config-dist.php that came with Moodle 3.0 there are more/different options available (e.g. database drivers and settings). It&#039;s a good idea to map your old config.php settings to a new one based on the 3.0 config-dist.php.&lt;br /&gt;
&lt;br /&gt;
===Cron===&lt;br /&gt;
&lt;br /&gt;
Cron has received a major update (MDL-25499) and now has support for both scheduled and ad hoc tasks.&lt;br /&gt;
&lt;br /&gt;
The benefits of these changes are:&lt;br /&gt;
* The schedule for every task can be configured by the admin&lt;br /&gt;
* Tasks can run in parallel&lt;br /&gt;
* Cron processes use locking to prevent the same task running at the same time by different processes&lt;br /&gt;
* Clusters with multiple identical application nodes are supported, you can run cron on all of them&lt;br /&gt;
&lt;br /&gt;
A result of this is that cron can be run much more often, which means (for example) forum posts can be sent out sooner.  To take advantage of the new cron system it is now strongly recommended that administrators increase the frequency that cron is run to at least &#039;&#039;once per minute&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You also may need to modify any automated scripts you have that are parsing the output from cron. It is no longer possible to simply monitor the output of cron for the string &amp;quot;Cron script completed correctly&amp;quot; (if that is what you were doing). An alternative is to monitor the output for the string &amp;quot;task failed:&amp;quot;. If you detect that a task is failing, [[Cron#Debugging_Scheduled_Tasks|here]] are some tips for debugging the failure. &lt;br /&gt;
&lt;br /&gt;
Before the upgrade, there may have been a cron task that was failing, which was preventing the rest of cron from being executed. A failure in any single task will no longer prevent the rest of the Moodle cron tasks from executing, so you may uncover previously masked bugs. It is a good idea to closely monitor the output from cron after the upgrade.&lt;br /&gt;
&lt;br /&gt;
===Assignments===&lt;br /&gt;
&lt;br /&gt;
The old assignment (2.2) module has been removed from core and has been replaced by a stub to support transparently remapping URLs and restoring course backups from the old module to the new one. &lt;br /&gt;
&lt;br /&gt;
If you are still using the old assignment (2.2) module, after upgrading to Moodle 3.0 all assignment (2.2) activities will be hidden. You need to run the [[Assignment upgrade tool]] to un-hide the activities.&lt;br /&gt;
&lt;br /&gt;
If you really, really need to keep using the old assignment (2.2) module, you should update the code to Moodle 3.0, and then replace the &amp;quot;mod/assignment&amp;quot; folder with the one from https://github.com/moodlehq/moodle-mod_assignment/releases before completing the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Possible issues that may affect you in Moodle {{Version}}==&lt;br /&gt;
&lt;br /&gt;
* Sites using a custom theme or login form must include a new login token field in the login form. See the dev docs [[:dev:Login token|Login token]] for details.&lt;br /&gt;
* To use &#039;Run now&#039; links in [[Scheduled tasks]], you will need to set &#039;Path to PHP CLI&#039; (pathtophp) in Site administration / Server / System paths.&lt;br /&gt;
* Adding another user as a messaging contact now requires approval from the other user. Any contacts that you have that aren&#039;t mutual (ie. both users have added each other as a contact) will be removed from your list of contacts.&lt;br /&gt;
* New setting &#039;Allow site-wide messaging&#039; in Site administration / Advanced features. The setting is disabled by default (for new installs) but enabled for upgraded sites.&lt;br /&gt;
* The timeline tab in the course overview block is now in a separate block [[Timeline block|Timeline]]. There are also more new Dashboard blocks - [[Recently accessed courses block|Recently accessed courses]], [[Recently accessed items block|Recently accessed items]] and [[Starred courses block|Starred courses]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please add more items...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also the list of [https://tracker.moodle.org/issues/?jql=project%20%3D%20mdl%20AND%20resolution%20%3D%20fixed%20AND%20fixVersion%20in%20(%223.6%22)%20AND%20labels%20%3D%20upgrade_notes upgrade_notes-labelled issues] and [https://tracker.moodle.org/issues/?jql=project%20%3D%20mdl%20AND%20resolution%20%3D%20fixed%20AND%20fixVersion%20in%20(%223.6%22)%20AND%20labels%20%3D%20ui_change%20 ui_change-labelled issues]. &lt;br /&gt;
&lt;br /&gt;
=== Moodle 3.1, 3.2, 3.3, 3.4 and 3.5 improvements ===&lt;br /&gt;
&lt;br /&gt;
Depending on which version you are upgrading from, please see the section &#039;Possible issues that may affect you&#039; in the documentation&lt;br /&gt;
&lt;br /&gt;
* [https://docs.moodle.org/31/en/Upgrading Upgrading to Moodle 3.1]&lt;br /&gt;
* [https://docs.moodle.org/32/en/Upgrading Upgrading to Moodle 3.2]&lt;br /&gt;
* [https://docs.moodle.org/33/en/Upgrading Upgrading to Moodle 3.3]&lt;br /&gt;
* [https://docs.moodle.org/34/en/Upgrading Upgrading to Moodle 3.4]&lt;br /&gt;
* [https://docs.moodle.org/35/en/Upgrading Upgrading to Moodle 3.5]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation help forum] &lt;br /&gt;
* [[dev:Moodle {{Version}} release notes|Moodle {{Version}} release notes]]&lt;br /&gt;
&lt;br /&gt;
[[es:Actualización de moodle]]&lt;br /&gt;
[[fr:Mise à jour]]&lt;br /&gt;
[[ja:Moodleをアップグレードする]]&lt;br /&gt;
[[de:Aktualisierung von Moodle]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Feedback_templates&amp;diff=132096</id>
		<title>Feedback templates</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Feedback_templates&amp;diff=132096"/>
		<updated>2018-10-24T13:34:00Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Save these questions as a new template */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Feedback}}&lt;br /&gt;
Within the Feedback Module you can create and re-use sets of Feedback questions using the Template tool.&lt;br /&gt;
&lt;br /&gt;
The Templates tab provides the following template features:&lt;br /&gt;
&lt;br /&gt;
==Use a template==&lt;br /&gt;
&lt;br /&gt;
Previously saved Templates will be listed in this area and can be selected using the dropdown menu.&lt;br /&gt;
&lt;br /&gt;
After selecting a Template, Moodle will display a preview of the Feedback questions contained within the Template and confirm Are you sure you want to use this template?&lt;br /&gt;
&lt;br /&gt;
You will also be required to select one of two options:&lt;br /&gt;
&lt;br /&gt;
;Delete old items&lt;br /&gt;
:Remove any questions/text types previously added to the Feedback Activity you are viewing before importing items from the selected Template&lt;br /&gt;
&lt;br /&gt;
;Append new items&lt;br /&gt;
:Add items stored within the selected template to the current Feedback activity, to any existing questions/text types.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you have made your selection click Save changes to copy across the Feedback items or press Cancel to exit from the template copy process.&lt;br /&gt;
&lt;br /&gt;
== Save these questions as a new template ==&lt;br /&gt;
&lt;br /&gt;
After creating a new Feedback activity and populating it with questions, you can save it as a Template for re-use by yourself or others.&lt;br /&gt;
&lt;br /&gt;
When saving a new Template enter a descriptive title in the Name field and choose whether you wish to make this Template available for use by others via the Public tickbox . A Public template may be viewed and re-used by users with appropriate access rights such as administrators and teacher/trainers. When a Public template is used as a basis for a new Feedback, the activity settings and questions within it may be edited by the teacher/trainer, however the original Template remains unchanged.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; To create public templates users must have the mod/feedback:createpublictemplate capability at the System/Site level. This will not be the case by default. You would either need to allow this capability in the &#039;Authenticated user&#039; role or create a specific side-wide role for permitted users.&lt;br /&gt;
&lt;br /&gt;
== Delete Template... ==&lt;br /&gt;
&lt;br /&gt;
To remove a Template you have created or have appropriate permissions to edit, from your Moodle site, use the Delete template... link and click the delete icon next to the corresponding template name.&lt;br /&gt;
&lt;br /&gt;
==Export Questions==&lt;br /&gt;
&lt;br /&gt;
The Export Questions tool allows you to save the questions/text types within your Feedback Activity in .xml format. Clicking the Export questions link will prompt you to Save or Open this file.&lt;br /&gt;
&lt;br /&gt;
==Import Questions==&lt;br /&gt;
&lt;br /&gt;
Where you have previously exported and saved questions from a Feedback activity in .xml format, you can reimport them into a new Feedback activity. &lt;br /&gt;
&lt;br /&gt;
The Import questions tool is particularly useful where you need to import questions from a different instance of Moodle and the Template tool is not applicable. &lt;br /&gt;
&lt;br /&gt;
Tip: You can also use the Import/Export ability to combine multiple Imports from multiple templates; also it can be used to avoid creating duplicates when using Append.&lt;br /&gt;
&lt;br /&gt;
After clicking on the Import questions link you will be prompted to select one of the following options:&lt;br /&gt;
&lt;br /&gt;
;Delete old items&lt;br /&gt;
:The current questions and all your user&#039;s responses will be deleted within the current Feedback activity&lt;br /&gt;
&lt;br /&gt;
;Append new items&lt;br /&gt;
:All old questions and the assigned values will be preserved within the current Feedback activity and the imported questions will be added to the existing questions.&lt;br /&gt;
&lt;br /&gt;
Use the Choose a file button to navigate to the course Files area and upload and/or select the relevant .xml file. Once selected use the Import from this file button to import the questions or use Cancel to return to the Templates general tab.&lt;br /&gt;
&lt;br /&gt;
[[de:Feedback-Vorlagen]]&lt;br /&gt;
[[es:Plantillas de retroalimentación]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Feedback_templates&amp;diff=132095</id>
		<title>Feedback templates</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Feedback_templates&amp;diff=132095"/>
		<updated>2018-10-24T13:33:28Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Save these questions as a new template */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Feedback}}&lt;br /&gt;
Within the Feedback Module you can create and re-use sets of Feedback questions using the Template tool.&lt;br /&gt;
&lt;br /&gt;
The Templates tab provides the following template features:&lt;br /&gt;
&lt;br /&gt;
==Use a template==&lt;br /&gt;
&lt;br /&gt;
Previously saved Templates will be listed in this area and can be selected using the dropdown menu.&lt;br /&gt;
&lt;br /&gt;
After selecting a Template, Moodle will display a preview of the Feedback questions contained within the Template and confirm Are you sure you want to use this template?&lt;br /&gt;
&lt;br /&gt;
You will also be required to select one of two options:&lt;br /&gt;
&lt;br /&gt;
;Delete old items&lt;br /&gt;
:Remove any questions/text types previously added to the Feedback Activity you are viewing before importing items from the selected Template&lt;br /&gt;
&lt;br /&gt;
;Append new items&lt;br /&gt;
:Add items stored within the selected template to the current Feedback activity, to any existing questions/text types.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once you have made your selection click Save changes to copy across the Feedback items or press Cancel to exit from the template copy process.&lt;br /&gt;
&lt;br /&gt;
== Save these questions as a new template ==&lt;br /&gt;
&lt;br /&gt;
After creating a new Feedback activity and populating it with questions, you can save it as a Template for re-use by yourself or others.&lt;br /&gt;
&lt;br /&gt;
When saving a new Template enter a descriptive title in the Name field and choose whether you wish to make this Template available for use by others via the Public tickbox . A Public template may be viewed and re-used by users with appropriate access rights such as administrators and teacher/trainers. When a Public template is used as a basis for a new Feedback, the activity settings and questions within it may be edited by the teacher/trainer, however the original Template remains unchanged.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; To create public templates users must have the mod/feedback:createpublictemplate capability at the System/Site level. This will not be the case by default. You would either need to allow this capability in the &#039;Authenticated user&#039; role or crate a specific side-wide role for permitted users.&lt;br /&gt;
&lt;br /&gt;
== Delete Template... ==&lt;br /&gt;
&lt;br /&gt;
To remove a Template you have created or have appropriate permissions to edit, from your Moodle site, use the Delete template... link and click the delete icon next to the corresponding template name.&lt;br /&gt;
&lt;br /&gt;
==Export Questions==&lt;br /&gt;
&lt;br /&gt;
The Export Questions tool allows you to save the questions/text types within your Feedback Activity in .xml format. Clicking the Export questions link will prompt you to Save or Open this file.&lt;br /&gt;
&lt;br /&gt;
==Import Questions==&lt;br /&gt;
&lt;br /&gt;
Where you have previously exported and saved questions from a Feedback activity in .xml format, you can reimport them into a new Feedback activity. &lt;br /&gt;
&lt;br /&gt;
The Import questions tool is particularly useful where you need to import questions from a different instance of Moodle and the Template tool is not applicable. &lt;br /&gt;
&lt;br /&gt;
Tip: You can also use the Import/Export ability to combine multiple Imports from multiple templates; also it can be used to avoid creating duplicates when using Append.&lt;br /&gt;
&lt;br /&gt;
After clicking on the Import questions link you will be prompted to select one of the following options:&lt;br /&gt;
&lt;br /&gt;
;Delete old items&lt;br /&gt;
:The current questions and all your user&#039;s responses will be deleted within the current Feedback activity&lt;br /&gt;
&lt;br /&gt;
;Append new items&lt;br /&gt;
:All old questions and the assigned values will be preserved within the current Feedback activity and the imported questions will be added to the existing questions.&lt;br /&gt;
&lt;br /&gt;
Use the Choose a file button to navigate to the course Files area and upload and/or select the relevant .xml file. Once selected use the Import from this file button to import the questions or use Cancel to return to the Templates general tab.&lt;br /&gt;
&lt;br /&gt;
[[de:Feedback-Vorlagen]]&lt;br /&gt;
[[es:Plantillas de retroalimentación]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=131730</id>
		<title>Installation quick guide</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=131730"/>
		<updated>2018-08-21T21:01:18Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Getting Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. Otherwise please see [[Installing Moodle]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Basic Requirements==&lt;br /&gt;
&lt;br /&gt;
* You will need a working web server (e.g. [[Apache]]), a database (e.g. [[MySQL]], [[MariaDB]] or [[PostgreSQL]]) and have [[PHP]] configured. See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
* Moodle requires a number of [[PHP]] extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.&lt;br /&gt;
* If you want Moodle to send email (you probably do) you need a working Sendmail (Unix/Linux) on your server or access to an SMTP mail server.&lt;br /&gt;
&lt;br /&gt;
==Getting Moodle==&lt;br /&gt;
&lt;br /&gt;
You have two basic options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads ... OR&lt;br /&gt;
* 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 -b MOODLE_35_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the {{Version}} Stable branch. &lt;br /&gt;
&lt;br /&gt;
See [[Git_for_Administrators|Git for Administrators ]] for details on using Git to install Moodle code.&lt;br /&gt;
&lt;br /&gt;
Note: Only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories, other &amp;quot;one click&amp;quot; installers) cannot be guaranteed to work properly, be upgradable or be supportable.&lt;br /&gt;
&lt;br /&gt;
==Create a database==&lt;br /&gt;
&lt;br /&gt;
* Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a user/password combination with appropriate permissions for the database. For example (MySQL again):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO &#039;moodleuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;yourpassword&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: It is important to GRANT ON moodle.* as the database name including the &#039;.*&#039; and not just the bare database name. Save this password you use for the Moodle user, since you will need it later in the install.&lt;br /&gt;
&lt;br /&gt;
==Create data directory==&lt;br /&gt;
&lt;br /&gt;
* Create an empty directory to hold Moodle files. It &#039;&#039;&#039;must not&#039;&#039;&#039; be in the area served by the web server and must have permissions so that the web server user can write to it. Other than that it can be located anywhere. Typically, either make it owned by the web server user or give it write permissions for &#039;everyone&#039;. If it is on a shared/NFS drive then read [[Caching]] - Moodle caches to this disk area by default and a slow share will mean terrible performance.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
* If you downloaded the zip or tgz file earlier, then unzip / untar / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/html/moodle)&lt;br /&gt;
* Check the permissions and make sure that the web server does &#039;&#039;&#039;not&#039;&#039;&#039; have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).&lt;br /&gt;
* If you need to, configure your web server to serve the Moodle site with your chosen URL.&lt;br /&gt;
&lt;br /&gt;
==Configure Moodle==&lt;br /&gt;
&lt;br /&gt;
* In the Moodle code directory, find the file &#039;&#039;config-dist.php&#039;&#039; and copy it to a new file called &#039;&#039;config.php&#039;&#039; (but read next step, &#039;Install Moodle&#039;, first).&lt;br /&gt;
* Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. &#039;&#039;Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
* Go to the URL for your moodle site in a browser (installation will complete automatically) or run the command line version at (requires cli version of PHP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/bin/php /path/to/moodle/admin/cli/install.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The CLI creates the config.php for you and will not run if you created one in the previous step.&lt;br /&gt;
* After completing the install make sure your file permissions are ok for the Moodle program files (not writeable by web server) and the Moodle data files (writeable by web server).&lt;br /&gt;
&lt;br /&gt;
==Set up cron==&lt;br /&gt;
&lt;br /&gt;
You will need a cron job to run periodically. It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]]. A typical Unix cron entry will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your site &#039;&#039;&#039;will not work properly&#039;&#039;&#039; unless cron is running regularly. It is very important you do not skip this step.&lt;br /&gt;
&lt;br /&gt;
See [[Cron]] for details.&lt;br /&gt;
&lt;br /&gt;
==Congratulations!==&lt;br /&gt;
&lt;br /&gt;
You are now ready to use your Moodle site.&lt;br /&gt;
&lt;br /&gt;
If you run into problems, check the [[Installation FAQ]] and visit the [http://moodle.org/mod/forum/view.php?id=28 Installation help forum].&lt;br /&gt;
&lt;br /&gt;
[[Category:Quick guide]]&lt;br /&gt;
&lt;br /&gt;
[[de:Installation in Kürze]]&lt;br /&gt;
[[fr:Installation_rapide]]&lt;br /&gt;
[[es:Inicio_Rápido_de_Instalación]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=131729</id>
		<title>Installation quick guide</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=131729"/>
		<updated>2018-08-21T21:00:41Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Wrong branch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. Otherwise please see [[Installing Moodle]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Basic Requirements==&lt;br /&gt;
&lt;br /&gt;
* You will need a working web server (e.g. [[Apache]]), a database (e.g. [[MySQL]], [[MariaDB]] or [[PostgreSQL]]) and have [[PHP]] configured. See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
* Moodle requires a number of [[PHP]] extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.&lt;br /&gt;
* If you want Moodle to send email (you probably do) you need a working Sendmail (Unix/Linux) on your server or access to an SMTP mail server.&lt;br /&gt;
&lt;br /&gt;
==Getting Moodle==&lt;br /&gt;
&lt;br /&gt;
You have two basic options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads ... OR&lt;br /&gt;
* 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 -b MOODLE_35_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the {{Version}} Stable branch. &lt;br /&gt;
&lt;br /&gt;
See [[Git_for_Administrators|Git for Administrators ]] for details on using Git to install Moodle code.&lt;br /&gt;
&lt;br /&gt;
Note: Only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories) cannot be guaranteed to work properly, be upgradable or be supportable.&lt;br /&gt;
&lt;br /&gt;
==Create a database==&lt;br /&gt;
&lt;br /&gt;
* Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a user/password combination with appropriate permissions for the database. For example (MySQL again):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO &#039;moodleuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;yourpassword&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: It is important to GRANT ON moodle.* as the database name including the &#039;.*&#039; and not just the bare database name. Save this password you use for the Moodle user, since you will need it later in the install.&lt;br /&gt;
&lt;br /&gt;
==Create data directory==&lt;br /&gt;
&lt;br /&gt;
* Create an empty directory to hold Moodle files. It &#039;&#039;&#039;must not&#039;&#039;&#039; be in the area served by the web server and must have permissions so that the web server user can write to it. Other than that it can be located anywhere. Typically, either make it owned by the web server user or give it write permissions for &#039;everyone&#039;. If it is on a shared/NFS drive then read [[Caching]] - Moodle caches to this disk area by default and a slow share will mean terrible performance.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
* If you downloaded the zip or tgz file earlier, then unzip / untar / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/html/moodle)&lt;br /&gt;
* Check the permissions and make sure that the web server does &#039;&#039;&#039;not&#039;&#039;&#039; have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).&lt;br /&gt;
* If you need to, configure your web server to serve the Moodle site with your chosen URL.&lt;br /&gt;
&lt;br /&gt;
==Configure Moodle==&lt;br /&gt;
&lt;br /&gt;
* In the Moodle code directory, find the file &#039;&#039;config-dist.php&#039;&#039; and copy it to a new file called &#039;&#039;config.php&#039;&#039; (but read next step, &#039;Install Moodle&#039;, first).&lt;br /&gt;
* Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. &#039;&#039;Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
* Go to the URL for your moodle site in a browser (installation will complete automatically) or run the command line version at (requires cli version of PHP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/bin/php /path/to/moodle/admin/cli/install.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The CLI creates the config.php for you and will not run if you created one in the previous step.&lt;br /&gt;
* After completing the install make sure your file permissions are ok for the Moodle program files (not writeable by web server) and the Moodle data files (writeable by web server).&lt;br /&gt;
&lt;br /&gt;
==Set up cron==&lt;br /&gt;
&lt;br /&gt;
You will need a cron job to run periodically. It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]]. A typical Unix cron entry will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your site &#039;&#039;&#039;will not work properly&#039;&#039;&#039; unless cron is running regularly. It is very important you do not skip this step.&lt;br /&gt;
&lt;br /&gt;
See [[Cron]] for details.&lt;br /&gt;
&lt;br /&gt;
==Congratulations!==&lt;br /&gt;
&lt;br /&gt;
You are now ready to use your Moodle site.&lt;br /&gt;
&lt;br /&gt;
If you run into problems, check the [[Installation FAQ]] and visit the [http://moodle.org/mod/forum/view.php?id=28 Installation help forum].&lt;br /&gt;
&lt;br /&gt;
[[Category:Quick guide]]&lt;br /&gt;
&lt;br /&gt;
[[de:Installation in Kürze]]&lt;br /&gt;
[[fr:Installation_rapide]]&lt;br /&gt;
[[es:Inicio_Rápido_de_Instalación]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=131508</id>
		<title>MySQL full unicode support</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=131508"/>
		<updated>2018-07-17T08:43:49Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* File format */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
==UTF-8==&lt;br /&gt;
&lt;br /&gt;
UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored. Any attempt to enter a text that contains four byte characters will result in a Moodle database error.&lt;br /&gt;
&lt;br /&gt;
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured. From version 3.3 on Moodle uses full UTF-8 for both MySQL and MariaDB by default. Existing databases will still run with partial support, but it is recommended to move over to full support.&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a Command Line Interface (CLI) script for converting to full UTF-8 for MySQL (and MariaDB). Before Moodle versions 3.1.5 and 3.2.2 this conversion tool would only change the Collation to some variant of &#039;utf8_bin&#039;. &#039;utf8_unicode_ci&#039; was the recommended Collation. We now recommend using &#039;utf8mb4_unicode_ci&#039; which supports four byte characters (utf8_unicode_ci only supports three).&lt;br /&gt;
&lt;br /&gt;
This script will attempt to change the database Collation, Character set, default table settings and column definitions.&lt;br /&gt;
&lt;br /&gt;
To summarise:&lt;br /&gt;
&lt;br /&gt;
* Fresh installs of Moodle 3.1.5 and 3.2.2 onwards will use utf8mb4 by default, if the database server is configured appropriately (see below).&lt;br /&gt;
* Sites upgrading to Moodle 3.1.5 or 3.2.2 can use the script to update to utf8mb4. In Moodle 3.3, 3.4 and 3.5 a warning will show that the database isn&#039;t using full UTF-8 support and suggest moving to &#039;utf8mb4_unicode_ci&#039;, but you may choose to keep using &#039;utf8_*&#039;.&lt;br /&gt;
&lt;br /&gt;
===File format===&lt;br /&gt;
&lt;br /&gt;
To allow for large indexes on columns that are a varchar, a combination of settings needs to be set. The file format for the system needs to be using &amp;quot;Barracuda&amp;quot;. This allows for the row format to be set to &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot;. To enable this setting see the upgrade steps listed below. Moodle will not install if you have large format enabled without the Barracuda file format.&lt;br /&gt;
&lt;br /&gt;
===File per table===&lt;br /&gt;
&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===Large prefix===&lt;br /&gt;
&lt;br /&gt;
This in conjunction with the row format being either &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot; allows for large varchar indexes above 191 characters.&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
==Steps to upgrade==&lt;br /&gt;
&lt;br /&gt;
Most important: Please backup your database before making any changes or running the CLI script.&lt;br /&gt;
&lt;br /&gt;
* Change configuration settings for MySQL (exactly the same for MariaDB). This step is optional. You can run the script and it will try and make these changes itself. If errors occur then try manually changing these settings as listed below.&lt;br /&gt;
** On Linux based systems you will want to alter my.cnf. This may be located in &#039;/etc/mysql/&#039;.&lt;br /&gt;
** Make the following alterations to my.cnf:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_file_format = Barracuda&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_large_prefix&lt;br /&gt;
&lt;br /&gt;
character-set-server = utf8mb4&lt;br /&gt;
collation-server = utf8mb4_unicode_ci&lt;br /&gt;
skip-character-set-client-handshake&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart your MySQL server.&lt;br /&gt;
* Run the CLI script to convert to the new Character set and Collation (requires Moodle 3.1.5, 3.2.2 or newer): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: On very large sites this may take a long time to run. You should probably establish how long on a test install before taking your live site offline. In some cases you might consider dumping and re-importing your data.&lt;br /&gt;
&lt;br /&gt;
* Adjust the $CFG-&amp;gt;dboptions Array in your &#039;&#039;&#039;config.php&#039;&#039;&#039; to make sure that Moodle uses the right Collation when connecting to the MySQL Server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dboptions = array(&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
  &#039;dbcollation&#039; =&amp;gt; &#039;utf8mb4_unicode_ci&#039;,&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only have access to the database command line (or something like phpmyadmin) you can try the following sql commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SET GLOBAL innodb_file_format = barracuda&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_file_per_table = 1&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_large_prefix = &#039;on&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Try adding some Emojis (e.g. 😂💩) to your Moodle site to verify that the upgrade was successful.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|UTF-8]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:MySQL soporte unicode completo]]&lt;br /&gt;
[[fr:Support unicode complet pour MySQL]]&lt;br /&gt;
[[de:MySQL Unicode Unterstützung]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=131507</id>
		<title>MySQL full unicode support</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=131507"/>
		<updated>2018-07-17T08:40:31Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* UTF-8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
==UTF-8==&lt;br /&gt;
&lt;br /&gt;
UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored. Any attempt to enter a text that contains four byte characters will result in a Moodle database error.&lt;br /&gt;
&lt;br /&gt;
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured. From version 3.3 on Moodle uses full UTF-8 for both MySQL and MariaDB by default. Existing databases will still run with partial support, but it is recommended to move over to full support.&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a Command Line Interface (CLI) script for converting to full UTF-8 for MySQL (and MariaDB). Before Moodle versions 3.1.5 and 3.2.2 this conversion tool would only change the Collation to some variant of &#039;utf8_bin&#039;. &#039;utf8_unicode_ci&#039; was the recommended Collation. We now recommend using &#039;utf8mb4_unicode_ci&#039; which supports four byte characters (utf8_unicode_ci only supports three).&lt;br /&gt;
&lt;br /&gt;
This script will attempt to change the database Collation, Character set, default table settings and column definitions.&lt;br /&gt;
&lt;br /&gt;
To summarise:&lt;br /&gt;
&lt;br /&gt;
* Fresh installs of Moodle 3.1.5 and 3.2.2 onwards will use utf8mb4 by default, if the database server is configured appropriately (see below).&lt;br /&gt;
* Sites upgrading to Moodle 3.1.5 or 3.2.2 can use the script to update to utf8mb4. In Moodle 3.3, 3.4 and 3.5 a warning will show that the database isn&#039;t using full UTF-8 support and suggest moving to &#039;utf8mb4_unicode_ci&#039;, but you may choose to keep using &#039;utf8_*&#039;.&lt;br /&gt;
&lt;br /&gt;
===File format===&lt;br /&gt;
&lt;br /&gt;
To allow for large indexes on columns that are a varchar, a combination of settings needs to be set. The file format for the system needs to be using &amp;quot;Barracuda&amp;quot;. This allows for the row format to be set to &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot;. To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===File per table===&lt;br /&gt;
&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===Large prefix===&lt;br /&gt;
&lt;br /&gt;
This in conjunction with the row format being either &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot; allows for large varchar indexes above 191 characters.&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
==Steps to upgrade==&lt;br /&gt;
&lt;br /&gt;
Most important: Please backup your database before making any changes or running the CLI script.&lt;br /&gt;
&lt;br /&gt;
* Change configuration settings for MySQL (exactly the same for MariaDB). This step is optional. You can run the script and it will try and make these changes itself. If errors occur then try manually changing these settings as listed below.&lt;br /&gt;
** On Linux based systems you will want to alter my.cnf. This may be located in &#039;/etc/mysql/&#039;.&lt;br /&gt;
** Make the following alterations to my.cnf:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_file_format = Barracuda&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_large_prefix&lt;br /&gt;
&lt;br /&gt;
character-set-server = utf8mb4&lt;br /&gt;
collation-server = utf8mb4_unicode_ci&lt;br /&gt;
skip-character-set-client-handshake&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart your MySQL server.&lt;br /&gt;
* Run the CLI script to convert to the new Character set and Collation (requires Moodle 3.1.5, 3.2.2 or newer): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: On very large sites this may take a long time to run. You should probably establish how long on a test install before taking your live site offline. In some cases you might consider dumping and re-importing your data.&lt;br /&gt;
&lt;br /&gt;
* Adjust the $CFG-&amp;gt;dboptions Array in your &#039;&#039;&#039;config.php&#039;&#039;&#039; to make sure that Moodle uses the right Collation when connecting to the MySQL Server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dboptions = array(&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
  &#039;dbcollation&#039; =&amp;gt; &#039;utf8mb4_unicode_ci&#039;,&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only have access to the database command line (or something like phpmyadmin) you can try the following sql commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SET GLOBAL innodb_file_format = barracuda&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_file_per_table = 1&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_large_prefix = &#039;on&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Try adding some Emojis (e.g. 😂💩) to your Moodle site to verify that the upgrade was successful.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|UTF-8]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:MySQL soporte unicode completo]]&lt;br /&gt;
[[fr:Support unicode complet pour MySQL]]&lt;br /&gt;
[[de:MySQL Unicode Unterstützung]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Working_with_files&amp;diff=131460</id>
		<title>Working with files</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Working_with_files&amp;diff=131460"/>
		<updated>2018-07-11T13:06:28Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Adding a new file type */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Managing content}}&lt;br /&gt;
==Adding files to your course==&lt;br /&gt;
&lt;br /&gt;
Moodle provides an easy way for a teacher to present materials to their students. These materials may take the form of files such as word-processed documents or slideshow presentations. The materials can be displayed on the page either as individual items or bundled together inside folders. One teacher might for instance wish to share a single research document in pdf format; another might have a folder of sample past examination papers for students to download. Most types of files can be uploaded and accessed through Moodle but the student needs to have the correct software to be able to open them.&lt;br /&gt;
&lt;br /&gt;
To add files to a Moodle course, you must first ensure you have the editing turned on.&lt;br /&gt;
&lt;br /&gt;
===Drag and drop===&lt;br /&gt;
*If you are using a modern browser, you can simply click, hold and drag and drop a file directly onto your course page. You will know if drag and drop is available to you because you will (briefly) see a message at the top of your screen:&lt;br /&gt;
[[File:dragdropmessage.png]]&lt;br /&gt;
&lt;br /&gt;
To drag and drop a folder, you must first compress/zip it using whichever program your computer has.&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/7WzrJDYK6jA | desc = Dragging and dropping files}}&lt;br /&gt;
&lt;br /&gt;
===Add a resource or activity===&lt;br /&gt;
*Instead of drag and drop, you can click the link &#039;Add an activity or resource&#039; and  select either [[File]] or [[Folder]] from the activity chooser (or choose from the  &#039;Add a resource&#039; drop down menu, if this is present instead.)&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/sym4KWInX3c | desc = Uploading files}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:filefolder23.png|thumb|Selecting a file or folder in the activity chooser]]&lt;br /&gt;
| [[File:Workingwithfiles.png|thumb|The &amp;quot;Add a resource&amp;quot; drop down menu]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*The screen for uploading and displaying a file (or folder of files) includes an &amp;quot;add&amp;quot; button. Clicking on this button takes you to the [[File picker]] which is the name given to the file storage and access area within Moodle. Find out more about the places you can upload or add files from in the [[File picker]] page.&lt;br /&gt;
*There is also a block (with an arrow) into which you can drag and drop a file straight from your desktop into Moodle.&lt;br /&gt;
&lt;br /&gt;
| [[File:newdraganddrop.png|thumb|Area for dragging and dropping files into]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Unzipping uploaded files==&lt;br /&gt;
If you upload a zipped file, you need to unzip it for your students to see the individual files in Moodle. If you drag and drop the zip file you will be prompted to unzip the files and add them to a folder.&lt;br /&gt;
If you manually upload a zipped file to a folder you need to click on the file and click the Unzip button to extract the files from the zip. Once you click save, the students will be able to see the unzipped files in the folder. &lt;br /&gt;
&lt;br /&gt;
==Viewing uploaded files==&lt;br /&gt;
&lt;br /&gt;
* Once uploaded, files appear as thumbnails in the file manager for easy recognition.&lt;br /&gt;
* Files view can be easily toggled between icons view or a table view with sizes and dates, or a hierarchical list view. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:truthumbnailsiconsview.png|thumb|File picker icon view]]&lt;br /&gt;
| [[File:tableview.png|thumb|File picker table view]]&lt;br /&gt;
| [[File:hierarchicallistview.png|thumb|File picker hierarchical list view]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Editing or updating uploaded files==&lt;br /&gt;
&lt;br /&gt;
*Clicking on the  name of an uploaded file opens up a pop up dialogue box which allows file details quickly to be altered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:popupdialogue.png|thumb|File info popup dialogue]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Creating an alias/shortcut==&lt;br /&gt;
&lt;br /&gt;
*When an uploaded file - or a file from the Private files, Dropbox, File system or EQUELLA repositories - is re-used elsewhere on Moodle, the teacher has the option to make a copy (a new, unconnected version) or to create a shortcut or &#039;&#039;alias&#039;&#039;. &lt;br /&gt;
*If an alias is created, then when the original file is updated, it will change in all instances of the alias. So a teacher might add course notes to their private files for example, and then add them into a number of courses. When the teacher makes an alteration in the file in their private files, this alteration will be reflected in all instances of the course notes.&lt;br /&gt;
*An alias can be recognised by its thumbnail. See the difference in the screenshot below between the original file (left) and the alias (right):&lt;br /&gt;
*To update a file, go to its original location (for example Private files) and upload your new version &#039;&#039;with the same name&#039;&#039; . You will be prompted to override or rename the file. Choose &amp;quot;override&amp;quot; and this file will replace your original file and the alisas/shortcuts will remain and all be updated to your latest version.&lt;br /&gt;
{|&lt;br /&gt;
| [[File:alias.png|thumb|Creating an alias]]&lt;br /&gt;
| [[File:shortcut1.png|frame]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Areas in which aliases cannot be made===&lt;br /&gt;
&lt;br /&gt;
An alias cannot be made in the following areas of Moodle:&lt;br /&gt;
&lt;br /&gt;
* an assignment submission&lt;br /&gt;
* a forum post attachment&lt;br /&gt;
* a workshop submission&lt;br /&gt;
* a quiz essay&lt;br /&gt;
* a database activity file field&lt;br /&gt;
&lt;br /&gt;
This is to prevent cases such as a student uploading an item for assessment and then subsequently changing the original in their private files. When a student uses a file from their private files in one of these instances, they do not see the options to &amp;quot;copy&amp;quot; or &amp;quot;create an alias&amp;quot;. Below is an example of a file added to an assignment:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:aliasassignment.png|thumb|Assignment submission with no option to create an alias]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Site administration settings==&lt;br /&gt;
&lt;br /&gt;
An administrator can add new file types and view, edit and delete existing file types from &#039;&#039;Site administration &amp;gt; Server &amp;gt; File types&#039;&#039;. This means that, for example, if teachers and students on your site use a lot of files specific to a particular program, such files can now be recognised by Moodle, and, when downloaded, they will open in the correct program, rather than presenting themselves as a generic zip file.&lt;br /&gt;
&lt;br /&gt;
[[File:Filetypes1.png|center|thumb|500px||Some examples from the list]]&lt;br /&gt;
&lt;br /&gt;
===Adding a new file type===&lt;br /&gt;
1. Scroll down to the bottom of the page and click the &amp;quot;Add&amp;quot; button&lt;br /&gt;
&lt;br /&gt;
2. Add the details of your file type, using the example below as a guide. This example will add the .mobi extension (for a Kindle ebook) with the standard document icon.&lt;br /&gt;
&lt;br /&gt;
[[File:newfiletype.png|thumb|center|500px|Adding a new filetype]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: The mimetype is set for a file when it is added/uploaded in Moodle (not when it is downloaded). If you change the mimetype associated with a file extension it will not make any difference to existing files. Only files uploaded in the future will have the new mimetype.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Click to save the changes and you will see your new file type has been added to the list:&lt;br /&gt;
&lt;br /&gt;
[[File:customfileypesuccess.png|thumb|500px|center|New type in the list]]&lt;br /&gt;
&lt;br /&gt;
===Restricting allowed file types===&lt;br /&gt;
&lt;br /&gt;
* Allowed file types for [[Workshop]] submissions may be restricted&lt;br /&gt;
* It is possible to restrict file types for assignments. See [[Assignment settings]].&lt;br /&gt;
&lt;br /&gt;
===Removing a file type===&lt;br /&gt;
*Clicking the X next to a file type will remove it from the site. You will be prompted to confirm before deletion.&lt;br /&gt;
&lt;br /&gt;
===Editing an existing file type===&lt;br /&gt;
*Clicking the edit icon next to a file type will allow you to change certain details, for example the associated icon and description. If you don&#039;t wish to use the default description, you can specify your own custom description (with multi-language tags if your site supports multi-languages) or you can use an alternative language string from mimetypes.php.&lt;br /&gt;
===Google docs and docx===&lt;br /&gt;
Importing Google docs files as docx.  See https://moodle.org/mod/forum/discuss.php?d=320144&lt;br /&gt;
&lt;br /&gt;
==Alternative to MS PowerPoint and PDF files==&lt;br /&gt;
The [https://moodle.org/plugins/mod_revealjs Presentation] additional plugin displays multimedia HTML5 presentations and slide shows in users&#039; web browsers. A web friendly and more feature rich alternative to MS PowerPoint and PDF. However, presentations must be uploaded to moodledata via FTP and you&#039;ll need to learn some basic HTML to create presentations for it.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*HQ Youtube video tutorial: [http://youtu.be/Wt5Hgv-eouE Dragging and dropping files into Moodle].&lt;br /&gt;
*HQ Youtube video tutorial: [http://youtu.be/7i2roZ_OCyI Uploading files to Moodle].&lt;br /&gt;
*[https://www.youtube.com/watch?v=hvIlEkxJPrU How to zip files on Windows 10] (the first part of the video shows the process for Windows 7&amp;amp;8 as well).&lt;br /&gt;
*[https://www.youtube.com/watch?v=V0wkG6zOpjA How to zip files on Mac].&lt;br /&gt;
*[http://lewiscarr.co.uk/2014/11/moodle-file-sharing-explained/ File sharing explained] blog post by Lewis Carr.&lt;br /&gt;
*How to share a single file with students: [[File resource]].&lt;br /&gt;
*How to share a folder of files with students: [[Folder]].&lt;br /&gt;
*Questions about the file picker: [[File picker FAQ]].&lt;br /&gt;
* [[Restoring file aliases]].&lt;br /&gt;
*[http://www.youtube.com/watch?v=IrOKxYRJvGU How teachers upload files in Moodle 2 video].&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=332701#p1340373 Powerpoint alternative..for course presentation ] forum thread.&lt;br /&gt;
&lt;br /&gt;
[[de:Arbeiten mit Dateien und Verzeichnissen]]&lt;br /&gt;
[[es:Trabajando con archivos]]&lt;br /&gt;
[[fr:Utilisation de fichiers]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Roles_FAQ&amp;diff=130249</id>
		<title>Roles FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Roles_FAQ&amp;diff=130249"/>
		<updated>2018-03-08T11:06:45Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* How can I prevent a user from changing their own password? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Roles}}&lt;br /&gt;
==What is the definition of a...==&lt;br /&gt;
&lt;br /&gt;
;Capability&lt;br /&gt;
:A configurable aspect of program behavior. Moodle has 100s of capabilities.   Each capability has a computer friendly name like [[Capabilities/mod/forum:rate|mod/forum:rate]] and a human-friendly name like &amp;quot;Rate posts.&amp;quot;&lt;br /&gt;
;Permission&lt;br /&gt;
:Permissions are paired with each  capability.  There are four possible permission values: &#039;&#039;Allow&#039;&#039;, &#039;&#039;Prevent&#039;&#039;, &#039;&#039;Prohibit&#039;&#039; and &#039;&#039;Not set&#039;&#039;/&#039;&#039;Inherit&#039;&#039;. (It is called not-set when defining roles and inherit when overriding permissions.)&lt;br /&gt;
;Role&lt;br /&gt;
:A named set of permissions that are associated with each capability. For example. the &amp;quot;Teacher&amp;quot; and &amp;quot;Student&amp;quot; roles come with the standard Moodle install.&lt;br /&gt;
;Context&lt;br /&gt;
:A functional area of Moodle. Contexts have a hierarchy.  Examples of contexts include a course, activity module, or resource.&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my role change taking effect?==&lt;br /&gt;
&lt;br /&gt;
Certain capabilities e.g. [[Capabilities/moodle/user:changeownpassword|moodle/user:changeownpassword]] may only be applied in the system context, so giving such permissions by assigning a role in the course context will have no effect.&lt;br /&gt;
&lt;br /&gt;
==Why do some users I know are in my course not appear in &#039;&#039;Participants&#039;&#039;?==&lt;br /&gt;
&lt;br /&gt;
Users assigned roles in a higher context, for example users assigned the role of teacher in the course category are technically not enrolled in the course and so will not appear in the Participants link in the [[Navigation block]] but can be found via &#039;&#039;Course administration &amp;gt; Users &amp;gt; Other users&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent a user from changing their own password?==&lt;br /&gt;
&lt;br /&gt;
==== Using roles ====&lt;br /&gt;
&lt;br /&gt;
To prevent a user from changing their own password, you must make sure they do not have [[Capabilities/moodle/user:changeownpassword|moodle/user:changeownpassword]] = Allow in the System context. The Authenticated user role (which is assigned to users in the System context) has moodle/user:changeownpassword = Allow by default, so you have two choices: &lt;br /&gt;
# Edit Authenticated user, setting moodle/user:changeownpassword = Not set &lt;br /&gt;
# Create a new role CannotChangeOwnPassword with moodle/user:changeownpassword = Prevent and all other permissions Not set. Choose &amp;quot;system&amp;quot; for the context type  and assign the role to selected users in the System context  via &#039;&#039;Administration&amp;gt;Site administration -&amp;gt; Users -&amp;gt; Permissions -&amp;gt; Assign system roles).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Choice (1) will prevent &#039;&#039;all&#039;&#039; users from changing their passwords (except for the administrator, who can do anything).  To selectively allow selected users (say teachers) to change their passwords, you could create a new role CanChangeOwnPassword with moodle/user:changeownpassword = Allow and all other permissions not set and assign the role to selected users in the System context (Site administration -&amp;gt; Users -&amp;gt; Permissions -&amp;gt; Assign system roles).&lt;br /&gt;
&lt;br /&gt;
Choice (2) allows you to be selective, but if you have a lot of users that you want to prevent (say, all students), you will have to make a lot of role assignments in the System context.  There is currently no convenient way to do this, so you might consider choice (1).&lt;br /&gt;
&lt;br /&gt;
Note that you MUST deal with this permission in the System context.&lt;br /&gt;
&lt;br /&gt;
==== Alternative solution ====&lt;br /&gt;
&lt;br /&gt;
Go to Site administration &amp;gt; Plugins &amp;gt; Manage authentication plugins. Find the &#039;forgottenpasswordurl&#039; setting and point it to a static HTML page on your server (or even a Moodle Page resource on the front page). Explain your password policy on that page. This stops users changing passwords. This applies to ALL users, however, so admins will need to fix any lost passwords for the whole site.&lt;br /&gt;
&lt;br /&gt;
==How can I prevent a user from editing their own profile?==&lt;br /&gt;
&lt;br /&gt;
See [[Roles_FAQ#How can I prevent a user from changing their own password? | How can I prevent a user from changing their own password?]]  The answer to this question is the same if you substitute &#039;&#039;edit their own profile&#039;&#039; for &#039;&#039;change their own password&#039;&#039; and &#039;&#039;[[Capabilities/moodle/user:editownprofile|moodle/user:editownprofile]]&#039;&#039; for &#039;&#039;moodle/user:changeownpassword.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== How can I allow a &amp;quot;test&amp;quot; Student user to see courses that are hidden?==&lt;br /&gt;
&lt;br /&gt;
Having a test user to try out courses before you open them to regular students is useful. But if the course is hidden, then the enroled test student will not be able to see it. The solution to this problem, if you do not wish to make the hidden course visible yet, is to create a &#039;&#039;Student tester rol&#039;&#039;, a clone of the default Student role and then set the ability to see hidden courses to Allow.&lt;br /&gt;
&lt;br /&gt;
* Create a new role in &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles &amp;gt; Add a new role&#039;&#039;, then for &#039;&#039;Use role or archtype&#039;&#039; choose &#039;&#039;ARCHETYPE: Student&#039;&#039; (or Student if you have customized the default Student role already)&lt;br /&gt;
* Give the role a new shortname and fullname as appropriate, e.g. studenttester, Student Tester&lt;br /&gt;
* Change the &#039;View hidden courses&#039; [[Capabilities/moodle/course:viewhiddencourses|course:viewhiddencourses]] capability from Not Set to Allow&lt;br /&gt;
* Click the &#039;Create this role button&#039;&lt;br /&gt;
&lt;br /&gt;
Now enrol your test student in the course using this new role instead of the Student role, and they will be able to see and work in the course as a normal student even when the course is hidden. They will not be able to see other hidden courses in which they are not enroled.&lt;br /&gt;
&lt;br /&gt;
==How do I change the name for &amp;quot;teacher&amp;quot; in the course description?==&lt;br /&gt;
&lt;br /&gt;
Either&lt;br /&gt;
* Edit the role of Teacher via &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and rename it. The new name will apply site-wide.&lt;br /&gt;
Or&lt;br /&gt;
* Create a duplicate teacher role with an alternative name and assign users the duplicate teacher role as appropriate in the course context. In &#039;&#039;Site administration &amp;gt; Appearance &amp;gt; Course contact&#039;&#039; select the alternative name for teacher that you wish to be displayed in the course description when courses are listed. For example, copy the standard teacher role and call it Instructor and only show that role as the course contact.&lt;br /&gt;
Or&lt;br /&gt;
* Create a new &amp;quot;dummy&amp;quot; role (no capabilities) with those names and assign them to teachers along with the real roles. select the alternative name for teacher that you wish to be displayed in the course description when courses are listed.  For example, copy the guest role, call it Lead Teacher and make this the course contact.  You may have 5 teachers in the course but only one name will appear as Lead Teacher.   If nobody is assigned the role Lead Teacher, no course contact will show.&lt;br /&gt;
Or&lt;br /&gt;
*Names for different roles in a course may be changed in the [[Course settings|Course administration &amp;gt; edit settings]] &amp;quot;Role renaming&amp;quot; fields.  For example, some courses the teacher wants the title &amp;quot;Professor&amp;quot;, or &amp;quot;Chief&amp;quot; or &amp;quot;Mentor&amp;quot;.  &lt;br /&gt;
Or&lt;br /&gt;
*[[Language customization|Edit the language files]] and change any word you want.&lt;br /&gt;
&lt;br /&gt;
==How do I enable teachers to set role overrides?==&lt;br /&gt;
&lt;br /&gt;
#Access &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039;.&lt;br /&gt;
#Edit the teacher role and change the capability [[Capabilities/moodle/role:safeoverride|moodle/role:safeoverride]] to allow.&lt;br /&gt;
#Click the button &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
#Click the tab &amp;quot;Allow role overrides&amp;quot; (in &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039;).&lt;br /&gt;
#Check the appropriate box(s) in the teacher row to set which role(s) teachers can override. Most likely it will just be the student role (you don&#039;t want teachers to be able to override admins!), so check the box where the teacher row intersects with the student column.&lt;br /&gt;
#Click the button &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==How do I enable teachers to assign other teachers in a course?==&lt;br /&gt;
&lt;br /&gt;
This is disabled by default but it can be switched on by modifying the teacher&#039;s role. In &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; select the &amp;quot;Allow role assignments&amp;quot; tab and tick the checkbox where Teacher and Teacher intersect.&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t &amp;quot;Switch role to..&amp;quot; within a course seem to work properly?==&lt;br /&gt;
&lt;br /&gt;
This feature is intended for teachers so that they can see how their course appears for students. It isn&#039;t a reliable view however, as some features do not display correctly when viewed by a teacher who has switched their role to a student. Certain actions (specifically submitting assignments) are excluded from working with &#039;switch roles&#039; (as the submitted work would not be visible on the grading pages, due to the user not having the &#039;submit&#039; permission when they have not switched roles).For that reason  it is always preferable where possible to have a &amp;quot;test&amp;quot; student log in to use.&lt;br /&gt;
&lt;br /&gt;
==How can I allow a non-editing teacher to &amp;quot;switch role to &amp;quot; a student?==&lt;br /&gt;
&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039;, edit the non-editing teacher role and set the capability &amp;quot;moodle/role:switchroles&amp;quot; to &amp;quot;allow&amp;quot;. This will then allow them to switch their role to a student or a guest (as defined on the &#039;&#039;Allow role switches&#039;&#039; screen.)&lt;br /&gt;
&lt;br /&gt;
==I accidentally deleted a default role. How do I get it back?==&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and click the &#039;Add a new role&#039; button&lt;br /&gt;
# Select the role e.g. Teacher to use&lt;br /&gt;
# Click continue&lt;br /&gt;
# Fill in the short name and custom full name&lt;br /&gt;
# Click the &#039;Create this role&#039; button&lt;br /&gt;
&lt;br /&gt;
==Are there any example roles?==&lt;br /&gt;
&lt;br /&gt;
Yes. See [[Creating_custom_roles#Example_custom_roles| the current list]].&lt;br /&gt;
&lt;br /&gt;
==How do I enable logged-in users to participate in front page activities?==&lt;br /&gt;
&lt;br /&gt;
Either:&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and edit the &#039;Authenticated user on frontpage&#039; role&lt;br /&gt;
# Allow capabilities for the front page activities&lt;br /&gt;
# Click the &#039;Save changes&#039; button&lt;br /&gt;
&lt;br /&gt;
Or:&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Front Page &amp;gt; Front Page settings&#039;&#039;&lt;br /&gt;
# Set the default front page role to student&lt;br /&gt;
# Click the &#039;Save changes&#039; button&lt;br /&gt;
&lt;br /&gt;
==How can I prevent students from editing their profile?==&lt;br /&gt;
&lt;br /&gt;
If you only want students to be prevented from editing their profile, and not all users, you can create a new role, such as Restricted user as described in the [[Demo teacher role]], with moodle/user:editownprofile set to prevent, and assign it to all students in the system context.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you could change moodle/user:editownprofile to not set for the [[Authenticated user role]], then create a new role for teachers with moodle/user:editownprofile set to allow.&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I add teachers or students site wide in Moodle?==&lt;br /&gt;
&lt;br /&gt;
You can, however teachers and students typically work in one or more individual courses. It is unusual for a student to be studying every single course on your Moodle and unusual for a teacher to be teaching every single course. Therefore, the default Moodle does not use these as system wide roles.  The Manager role might be one that makes sense to assign on a system or category context.&lt;br /&gt;
&lt;br /&gt;
To assign a teacher or student site-wide&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and edit the role to include the &#039;&#039;system&#039;&#039; context. &lt;br /&gt;
#Then search for and allow the capability [[Capabilities/moodle/course:view|moodle/course:view]]&lt;br /&gt;
#Then assign users to this role via &#039;&#039;Administration&amp;gt;Site administration&amp;gt;Users&amp;gt;Permissions&amp;gt;Assign system roles&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It might be preferable to create a new role based on the teacher or student and assign this in the System context.  Then assign individuals to that role.&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my custom role listed as an available role for assigning?==&lt;br /&gt;
&lt;br /&gt;
When adding/editing a custom role, be sure to tick one or more context types where the role may be assigned.&lt;br /&gt;
&lt;br /&gt;
[[File:context types where role may be assigned.png]]&lt;br /&gt;
&lt;br /&gt;
==How can I set a role back to default?==&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and click on the name of the role&lt;br /&gt;
# Click the Reset button&lt;br /&gt;
# Select items for reset as desired&lt;br /&gt;
# Click the continue button.&lt;br /&gt;
&lt;br /&gt;
==Permissions don&#039;t seem to be working correctly. What can I do?==&lt;br /&gt;
&lt;br /&gt;
[[File:reviewing badge permissions.png|thumb|Reviewing role permissions]]It is recommended that permissions for each role are reviewed and set according to the role archetype.&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and click the edit icon opposite a role&lt;br /&gt;
# Click the &#039;Show advanced&#039; button to reveal the different permission settings&lt;br /&gt;
# Review permissions (filtering for particular permissions as appropriate) and, unless there is a good reason to do otherwise, change permissions so that all are set to the highlighted value&lt;br /&gt;
# Click the &#039;Save changes&#039; button&lt;br /&gt;
# Repeat steps 1 to 4 for each role&lt;br /&gt;
&lt;br /&gt;
==Is there a role that can be safely used for a government inspector/supervisor ?==&lt;br /&gt;
The  [https://github.com/3-bits/moodle-role_sepe SEPE] role is used for a (Spanish) government supervisor who can access all Moodle courses without being able to change anything. It can be used in any other country/ language.&lt;br /&gt;
&lt;br /&gt;
==Any further questions?==&lt;br /&gt;
&lt;br /&gt;
Please visit the [http://moodle.org/mod/forum/view.php?id=6826 Roles and Capabilities forum] on moodle.org.&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[de:Rollen FAQ]]&lt;br /&gt;
[[es:FAQ_roles]]&lt;br /&gt;
[[fr:FAQ des rôles]]&lt;br /&gt;
[[ja:ロールFAQ]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=129642</id>
		<title>MySQL full unicode support</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=129642"/>
		<updated>2017-12-11T16:03:55Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Steps to upgrade */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
==UTF-8==&lt;br /&gt;
&lt;br /&gt;
UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored. Any attempt to enter a text that contains four byte characters will result in a Moodle database error.&lt;br /&gt;
&lt;br /&gt;
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured. From version 3.3 on Moodle uses full UTF-8 for both MySQL and MariaDB by default. Existing databases will still run with partial support, but it is recommended to move over to full support.&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a Command Line Interface (CLI) script for converting to full UTF-8 for MySQL (and MariaDB). Before Moodle versions 3.1.5 and 3.2.2 this conversion tool would only change the Collation to some variant of &#039;utf8_bin&#039;. &#039;utf8_unicode_ci&#039; was the recommended Collation. We now recommend using &#039;utf8mb4_unicode_ci&#039; which supports four byte characters (utf8_unicode_ci only supports three).&lt;br /&gt;
&lt;br /&gt;
This script will attempt to change the database Collation, Character set, default table settings and column definitions.&lt;br /&gt;
&lt;br /&gt;
To summarise:&lt;br /&gt;
&lt;br /&gt;
* Fresh installs of Moodle 3.1.5 and 3.2.2 onwards will use utf8mb4 by default, if the database server is configured appropriately (see below).&lt;br /&gt;
* Sites upgrading to Moodle 3.1.5 or 3.2.2 can use the script to update to utf8mb4. In Moodle 3.3 a warning will show that the database isn&#039;t using full UTF-8 support and suggest moving to &#039;utf8mb4_unicode_ci&#039;, but you may choose to keep using &#039;utf8_*&#039;.&lt;br /&gt;
&lt;br /&gt;
===File format===&lt;br /&gt;
&lt;br /&gt;
To allow for large indexes on columns that are a varchar, a combination of settings needs to be set. The file format for the system needs to be using &amp;quot;Barracuda&amp;quot;. This allows for the row format to be set to &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot;. To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===File per table===&lt;br /&gt;
&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===Large prefix===&lt;br /&gt;
&lt;br /&gt;
This in conjunction with the row format being either &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot; allows for large varchar indexes above 191 characters.&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
==Steps to upgrade==&lt;br /&gt;
&lt;br /&gt;
Most important: Please backup your database before making any changes or running the CLI script.&lt;br /&gt;
&lt;br /&gt;
* Change configuration settings for MySQL (exactly the same for MariaDB). This step is optional. You can run the script and it will try and make these changes itself. If errors occur then try manually changing these settings as listed below.&lt;br /&gt;
** On Linux based systems you will want to alter my.cnf. This may be located in &#039;/etc/mysql/&#039;.&lt;br /&gt;
** Make the following alterations to my.cnf:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_file_format = Barracuda&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_large_prefix&lt;br /&gt;
&lt;br /&gt;
character-set-server = utf8mb4&lt;br /&gt;
collation-server = utf8mb4_unicode_ci&lt;br /&gt;
skip-character-set-client-handshake&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart your MySQL server.&lt;br /&gt;
* Run the CLI script to convert to the new Character set and Collation (requires Moodle 3.1.5, 3.2.2 or newer): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: On very large sites this may take a long time to run. You should probably establish how long on a test install before taking your live site offline. In some cases you might consider dumping and re-importing your data.&lt;br /&gt;
&lt;br /&gt;
* Adjust the $CFG-&amp;gt;dboptions Array in your &#039;&#039;&#039;config.php&#039;&#039;&#039; to make sure that Moodle uses the right Collation when connecting to the MySQL Server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dboptions = array(&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
  &#039;dbcollation&#039; =&amp;gt; &#039;utf8mb4_unicode_ci&#039;,&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only have access to the database command line (or something like phpmyadmin) you can try the following sql commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SET GLOBAL innodb_file_format = barracuda&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_file_per_table = 1&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_large_prefix = &#039;on&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Try adding some Emojis (e.g. 😂💩) to your Moodle site to verify that the upgrade was successful.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|UTF-8]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:MySQL soporte unicode completo]]&lt;br /&gt;
[[fr:Support unicode complet pour MySQL]]&lt;br /&gt;
[[de:MySQL Unicode Unterstützung]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=129641</id>
		<title>MySQL full unicode support</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=MySQL_full_unicode_support&amp;diff=129641"/>
		<updated>2017-12-11T16:00:31Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Steps to upgrade */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
==UTF-8==&lt;br /&gt;
&lt;br /&gt;
UTF-8 is a character encoding that most websites use. It encodes each of the 1,112,064 valid code points. To store all of this information, four bytes is required. The most popular values are in the three byte region. MySQL by default only uses a three byte encoding and so values in the four byte range (eg. Asian characters and Emojis) can not be stored. Any attempt to enter a text that contains four byte characters will result in a Moodle database error.&lt;br /&gt;
&lt;br /&gt;
MySQL does provide full four byte UTF-8 support, but it requires certain database settings to be configured. From version 3.3 on Moodle uses full UTF-8 for both MySQL and MariaDB by default. Existing databases will still run with partial support, but it is recommended to move over to full support.&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a Command Line Interface (CLI) script for converting to full UTF-8 for MySQL (and MariaDB). Before Moodle versions 3.1.5 and 3.2.2 this conversion tool would only change the Collation to some variant of &#039;utf8_bin&#039;. &#039;utf8_unicode_ci&#039; was the recommended Collation. We now recommend using &#039;utf8mb4_unicode_ci&#039; which supports four byte characters (utf8_unicode_ci only supports three).&lt;br /&gt;
&lt;br /&gt;
This script will attempt to change the database Collation, Character set, default table settings and column definitions.&lt;br /&gt;
&lt;br /&gt;
To summarise:&lt;br /&gt;
&lt;br /&gt;
* Fresh installs of Moodle 3.1.5 and 3.2.2 onwards will use utf8mb4 by default, if the database server is configured appropriately (see below).&lt;br /&gt;
* Sites upgrading to Moodle 3.1.5 or 3.2.2 can use the script to update to utf8mb4. In Moodle 3.3 a warning will show that the database isn&#039;t using full UTF-8 support and suggest moving to &#039;utf8mb4_unicode_ci&#039;, but you may choose to keep using &#039;utf8_*&#039;.&lt;br /&gt;
&lt;br /&gt;
===File format===&lt;br /&gt;
&lt;br /&gt;
To allow for large indexes on columns that are a varchar, a combination of settings needs to be set. The file format for the system needs to be using &amp;quot;Barracuda&amp;quot;. This allows for the row format to be set to &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot;. To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===File per table===&lt;br /&gt;
&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
===Large prefix===&lt;br /&gt;
&lt;br /&gt;
This in conjunction with the row format being either &amp;quot;Compressed&amp;quot; or &amp;quot;Dynamic&amp;quot; allows for large varchar indexes above 191 characters.&lt;br /&gt;
To enable this setting see the upgrade steps listed below.&lt;br /&gt;
&lt;br /&gt;
==Steps to upgrade==&lt;br /&gt;
&lt;br /&gt;
Most important: Please backup your database before making any changes or running the CLI script.&lt;br /&gt;
&lt;br /&gt;
* Change configuration settings for MySQL (exactly the same for MariaDB). This step is optional. You can run the script and it will try and make these changes itself. If errors occur then try manually changing these settings as listed below.&lt;br /&gt;
** On Linux based systems you will want to alter my.cnf. This may be located in &#039;/etc/mysql/&#039;.&lt;br /&gt;
** Make the following alterations to my.cnf:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_file_format = Barracuda&lt;br /&gt;
innodb_file_per_table = 1&lt;br /&gt;
innodb_large_prefix&lt;br /&gt;
&lt;br /&gt;
character-set-server = utf8mb4&lt;br /&gt;
collation-server = utf8mb4_unicode_ci&lt;br /&gt;
skip-character-set-client-handshake&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart your MySQL server.&lt;br /&gt;
* Run the CLI script to convert to the new Character set and Collation (requires Moodle 3.1.5, 3.2.2 or newer): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: On very large sites this may take a long time to run. You should probably establish how long on a test install before taking your live site offline. In some cases it may consider dumping and re-importing your data.&lt;br /&gt;
&lt;br /&gt;
* Adjust the $CFG-&amp;gt;dboptions Array in your &#039;&#039;&#039;config.php&#039;&#039;&#039; to make sure that Moodle uses the right Collation when connecting to the MySQL Server: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;dboptions = array(&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
  &#039;dbcollation&#039; =&amp;gt; &#039;utf8mb4_unicode_ci&#039;,&lt;br /&gt;
  &amp;amp;hellip;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you only have access to the database command line (or something like phpmyadmin) you can try the following sql commands:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
SET GLOBAL innodb_file_format = barracuda&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_file_per_table = 1&lt;br /&gt;
&lt;br /&gt;
SET GLOBAL innodb_large_prefix = &#039;on&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Try adding some Emojis (e.g. 😂💩) to your Moodle site to verify that the upgrade was successful.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|UTF-8]]&lt;br /&gt;
[[Category:UTF-8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:MySQL soporte unicode completo]]&lt;br /&gt;
[[fr:Support unicode complet pour MySQL]]&lt;br /&gt;
[[de:MySQL Unicode Unterstützung]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=OAuth_2_Google_service&amp;diff=128980</id>
		<title>OAuth 2 Google service</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=OAuth_2_Google_service&amp;diff=128980"/>
		<updated>2017-10-23T10:07:32Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* OAuth 2 Google service setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OAuth2}}&lt;br /&gt;
==Features requiring the OAuth 2 Google service==&lt;br /&gt;
&lt;br /&gt;
You will need to set up an OAuth 2 Google service in order to use the following features:&lt;br /&gt;
&lt;br /&gt;
* [[Google Drive repository]]&lt;br /&gt;
* [[OAuth 2 authentication]] for enabling users to log in to Moodle with their Google account&lt;br /&gt;
* [[Google Drive converter]] for converting assignment submission files to PDF for teachers to annotate&lt;br /&gt;
&lt;br /&gt;
==OAuth 2 Google service setup==&lt;br /&gt;
&lt;br /&gt;
To set up an OAuth 2 client with Google, first we need to login to the [https://console.developers.google.com/ Google Developers Console] and create a new project.&lt;br /&gt;
&lt;br /&gt;
Create a new project using the menu at the top of the page.&lt;br /&gt;
&lt;br /&gt;
[[File:google-1-create-new.png|none|frame|Create new project]]&lt;br /&gt;
&lt;br /&gt;
Call the new project whatever you like, this name is not shown to users when they are asked to authorise this application.&lt;br /&gt;
&lt;br /&gt;
[[File:google-2-create-new-modal.png|none|frame|Name the project]]&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;credentials&amp;quot; from the menu on the left.&lt;br /&gt;
&lt;br /&gt;
[[File:google-3-credentials.png|none|frame|Switch to credentials page]]&lt;br /&gt;
&lt;br /&gt;
Setup the consent screen for your application. This is where you provide the public information that is shown to users when they are asked to authorise your application. Setting a product name is the minimum information that is required, but the more information you provide here - the more confidence users will have when granting this authorisation.&lt;br /&gt;
&lt;br /&gt;
[[File:google-4-consent.png|none|frame|Setup consent screen]]&lt;br /&gt;
&lt;br /&gt;
Now you can create some client credentials. Switch to the credentials tab and create a new OAuth client ID. &lt;br /&gt;
&lt;br /&gt;
[[File:google-5-oauth-credentials.png|none|frame|Create an OAuth Client ID]]&lt;br /&gt;
&lt;br /&gt;
Setup the credentials for a Web Application. The most important setting here is to set the callback URL (&amp;quot;Authorized redirect URI&amp;quot;). This must be set to &amp;quot;your moodle site url + /admin/oauth2callback.php&amp;quot;. If your moodle site was accessible at &amp;lt;nowiki&amp;gt;https://lemon.edu/&amp;lt;/nowiki&amp;gt; then this callback URL should be set to &amp;lt;nowiki&amp;gt;https://lemon.edu/admin/oauth2callback.php&amp;lt;/nowiki&amp;gt;. Make sure this box has saved properly.&lt;br /&gt;
&lt;br /&gt;
[[File:google-6-web-application-credentials.png|none|frame|Set the callback URL]]&lt;br /&gt;
&lt;br /&gt;
When you have saved the information on this page, Google will give you the client ID and client secret that you need to enter into Moodle.&lt;br /&gt;
&lt;br /&gt;
[[File:google-7-oauth-details.png|none|frame|Got my secrets!]]&lt;br /&gt;
&lt;br /&gt;
Finally we have to enable the Drive API (if we want to use the google drive repository or file converter plugins).&lt;br /&gt;
&lt;br /&gt;
[[File:google-8-library.png|none|frame|View the Library tab]]&lt;br /&gt;
&lt;br /&gt;
[[File:google-9-select-drive.png|none|frame|Select Drive API]]&lt;br /&gt;
&lt;br /&gt;
[[File:google-10-enable-drive.png|none|frame|Enable the API]]&lt;br /&gt;
&lt;br /&gt;
==App verification==&lt;br /&gt;
&lt;br /&gt;
NOTE: If you are just using this for document conversion you will not need to verify (as it only uses one account). You will, however, need to verify your ownership of your domain (see, [https://support.google.com/webmasters/answer/35179])&lt;br /&gt;
&lt;br /&gt;
The Google Drive repository and Google Drive converter also require the app to be verified by completing the [https://support.google.com/code/contact/oauth_app_verification OAuth Developer Verification Form]. The list of scopes that Moodle requires are: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;openid profile email https://www.googleapis.com/auth/drive&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See the discussion [https://moodle.org/mod/forum/discuss.php?d=356871 Google Drive Repository and Moodle 3.3.1] for more details.&lt;br /&gt;
&lt;br /&gt;
[[es:Servicio OAuth 2 Google]]&lt;br /&gt;
[[de:OAuth2 Google Service]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=OAuth_2_Google_service&amp;diff=128979</id>
		<title>OAuth 2 Google service</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=OAuth_2_Google_service&amp;diff=128979"/>
		<updated>2017-10-23T10:06:27Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* App verification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OAuth2}}&lt;br /&gt;
==Features requiring the OAuth 2 Google service==&lt;br /&gt;
&lt;br /&gt;
You will need to set up an OAuth 2 Google service in order to use the following features:&lt;br /&gt;
&lt;br /&gt;
* [[Google Drive repository]]&lt;br /&gt;
* [[OAuth 2 authentication]] for enabling users to log in to Moodle with their Google account&lt;br /&gt;
* [[Google Drive converter]] for converting assignment submission files to PDF for teachers to annotate&lt;br /&gt;
&lt;br /&gt;
==OAuth 2 Google service setup==&lt;br /&gt;
&lt;br /&gt;
To set up an OAuth 2 client with Google, first we need to login to the [https://console.developers.google.com/ Google Developers Console] and create a new project.&lt;br /&gt;
&lt;br /&gt;
Create a new project using the menu at the top of the page.&lt;br /&gt;
&lt;br /&gt;
[[File:google-1-create-new.png|none|frame|Create new project]]&lt;br /&gt;
&lt;br /&gt;
Call the new project whatever you like, this name is not shown to users when they are asked to authorise this application.&lt;br /&gt;
&lt;br /&gt;
[[File:google-2-create-new-modal.png|none|frame|Name the project]]&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;credentials&amp;quot; from the menu on the left.&lt;br /&gt;
&lt;br /&gt;
[[File:google-3-credentials.png|none|frame|Switch to credentials page]]&lt;br /&gt;
&lt;br /&gt;
Setup the consent screen for your application. This is where you provide the public information that is shown to users when they are asked to authorise your application. Setting a product name is the minimum information that is required, but the more information you provide here - the more confidence users will have when granting this authorisation.&lt;br /&gt;
&lt;br /&gt;
[[File:google-4-consent.png|none|frame|Setup consent screen]]&lt;br /&gt;
&lt;br /&gt;
Now you can create some client credentials. Switch to the credentials tab and create a new OAuth client ID. &lt;br /&gt;
&lt;br /&gt;
[[File:google-5-oauth-credentials.png|none|frame|Create an OAuth Client ID]]&lt;br /&gt;
&lt;br /&gt;
Setup the credentials for a Web Application. The most important setting here is to set the callback URL. This must be set to &amp;quot;your moodle site url + /admin/oauth2callback.php&amp;quot;. If your moodle site was accessible at &amp;lt;nowiki&amp;gt;https://lemon.edu/&amp;lt;/nowiki&amp;gt; then this callback URL should be set to &amp;lt;nowiki&amp;gt;https://lemon.edu/admin/oauth2callback.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:google-6-web-application-credentials.png|none|frame|Set the callback URL]]&lt;br /&gt;
&lt;br /&gt;
When you have saved the information on this page, Google will give you the client ID and client secret that you need to enter into Moodle.&lt;br /&gt;
&lt;br /&gt;
[[File:google-7-oauth-details.png|none|frame|Got my secrets!]]&lt;br /&gt;
&lt;br /&gt;
Finally we have to enable the Drive API (if we want to use the google drive repository or file converter plugins).&lt;br /&gt;
&lt;br /&gt;
[[File:google-8-library.png|none|frame|View the Library tab]]&lt;br /&gt;
&lt;br /&gt;
[[File:google-9-select-drive.png|none|frame|Select Drive API]]&lt;br /&gt;
&lt;br /&gt;
[[File:google-10-enable-drive.png|none|frame|Enable the API]]&lt;br /&gt;
&lt;br /&gt;
==App verification==&lt;br /&gt;
&lt;br /&gt;
NOTE: If you are just using this for document conversion you will not need to verify (as it only uses one account). You will, however, need to verify your ownership of your domain (see, [https://support.google.com/webmasters/answer/35179])&lt;br /&gt;
&lt;br /&gt;
The Google Drive repository and Google Drive converter also require the app to be verified by completing the [https://support.google.com/code/contact/oauth_app_verification OAuth Developer Verification Form]. The list of scopes that Moodle requires are: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;openid profile email https://www.googleapis.com/auth/drive&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
See the discussion [https://moodle.org/mod/forum/discuss.php?d=356871 Google Drive Repository and Moodle 3.3.1] for more details.&lt;br /&gt;
&lt;br /&gt;
[[es:Servicio OAuth 2 Google]]&lt;br /&gt;
[[de:OAuth2 Google Service]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Theme_settings&amp;diff=128946</id>
		<title>Theme settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Theme_settings&amp;diff=128946"/>
		<updated>2017-10-11T10:51:47Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Custom menu items */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Themes}}&lt;br /&gt;
== Theme settings ==&lt;br /&gt;
An administrator can change theme settings in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:Themesettings.png]]&lt;br /&gt;
&lt;br /&gt;
===Theme list===&lt;br /&gt;
This lists the themes available for course and user themes. Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you may specify a comma-separated list of names, though don&#039;t use spaces (e.g. standard,orangewhite).&lt;br /&gt;
&lt;br /&gt;
You can  preview the available themes in &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Themes selector.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Theme designer mode===&lt;br /&gt;
Turn this on if you are designing and testing themes as it will stop the themes being cached and enable you to see theme changes quickly. (You can also do this with the Clear theme cache button on the theme selector page.)&lt;br /&gt;
&lt;br /&gt;
===Allow user themes===&lt;br /&gt;
If the option &#039;&#039;allowuserthemes&#039;&#039; is enabled, each user may select their preferred theme on the edit profile page. All Moodle pages will be displayed in the user&#039;s theme, apart from courses where a course theme has been set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the user&#039;s theme will not be available in mobile and tablet devices unless the option &#039;&#039;enabledevicedetection&#039;&#039; is unchecked.&lt;br /&gt;
&lt;br /&gt;
===Allow course themes===&lt;br /&gt;
If you enable this, then teachers will be able to set their own course themes. Course themes override all other theme choices (site, user, or session themes).&lt;br /&gt;
&lt;br /&gt;
*If the option &#039;&#039;allowcoursethemes&#039;&#039; is enabled, each editing teacher may select their course theme via the Force theme option on the [[course/edit|Course settings]] page. The course will always be displayed in the theme specified in the course setting, with user and the site themes being overwritten.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the course theme will not be available in mobile and tablet devices unless the option &#039;&#039;enabledevicedetection&#039;&#039; is unchecked.&lt;br /&gt;
&lt;br /&gt;
===Allow category themes===&lt;br /&gt;
When enabled, themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance, as it will result in a few extra DB queries on each page, so only turn this on if you need it!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the category theme will not be available in mobile and tablet devices unless the option &#039;&#039;enabledevicedetection&#039;&#039; is unchecked.&lt;br /&gt;
&lt;br /&gt;
===Allow theme changes in the URL===&lt;br /&gt;
&lt;br /&gt;
*If this is checked then the theme may be changed by adding &amp;lt;code&amp;gt;?theme=theme_name&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;&amp;amp;theme=theme_name&amp;lt;/code&amp;gt; if there are other URL parameters) to the URL in the browser. &lt;br /&gt;
&lt;br /&gt;
Theme names used as the URL parameter should be the shortname of the theme, which you can see in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Plugins overview&#039;&#039; and scroll down to the Themes section near the bottom. Remove the &amp;quot;theme_&amp;quot; prefix to find the proper shortname. Theme shortnames are usually the same as the main theme name, eg. Clean is &#039;clean&#039;, so your URL parameter for it will be: &amp;lt;code&amp;gt;?theme=clean&amp;lt;/code&amp;gt;. Shortnames are always lower case. Themes with multiple words are usually the same but spaces are replaced by underscores, for example the theme &amp;quot;Formal white&amp;quot; should be entered as &amp;lt;code&amp;gt;?theme=formal_white&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:themeshortnames.jpg]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Tip:&#039;&#039; You can turn this on to aid in troubleshooting problems that may be theme related. This will allow you to switch to a standard or different theme for your own session without affecting other users or the site theme.&lt;br /&gt;
&lt;br /&gt;
===Allow users to hide blocks===&lt;br /&gt;
Allows users to display and hide blocks&lt;br /&gt;
&lt;br /&gt;
===Allow blocks to use the docks===&lt;br /&gt;
*If the theme allows it, then checking this will allow the user to move blocks to the side dock.&lt;br /&gt;
&lt;br /&gt;
===Custom menu items===&lt;br /&gt;
{{Note|The [[Boost theme]] does not support submenus in the custom menu setting.}}&lt;br /&gt;
&lt;br /&gt;
The custommenuitems setting allows you to create a drop down menu that can be displayed by themes that support it. &lt;br /&gt;
&lt;br /&gt;
You are able to create the custom menu by entering custom menu items one per line into the setting. Each item is preceded by a number of hyphens (-), the number of hyphens determines the depth of the item. So items that are &#039;&#039;&#039;NOT&#039;&#039;&#039; preceded by a hyphen appear on the top level of the menu (always visible), items with a single hyphen appear on a drop down menu below the previous top level item, and  items with two hyphens appear on a drop down menu below the previous first level item and so on - &#039;&#039;if the theme allows submenus.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The content of each item is constructed of up to three bits, each separated by a &#039;&#039;&#039;|&#039;&#039;&#039; (Shift + \) character. The bits are &#039;&#039;&#039;label&#039;&#039;&#039; | &#039;&#039;&#039;url&#039;&#039;&#039; | &#039;&#039;&#039;tooltip&#039;&#039;&#039;.&lt;br /&gt;
; label : This is the text that will be shown within the menu item. You must specify a label for every item on the menu.&lt;br /&gt;
; url : This is the URL that the user will be taken to it they click the menu item. This is optional, if not provided then the item will not link anywhere.&lt;br /&gt;
; tooltip : If you provide a URL you can also choose to provide a tooltip for the link that is created with the URL. This is optional and if not set the label is used as the tooltip for the menu item.&lt;br /&gt;
&lt;br /&gt;
The following is an example of how you would create a custom menu:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Moodle community|http://moodle.org&lt;br /&gt;
-Moodle free support|http://moodle.org/support&lt;br /&gt;
-Moodle development|http://moodle.org/development&lt;br /&gt;
--Moodle Tracker|http://tracker.moodle.org&lt;br /&gt;
--Moodle Docs|https://docs.moodle.org&lt;br /&gt;
-Moodle News|http://moodle.org/news&lt;br /&gt;
Moodle company&lt;br /&gt;
-Moodle commercial hosting|http://moodle.com/hosting&lt;br /&gt;
-Moodle commercial support|http://moodle.com/support&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The custom menu does not escape characters within the label. If you want to use a special HTML character such as an ampersand you must escape it yourself within the label. e.g. use &amp;amp;amp;amp; instead of &amp;amp;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Multilanguage support ====&lt;br /&gt;
&lt;br /&gt;
You can add a language code (or a comma separated list of codes) as the 4th item of the line. The line will be then printed if and only if the user has currently selected the listed language. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 English only|http://moodle.com|English only item|en&lt;br /&gt;
 German only|http://moodle.de|Deutsch|de,de_du,de_kids&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Adding other attributes to the HTML ====&lt;br /&gt;
Other attributes, such as &#039;&#039;&#039;target&#039;&#039;&#039; can be added:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 Moodle Homepage|http://moodle.org&amp;quot; target=&amp;quot;_blank&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first quote closes the href attribute, allowing other attributes to be added. Do not add the closing quotation mark on the final attribute, it is added automatically by Moodle.&lt;br /&gt;
&lt;br /&gt;
===User menu items===&lt;br /&gt;
&lt;br /&gt;
The customusermenuitems setting allows you to add or remove items from the user menu. &lt;br /&gt;
&lt;br /&gt;
Three items, Dashboard, Profile and Log out are automatically created and can not be changed. &lt;br /&gt;
&lt;br /&gt;
Other user menu items can be set in this area by removing them, reordering them, or adding custom ones. There are three default items:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
grades,grades|/grade/report/mygrades.php|grades&lt;br /&gt;
messages,message|/message/index.php|message&lt;br /&gt;
preferences,moodle|/user/preferences.php|preferences&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format for each is the | &amp;quot;pipe&amp;quot; character delineating three parts:&lt;br /&gt;
&lt;br /&gt;
# a string in &amp;quot;langstringname, componentname&amp;quot; form or as plain text &lt;br /&gt;
# a path to a file to run &lt;br /&gt;
# an icon either as a pix icon or as a path to a file URL&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
1) You can refer to a language string in the users language pack by its string name. For example, in the third line above for the default settings, &amp;quot;preferences&amp;quot; is the name of the language string, and &amp;quot;moodle&amp;quot; is the language file it is located in. See Language customisation for more information. If you put a text here instead of a reference to a language string, that text will always show up and not be language specific.&lt;br /&gt;
&lt;br /&gt;
2) The examples are to php files inside the Moodle site, so &amp;quot;/message/index.php&amp;quot; is the path on the current Moodle instance. You could also put a path or URL here to files outside of Moodle as well.&lt;br /&gt;
&lt;br /&gt;
3) The example defaults of icons point to files in the /pix/t/ directory on the Moodle server. You can use any of the pre-existing icon names there (without a file extension). You can add your images to that directory to expand the icon list, or you can prefix the icon name with ../ if you want to use icons from other pix folders. Alternatively, you can use a URL to point to a file elsewhere. &amp;quot;Icon&amp;quot; files are in both png and svg format. &lt;br /&gt;
&lt;br /&gt;
Tip: If you do not specify an icon, the Moodle will supply the gear icon that is used by &amp;quot;Preferences&amp;quot; next to the entry.&lt;br /&gt;
&lt;br /&gt;
Custom item example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Help Center|/course/view.php?id=2|check&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will add item called &amp;quot;Help Center&amp;quot; which links to a course on the same site with id=2 which has been set up as a help center for all users, and it will show using the standard check mark icon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:m32-defaultusermenuitems.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
===Enable device detection===&lt;br /&gt;
&lt;br /&gt;
If a tablet or mobile theme is set, AND the user is using a tablet or mobile, theme associated with the device is used, always overriding the course, category or user theme.&lt;br /&gt;
&lt;br /&gt;
If no tablet or mobile theme is set, course, category or user themes will be used.&lt;br /&gt;
&lt;br /&gt;
===Device detection regular expressions===&lt;br /&gt;
This will allow you to customize the theme selector options.   For example, you can add a custom theme for IE6 and another for Windows CE by entering the identifying expressions the browser sends and the &amp;quot;Return value&amp;quot; you want to display as the theme selectors &amp;quot;Device type&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Special themes==&lt;br /&gt;
&lt;br /&gt;
=== Session themes ===&lt;br /&gt;
Moodle offers an additional way to set a theme - the &#039;&#039;&#039;session theme&#039;&#039;&#039;. This is set with the URL and lasts until you log out. When you next login, the site/course/user themes are active again. This option is great for theme testing and works perfectly when you want to enable different themes for different situations.&lt;br /&gt;
&lt;br /&gt;
For example you can offer a special link for PDA users and integrate the session theme &#039;&#039;orangewhitepda&#039;&#039; in that link. Nobody needs to change any settings, you just click on that link. The session theme is called by the URL parameter &amp;lt;code&amp;gt;&amp;amp;theme=orangewhitepda&amp;lt;/code&amp;gt;. The whole URL  without the session theme could look like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://mymoodlesite.org/course/view.php?id=18&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and with the parameter for the PDA theme like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;http://mymoodlesite.org/course/view.php?id=18&amp;amp;theme=orangewhitepda&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In a standard Moodle installation, session themes are not active. To activate them the administrator must add the parameter &amp;lt;code&amp;gt;$CFG-&amp;gt;allowthemechangeonurl = true;&amp;lt;/code&amp;gt; to the Moodle &#039;&#039;config.php&#039;&#039; file in the Moodle base directory.&lt;br /&gt;
&lt;br /&gt;
=== Page theme ===&lt;br /&gt;
A page theme is for special page-only themes set by code, use &amp;lt;code&amp;gt;$PAGE-&amp;gt;force_theme()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Theme hierarchy ==&lt;br /&gt;
Here is the usual order that themes are considered by the Moodle interface.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px dashed #ddd&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;text-align:left&amp;quot;&lt;br /&gt;
!Theme type&lt;br /&gt;
! style=&amp;quot;background:#eee&amp;quot;|Overwrites&lt;br /&gt;
!Display&lt;br /&gt;
! style=&amp;quot;background:#eee&amp;quot;|Setting type&lt;br /&gt;
|- style=&amp;quot;vertical-align:top&amp;quot;&lt;br /&gt;
|Site&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;| - &lt;br /&gt;
|all pages*&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;|saved in theme profile&lt;br /&gt;
|- style=&amp;quot;vertical-align:top&amp;quot;&lt;br /&gt;
|User&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;|Site theme&lt;br /&gt;
|all pages*&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;|saved in user profile&lt;br /&gt;
|- style=&amp;quot;vertical-align:top&amp;quot;&lt;br /&gt;
|Course&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;|Site, user and session themes&lt;br /&gt;
|one course&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;|saved in course profile&lt;br /&gt;
|- style=&amp;quot;vertical-align:top&amp;quot;&lt;br /&gt;
|Session&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;|Site and user themes&lt;br /&gt;
|all pages*&lt;br /&gt;
|style=&amp;quot;background:#eee&amp;quot;|temporary until logout&lt;br /&gt;
|}&lt;br /&gt;
(* except courses with the course theme set)&lt;br /&gt;
&lt;br /&gt;
=== Change default  hierarchy===&lt;br /&gt;
The priority of themes can be set via the /moodle/config.php file. The order defines which theme wins when there are several set at different levels. You can set a variable called $CFG-&amp;gt;themeorder (see config-dist.php for more details). By default it is set to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;$CFG-&amp;gt;themeorder = array(&#039;course&#039;, &#039;category&#039;, &#039;session&#039;, &#039;user&#039;, &#039;site&#039;);&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Particular theme settings==&lt;br /&gt;
&lt;br /&gt;
Logo, tagline, link colour, column width, custom CSS and other settings for a particular theme may be set by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme name&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://youtu.be/QfhANg1MAZ0 Moodle Theme Settings Page]  MoodleBites video on YouTube &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Configuración de temas]]&lt;br /&gt;
[[fr:Réglages des thèmes]]&lt;br /&gt;
[[ja:テーマ設定]]&lt;br /&gt;
[[de:Design-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Course_categories&amp;diff=128623</id>
		<title>Course categories</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Course_categories&amp;diff=128623"/>
		<updated>2017-08-18T09:25:21Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Adding a category */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Courses}}&lt;br /&gt;
Course categories organize courses for all Moodle site participants. The default course category on a new Moodle site is &amp;quot;Miscellaneous&amp;quot; (although this can be renamed) A [[Course creator|Course creator]], [[Administrator|Administrator]] or [[Manager|Manager]] can put all courses in the Miscellaneous category. However, teachers and students will find it easier to find their classes if they are organized in descriptive categories.&lt;br /&gt;
&lt;br /&gt;
The list of courses within a category by default shows the teachers and the summary of each course. If the number of courses within a category exceeds 9 (10 or more), then a short list without teachers and summary is shown.&lt;br /&gt;
&lt;br /&gt;
==Adding a category==&lt;br /&gt;
Most people organize their courses by department and college or by topic. Be sure to test the organizational scheme with a few users before entering a large number of courses, to save time in moving them later.&lt;br /&gt;
&lt;br /&gt;
Adding categories is very simple:&lt;br /&gt;
&lt;br /&gt;
*Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Courses &amp;gt; Add a category&#039;&#039; &lt;br /&gt;
*Complete the details required and click &#039;Create category.&#039;&lt;br /&gt;
*Alternatively, you can go to &#039;&#039;Administration&amp;gt;Site administration&amp;gt;Courses&amp;gt;Manage courses and categories&#039;&#039; and click the link &#039;Create new category&#039;.&lt;br /&gt;
*If you are on the category page (or you only have Manager rights at a Course Category level), click the &#039;Manage courses&#039; button at the top-right of the page and then click the link &#039;Create new category&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:Addcategory.png]]&lt;br /&gt;
&lt;br /&gt;
If the category is visible, the course category description will be displayed to users when they enter the category, above the list of courses.&lt;br /&gt;
&lt;br /&gt;
==Editing or moving a category==&lt;br /&gt;
*You can edit the details of a course category by clicking the actions icon next to its name in &#039;&#039;Administration&amp;gt;Site administration&amp;gt;Courses&amp;gt;Manage courses and categories.&#039;&#039; and selecting &#039;Edit&#039;.&lt;br /&gt;
*You can move categories up or down by clicking the up/down arrow next to the category you wish to move. You can bulk move categories by checking the box to the left of their name and then by selecting from the dropdown &#039;Move selected categories to&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Editmovecategories.png]]&lt;br /&gt;
&lt;br /&gt;
==Adding sub-categories==&lt;br /&gt;
*Sometimes it might be useful to have a sub-category of a course. For example, you might have a category &amp;quot;Science&amp;quot; and wish to have sub-categories &amp;quot;Biology&amp;quot;, &amp;quot;Chemistry&amp;quot; and &amp;quot;Physics&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*You can make one category a subcategory of another by checking the box to the left of its name and then by selecting from the drop down menu &#039;Move selected categories to&#039; You can create a new, empty sub-category by clicking the actions icon next to its name in &#039;&#039;Administration&amp;gt;Site administration&amp;gt;Courses&amp;gt;Manage courses and categories.&#039;&#039; and selecting &#039;Create new subcategory.&#039;&lt;br /&gt;
&lt;br /&gt;
==Hiding categories==&lt;br /&gt;
*Categories may be easily hidden or shown via &#039;&#039;Administration&amp;gt;Site administration&amp;gt;Courses&amp;gt;Manage courses and categories&#039;&#039; and clicking the &#039;eye&#039; icon of the category you wish to hide.  Hidden categories are only visible to site administrators or those with the capability to &amp;quot;view hidden courses&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Sorting categories==&lt;br /&gt;
Categories may be sorted by ascending/descending names or ID numbers from &#039;&#039;Administration&amp;gt;Site administration&amp;gt;Courses&amp;gt;Manage courses and categories&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:categorysort.png|thumb|200px|center|Sorting categories]]&lt;br /&gt;
&lt;br /&gt;
Courses within categories may also be sorted. See [[Adding a new course]]&lt;br /&gt;
&lt;br /&gt;
==Setting category depth==&lt;br /&gt;
&lt;br /&gt;
You can limit the number of categories that are displayed in the front page &#039;List of Categories&#039; or &#039;Combo List&#039; from &#039;&#039;Administration&amp;gt;Site administration&amp;gt;Front page&amp;gt;Front page settings&#039;&#039; Deeper level categories will appear as links and the user can expand them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Assigning users a role in a course category==&lt;br /&gt;
&lt;br /&gt;
To assign a Manager at the Category level, see [[Manager_role#Assigning_the_role_of_Manager_at_the_Category_level | Assign Manager role at category level]].&lt;br /&gt;
&lt;br /&gt;
To enrol teacher or students roles category wide, see [[Category enrolments]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
===Screencasts===&lt;br /&gt;
[http://youtu.be/1N5Vs_OfVlA Course and category management]]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=47954 Course Summary Sometimes Not Appearing]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102803 Allowing teachers to put courses in categories]&lt;br /&gt;
&lt;br /&gt;
[[fr:Ajouter une catégorie de cours]]&lt;br /&gt;
[[es:Categorías de curso]]&lt;br /&gt;
[[de:Kursbereiche]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=128563</id>
		<title>Installation quick guide</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=128563"/>
		<updated>2017-08-11T09:50:56Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Create data directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. Otherwise please see [[Installing Moodle]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Basic Requirements==&lt;br /&gt;
&lt;br /&gt;
* You will need a working web server (e.g. [[Apache]]), a database (e.g. [[MySQL]], [[MariaDB]] or [[PostgreSQL]]) and have [[PHP]] configured. See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
* Moodle requires a number of [[PHP]] extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.&lt;br /&gt;
* If you want Moodle to send email (you probably do) you need a working Sendmail (Unix/Linux) on your server or access to an SMTP mail server.&lt;br /&gt;
&lt;br /&gt;
==Getting Moodle==&lt;br /&gt;
&lt;br /&gt;
You have two basic options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads ... OR&lt;br /&gt;
* 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 -b MOODLE_{{Version2}}_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the {{Version}} Stable branch. &lt;br /&gt;
&lt;br /&gt;
See [[Git_for_Administrators|Git for Administrators ]] for details on using Git to install Moodle code.&lt;br /&gt;
&lt;br /&gt;
Note: Only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories) cannot be guaranteed to work properly, be upgradable or be supportable.&lt;br /&gt;
&lt;br /&gt;
==Create a database==&lt;br /&gt;
&lt;br /&gt;
* Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a user/password combination with appropriate permissions for the database. For example (MySQL again):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO &#039;moodleuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;yourpassword&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: It is important to GRANT ON moodle.* as the database name including the &#039;.*&#039; and not just the bare database name. Save this password you use for the Moodle user, since you will need it later in the install.&lt;br /&gt;
&lt;br /&gt;
==Create data directory==&lt;br /&gt;
&lt;br /&gt;
* Create an empty directory to hold Moodle files. It &#039;&#039;&#039;must not&#039;&#039;&#039; be in the area served by the web server and must have permissions so that the web server user can write to it. Other than that it can be located anywhere. Typically, either make it owned by the web server user or give it write permissions for &#039;everyone&#039;. If it is on a shared/NFS drive then read [[Caching]] - Moodle caches to this disk area by default and a slow share will mean terrible performance.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
* If you downloaded the zip or tgz file earlier, then unzip / untar / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/html/moodle)&lt;br /&gt;
* Check the permissions and make sure that the web server does &#039;&#039;&#039;not&#039;&#039;&#039; have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).&lt;br /&gt;
* If you need to, configure your web server to serve the Moodle site with your chosen URL.&lt;br /&gt;
&lt;br /&gt;
==Configure Moodle==&lt;br /&gt;
&lt;br /&gt;
* In the Moodle code directory, find the file &#039;&#039;config-dist.php&#039;&#039; and copy it to a new file called &#039;&#039;config.php&#039;&#039; (but read next step, &#039;Install Moodle&#039;, first).&lt;br /&gt;
* Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. &#039;&#039;Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
* Go to the URL for your moodle site in a browser (installation will complete automatically) or run the command line version at (requires cli version of PHP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/bin/php /path/to/moodle/admin/cli/install.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The CLI creates the config.php for you and will not run if you created one in the previous step.&lt;br /&gt;
* After completing the install make sure your file permissions are ok for the Moodle program files (not writeable by web server) and the Moodle data files (writeable by web server).&lt;br /&gt;
&lt;br /&gt;
==Set up cron==&lt;br /&gt;
&lt;br /&gt;
You will need a cron job to run periodically. It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]]. A typical Unix cron entry will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your site &#039;&#039;&#039;will not work properly&#039;&#039;&#039; unless cron is running regularly. It is very important you do not skip this step.&lt;br /&gt;
&lt;br /&gt;
See [[Cron]] for details.&lt;br /&gt;
&lt;br /&gt;
==Congratulations!==&lt;br /&gt;
&lt;br /&gt;
You are now ready to use your Moodle site.&lt;br /&gt;
&lt;br /&gt;
If you run into problems, check the [[Installation FAQ]] and visit the [http://moodle.org/mod/forum/view.php?id=28 Installation help forum].&lt;br /&gt;
&lt;br /&gt;
[[Category:Quick guide]]&lt;br /&gt;
&lt;br /&gt;
[[ja:インストールクイックスタート]]&lt;br /&gt;
[[de:Installation in Kürze]]&lt;br /&gt;
[[fr:Installation_rapide]]&lt;br /&gt;
[[es:Inicio_Rápido_de_Instalación]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=128562</id>
		<title>Installation quick guide</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=128562"/>
		<updated>2017-08-11T09:49:08Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Install Moodle code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. Otherwise please see [[Installing Moodle]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Basic Requirements==&lt;br /&gt;
&lt;br /&gt;
* You will need a working web server (e.g. [[Apache]]), a database (e.g. [[MySQL]], [[MariaDB]] or [[PostgreSQL]]) and have [[PHP]] configured. See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
* Moodle requires a number of [[PHP]] extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.&lt;br /&gt;
* If you want Moodle to send email (you probably do) you need a working Sendmail (Unix/Linux) on your server or access to an SMTP mail server.&lt;br /&gt;
&lt;br /&gt;
==Getting Moodle==&lt;br /&gt;
&lt;br /&gt;
You have two basic options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads ... OR&lt;br /&gt;
* 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 -b MOODLE_{{Version2}}_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the {{Version}} Stable branch. &lt;br /&gt;
&lt;br /&gt;
See [[Git_for_Administrators|Git for Administrators ]] for details on using Git to install Moodle code.&lt;br /&gt;
&lt;br /&gt;
Note: Only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories) cannot be guaranteed to work properly, be upgradable or be supportable.&lt;br /&gt;
&lt;br /&gt;
==Create a database==&lt;br /&gt;
&lt;br /&gt;
* Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a user/password combination with appropriate permissions for the database. For example (MySQL again):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO &#039;moodleuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;yourpassword&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: It is important to GRANT ON moodle.* as the database name including the &#039;.*&#039; and not just the bare database name. Save this password you use for the Moodle user, since you will need it later in the install.&lt;br /&gt;
&lt;br /&gt;
==Create data directory==&lt;br /&gt;
&lt;br /&gt;
* Create an empty directory to hold Moodle files. It &#039;&#039;&#039;must not&#039;&#039;&#039; be in the area served by the web server and must have permissions so that the web server user can write to it. Typically, either make it owned by the web server user or give it write permissions for &#039;everyone&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
* If you downloaded the zip or tgz file earlier, then unzip / untar / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/html/moodle)&lt;br /&gt;
* Check the permissions and make sure that the web server does &#039;&#039;&#039;not&#039;&#039;&#039; have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).&lt;br /&gt;
* If you need to, configure your web server to serve the Moodle site with your chosen URL.&lt;br /&gt;
&lt;br /&gt;
==Configure Moodle==&lt;br /&gt;
&lt;br /&gt;
* In the Moodle code directory, find the file &#039;&#039;config-dist.php&#039;&#039; and copy it to a new file called &#039;&#039;config.php&#039;&#039; (but read next step, &#039;Install Moodle&#039;, first).&lt;br /&gt;
* Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. &#039;&#039;Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
* Go to the URL for your moodle site in a browser (installation will complete automatically) or run the command line version at (requires cli version of PHP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/bin/php /path/to/moodle/admin/cli/install.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The CLI creates the config.php for you and will not run if you created one in the previous step.&lt;br /&gt;
* After completing the install make sure your file permissions are ok for the Moodle program files (not writeable by web server) and the Moodle data files (writeable by web server).&lt;br /&gt;
&lt;br /&gt;
==Set up cron==&lt;br /&gt;
&lt;br /&gt;
You will need a cron job to run periodically. It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]]. A typical Unix cron entry will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your site &#039;&#039;&#039;will not work properly&#039;&#039;&#039; unless cron is running regularly. It is very important you do not skip this step.&lt;br /&gt;
&lt;br /&gt;
See [[Cron]] for details.&lt;br /&gt;
&lt;br /&gt;
==Congratulations!==&lt;br /&gt;
&lt;br /&gt;
You are now ready to use your Moodle site.&lt;br /&gt;
&lt;br /&gt;
If you run into problems, check the [[Installation FAQ]] and visit the [http://moodle.org/mod/forum/view.php?id=28 Installation help forum].&lt;br /&gt;
&lt;br /&gt;
[[Category:Quick guide]]&lt;br /&gt;
&lt;br /&gt;
[[ja:インストールクイックスタート]]&lt;br /&gt;
[[de:Installation in Kürze]]&lt;br /&gt;
[[fr:Installation_rapide]]&lt;br /&gt;
[[es:Inicio_Rápido_de_Instalación]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=128561</id>
		<title>Installation quick guide</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installation_quick_guide&amp;diff=128561"/>
		<updated>2017-08-11T09:48:29Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Pointless message in &amp;quot;advanced&amp;quot; section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
&#039;&#039;This page is intended for administrators who are experienced with installing web server applications and are in a hurry to get up and running. Otherwise please see [[Installing Moodle]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Basic Requirements==&lt;br /&gt;
&lt;br /&gt;
* You will need a working web server (e.g. [[Apache]]), a database (e.g. [[MySQL]], [[MariaDB]] or [[PostgreSQL]]) and have [[PHP]] configured. See the [{{Release notes}} release notes] in the dev docs for software requirements.&lt;br /&gt;
* Moodle requires a number of [[PHP]] extensions. However, Moodle checks early in the installation process and you can fix the problem and re-start the install script if any are missing.&lt;br /&gt;
* If you want Moodle to send email (you probably do) you need a working Sendmail (Unix/Linux) on your server or access to an SMTP mail server.&lt;br /&gt;
&lt;br /&gt;
==Getting Moodle==&lt;br /&gt;
&lt;br /&gt;
You have two basic options:&lt;br /&gt;
* Download your required version from http://moodle.org/downloads ... OR&lt;br /&gt;
* 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 -b MOODLE_{{Version2}}_STABLE git://git.moodle.org/moodle.git &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
...this fetches a complete copy of the Moodle repository and then switches to the {{Version}} Stable branch. &lt;br /&gt;
&lt;br /&gt;
See [[Git_for_Administrators|Git for Administrators ]] for details on using Git to install Moodle code.&lt;br /&gt;
&lt;br /&gt;
Note: Only download Moodle from one of the moodle.org sources. Other versions (e.g. control panel based installers, Linux distribution repositories) cannot be guaranteed to work properly, be upgradable or be supportable.&lt;br /&gt;
&lt;br /&gt;
==Create a database==&lt;br /&gt;
&lt;br /&gt;
* Using your chosen database server, create a new empty database. The default encoding must be UTF8. For example, using MySQL:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Create a user/password combination with appropriate permissions for the database. For example (MySQL again):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO &#039;moodleuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;yourpassword&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: It is important to GRANT ON moodle.* as the database name including the &#039;.*&#039; and not just the bare database name. Save this password you use for the Moodle user, since you will need it later in the install.&lt;br /&gt;
&lt;br /&gt;
==Create data directory==&lt;br /&gt;
&lt;br /&gt;
* Create an empty directory to hold Moodle files. It &#039;&#039;&#039;must not&#039;&#039;&#039; be in the area served by the web server and must have permissions so that the web server user can write to it. Typically, either make it owned by the web server user or give it write permissions for &#039;everyone&#039;.&lt;br /&gt;
&lt;br /&gt;
==Install Moodle code==&lt;br /&gt;
&lt;br /&gt;
* If you downloaded the zip or tgz file earlier, then unzip / untar / move / copy the Moodle code (obtained above) so that it will be served by your web server (e.g. on Debian based Linux, move to /var/www/moodle)&lt;br /&gt;
* Check the permissions and make sure that the web server does &#039;&#039;&#039;not&#039;&#039;&#039; have permissions to write to any of the files in the Moodle code directories (a very common root cause of sites being hacked).&lt;br /&gt;
* If you need to, configure your web server to serve the Moodle site with your chosen URL.&lt;br /&gt;
&lt;br /&gt;
==Configure Moodle==&lt;br /&gt;
&lt;br /&gt;
* In the Moodle code directory, find the file &#039;&#039;config-dist.php&#039;&#039; and copy it to a new file called &#039;&#039;config.php&#039;&#039; (but read next step, &#039;Install Moodle&#039;, first).&lt;br /&gt;
* Edit config.php with your favourite editor and change the appropriate settings to point to your site, directories and database. &#039;&#039;Note: the Moodle install script will create config.php for you if it does not exist but make sure you (re-)set permissions appropriately afterwards&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Install Moodle==&lt;br /&gt;
&lt;br /&gt;
* Go to the URL for your moodle site in a browser (installation will complete automatically) or run the command line version at (requires cli version of PHP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/bin/php /path/to/moodle/admin/cli/install.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The CLI creates the config.php for you and will not run if you created one in the previous step.&lt;br /&gt;
* After completing the install make sure your file permissions are ok for the Moodle program files (not writeable by web server) and the Moodle data files (writeable by web server).&lt;br /&gt;
&lt;br /&gt;
==Set up cron==&lt;br /&gt;
&lt;br /&gt;
You will need a cron job to run periodically. It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]]. A typical Unix cron entry will be as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your site &#039;&#039;&#039;will not work properly&#039;&#039;&#039; unless cron is running regularly. It is very important you do not skip this step.&lt;br /&gt;
&lt;br /&gt;
See [[Cron]] for details.&lt;br /&gt;
&lt;br /&gt;
==Congratulations!==&lt;br /&gt;
&lt;br /&gt;
You are now ready to use your Moodle site.&lt;br /&gt;
&lt;br /&gt;
If you run into problems, check the [[Installation FAQ]] and visit the [http://moodle.org/mod/forum/view.php?id=28 Installation help forum].&lt;br /&gt;
&lt;br /&gt;
[[Category:Quick guide]]&lt;br /&gt;
&lt;br /&gt;
[[ja:インストールクイックスタート]]&lt;br /&gt;
[[de:Installation in Kürze]]&lt;br /&gt;
[[fr:Installation_rapide]]&lt;br /&gt;
[[es:Inicio_Rápido_de_Instalación]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=128560</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=128560"/>
		<updated>2017-08-11T09:40:24Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* If something goes wrong... */&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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 (including host provided Moodle installers), you are strongly advised to only 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_{{Version2}}_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle {{Version}} 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 typically 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]] (recommended)&lt;br /&gt;
* [[MariaDB]] (recommended)&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (not recommended)&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 default way Moodle caches data you may have serious performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) redis or 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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? If you don&#039;t fully understand how file ownership and permissions work on your operating system it would be time very well spent to find out.&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=128559</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=128559"/>
		<updated>2017-08-11T09:38:19Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Create the (moodledata) data directory */&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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 (including host provided Moodle installers), you are strongly advised to only 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_{{Version2}}_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle {{Version}} 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 typically 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]] (recommended)&lt;br /&gt;
* [[MariaDB]] (recommended)&lt;br /&gt;
* [[MySQL]]&lt;br /&gt;
* [[MSSQL]]&lt;br /&gt;
* [[Oracle]] (not recommended)&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 default way Moodle caches data you may have serious performance issues if you use relatively slow storage (e.g. NFS) for this directory. Read the [[Performance_recommendations]] carefully and consider using (e.g.) redis or 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Cron&amp;diff=127367</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Cron&amp;diff=127367"/>
		<updated>2017-04-06T13:55:38Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* The web based Moodle cron command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The Moodle &#039;cron&#039; process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background.   The Moodle cron script runs different tasks at differently scheduled intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]].&lt;br /&gt;
&lt;br /&gt;
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows the simplest solution is to create a task in the Windows Task Scheduler and set it to run at regular intervals. On shared hosting, you should find the documentation (or ask support) how cron is configured. &lt;br /&gt;
&lt;br /&gt;
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a &#039;crontab&#039; which all users have.  &lt;br /&gt;
&lt;br /&gt;
== General discussion ==&lt;br /&gt;
&lt;br /&gt;
See the later sections for your server type; this section contains some general background information. &lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to implementing cron:&lt;br /&gt;
# identifying the correct command to run&lt;br /&gt;
# finding the right place on your system to put the command&lt;br /&gt;
&lt;br /&gt;
=== Working out the Moodle cron command ===&lt;br /&gt;
&lt;br /&gt;
Moodle has two different ways to deploy cron which use different scripts within the Moodle install. These are as follows...&lt;br /&gt;
# The CLI (command line interpreter) script. This will be at the path &amp;lt;pre&amp;gt;/path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; If in doubt, this is the correct script to use. This needs to be run by a &#039;PHP CLI&#039; program on your computer. So the final command may look something like &amp;lt;pre&amp;gt;/usr/bin/php /path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; You can (and should) try this on your command line to see if it works. &#039;&#039;&#039;WARNING: Check your command-line PHP version is compatible with your chosen version of Moodle. The command-line PHP program is different to the one running your web site and is not always the same version.&#039;&#039;&#039;&lt;br /&gt;
# If, for some reason, you cannot run the CLI script there is the web based script. Note that this is now deprecated and may be removed in future versions. This needs to be run from a web browser and will be accessed via a web url something like &#039;&#039;&#039;http://your.moodle.site/admin/cron.php&#039;&#039;&#039;. You can find command line based web browser (e.g. wget) so the final command may look like &amp;lt;pre&amp;gt;/usr/bin/wget http://your.moodle.site/admin/cron.php&amp;lt;/pre&amp;gt; This has the advantage that it can be run from *anywhere*. If you can&#039;t get cron to work on your machine it can be run somewhere else.&lt;br /&gt;
&lt;br /&gt;
===The web based Moodle cron command===&lt;br /&gt;
* If you have a choice, do not use the web based cron. It is likely to be removed in a future Moodle version. &lt;br /&gt;
* From Moodle 2.9 onwards, the cron job can no longer be run from web by default. You will get an error message:&lt;br /&gt;
 !!! Sorry, internet access to this page has been disabled by the administrator. !!! &lt;br /&gt;
* You can change this in &#039; Dashboard ► Site administration ► Security ► Site policies &#039; by deselecting &#039;Cron execution via command line only&#039;.&lt;br /&gt;
** You will be warned that &#039;Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.&#039;&lt;br /&gt;
** You can then write a &#039;Cron password for remote access&#039;. If this field is left empty, no password is required.&lt;br /&gt;
** This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:&lt;br /&gt;
  http://site.example.com/admin/cron.php?password=opensesame&lt;br /&gt;
&lt;br /&gt;
=== Finding the right place to put the command ===&lt;br /&gt;
&lt;br /&gt;
This really does depend on the system you are using and you should find and read the documentation for your platform or hosting. In most cases getting the Moodle cron to run consists of establishing the correct command (above) and then adding it, and the time to run the command, to some sort of file. This might be either through a specific user interface or by editing the file directly.&lt;br /&gt;
&lt;br /&gt;
If using the CLI version you also need to make sure that the cron process is run as the correct user. This is not an issue with the web version. &lt;br /&gt;
&lt;br /&gt;
Example... installing cron on Ubuntu/Debian Linux. Assuming logged in as root..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;use the crontab command to open a crontab editor window for the www-data user. This is the user that Apache (the web server) runs as on Debian based systems&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ crontab -u www-data -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;This will open an editor window. To run the cli cron script every 1 minute, add the line:&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/1 * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: the final &#039;&#039;&#039;&amp;gt;/dev/null&#039;&#039;&#039; sends all the output to the &#039;bin&#039; and stops you getting an email every 1 minute.&lt;br /&gt;
&lt;br /&gt;
== Setting up cron on your system ==&lt;br /&gt;
 &lt;br /&gt;
Choose the information for your server type:&lt;br /&gt;
&lt;br /&gt;
*[[Cron with Unix or Linux]]- Cron services on various UNIX and Linux flavored operating systems.&lt;br /&gt;
*[[Cron with Windows OS]] - Cron services in Windows&lt;br /&gt;
*&#039;&#039;Apple OSX&#039;&#039; - use the built-in &#039;crontab&#039; service which is exactly the same as [[Cron with Unix or Linux]]. However, you might want to do it the &#039;Apple way&#039; using launchd - see [[Cron with MAC OS X]]&lt;br /&gt;
*[[Cron with web hosting services]]- Cron services in various web hosting examples.&lt;br /&gt;
&lt;br /&gt;
Here are some more instructions for specific hosts (please check that these are up to date):&lt;br /&gt;
&lt;br /&gt;
*[[Cron on 1and1 shared servers]]&lt;br /&gt;
&lt;br /&gt;
== Using third party cron service ==&lt;br /&gt;
 &lt;br /&gt;
Besides using cron hosted on your own server, you may use third party cron service (usually called webcron):&lt;br /&gt;
&lt;br /&gt;
*[https://cron-job.org/ cron-job.org] is a free service. (1Minute cron is possible)&lt;br /&gt;
&lt;br /&gt;
*[https://www.easycron.com EasyCron] - A webcron service provider that eliminates the need of crontab or other task schedulers to set cron job.&lt;br /&gt;
&lt;br /&gt;
=== Cron settings in Moodle ===&lt;br /&gt;
&lt;br /&gt;
An admin can set cron execution via command line only or a cron password for remote access in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Remote cron===&lt;br /&gt;
Using the &#039;web based&#039; version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web &#039;page&#039; on a Windows based Moodle server.&lt;br /&gt;
&lt;br /&gt;
==Scheduling tasks==&lt;br /&gt;
An administrator can schedule cron tasks very precisely from Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks, see [[Scheduled tasks]]&lt;br /&gt;
&lt;br /&gt;
==Running cron for several Moodle servers==&lt;br /&gt;
* Tasks can run in parallel and processes use locking to prevent tasks from running at the same time which allows cron to be triggered from multiple web servers that serve the same Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* If you are running different Moodle instances on the same server, then each Moodle instance needs a cron job. (Even a single Apache web server can run different Moodle instances on different domains by using its virtual hosts capability [https://httpd.apache.org/docs/2.2/vhosts/index.html https://httpd.apache.org/docs/2.2/vhosts/index.html].)&lt;br /&gt;
&lt;br /&gt;
== Debugging Scheduled Tasks ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, a particular cron task may not be working correctly. In Moodle versions before 2.7 - any cron task that was throwing exceptions would prevent the rest of cron from running. The only way to monitor if cron was completing each time, was to add some automated checking of the output of running cron (e.g. searching for the string &amp;quot;Cron completed at &amp;quot;).&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.7 and later, a single failing scheduled task will not prevent the remaining tasks from completing. When any single scheduled task fails, it is marked as a failure, and scheduled to be reattempted. If the task keeps failing, the next scheduled time will be backed off until it is attempted at most once every 24 hours. But checking the [[Scheduled tasks]] admin page, you can see if any task is currently failing (it will have a non-zero fail delay - which is the number of seconds to wait before reattempting a failed task). A simple way to debug a failing task, is to run it immediately using the [[Administration via command line#Scheduled_tasks|cli scheduled task runner]] and monitor the output.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Scheduled tasks]]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Cron Wikipedia article on cron function]&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=139263#p609060 How to log the output of a Scheduled Task on Windows] - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=324443 Cron Lock] &lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[ja:Cron]]&lt;br /&gt;
[[de:Cron-Job]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Cron&amp;diff=127366</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Cron&amp;diff=127366"/>
		<updated>2017-04-06T13:54:54Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Working out the Moodle cron command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The Moodle &#039;cron&#039; process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background.   The Moodle cron script runs different tasks at differently scheduled intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is recommended that &#039;&#039;the cron is run every minute&#039;&#039;, as required for asynchronous activity deletion when using the [[Recycle bin|recycle bin]].&lt;br /&gt;
&lt;br /&gt;
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows the simplest solution is to create a task in the Windows Task Scheduler and set it to run at regular intervals. On shared hosting, you should find the documentation (or ask support) how cron is configured. &lt;br /&gt;
&lt;br /&gt;
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a &#039;crontab&#039; which all users have.  &lt;br /&gt;
&lt;br /&gt;
== General discussion ==&lt;br /&gt;
&lt;br /&gt;
See the later sections for your server type; this section contains some general background information. &lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to implementing cron:&lt;br /&gt;
# identifying the correct command to run&lt;br /&gt;
# finding the right place on your system to put the command&lt;br /&gt;
&lt;br /&gt;
=== Working out the Moodle cron command ===&lt;br /&gt;
&lt;br /&gt;
Moodle has two different ways to deploy cron which use different scripts within the Moodle install. These are as follows...&lt;br /&gt;
# The CLI (command line interpreter) script. This will be at the path &amp;lt;pre&amp;gt;/path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; If in doubt, this is the correct script to use. This needs to be run by a &#039;PHP CLI&#039; program on your computer. So the final command may look something like &amp;lt;pre&amp;gt;/usr/bin/php /path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; You can (and should) try this on your command line to see if it works. &#039;&#039;&#039;WARNING: Check your command-line PHP version is compatible with your chosen version of Moodle. The command-line PHP program is different to the one running your web site and is not always the same version.&#039;&#039;&#039;&lt;br /&gt;
# If, for some reason, you cannot run the CLI script there is the web based script. Note that this is now deprecated and may be removed in future versions. This needs to be run from a web browser and will be accessed via a web url something like &#039;&#039;&#039;http://your.moodle.site/admin/cron.php&#039;&#039;&#039;. You can find command line based web browser (e.g. wget) so the final command may look like &amp;lt;pre&amp;gt;/usr/bin/wget http://your.moodle.site/admin/cron.php&amp;lt;/pre&amp;gt; This has the advantage that it can be run from *anywhere*. If you can&#039;t get cron to work on your machine it can be run somewhere else.&lt;br /&gt;
&lt;br /&gt;
===The web based Moodle cron command===&lt;br /&gt;
* From Moodle 2.9 onwards, the cron job can no longer be run from web by default. You will get an error message:&lt;br /&gt;
 !!! Sorry, internet access to this page has been disabled by the administrator. !!! &lt;br /&gt;
* You can change this in &#039; Dashboard ► Site administration ► Security ► Site policies &#039; by deselecting &#039;Cron execution via command line only&#039;.&lt;br /&gt;
** You will be warned that &#039;Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.&#039;&lt;br /&gt;
** You can then write a &#039;Cron password for remote access&#039;. If this field is left empty, no password is required.&lt;br /&gt;
** This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:&lt;br /&gt;
  http://site.example.com/admin/cron.php?password=opensesame&lt;br /&gt;
&lt;br /&gt;
=== Finding the right place to put the command ===&lt;br /&gt;
&lt;br /&gt;
This really does depend on the system you are using and you should find and read the documentation for your platform or hosting. In most cases getting the Moodle cron to run consists of establishing the correct command (above) and then adding it, and the time to run the command, to some sort of file. This might be either through a specific user interface or by editing the file directly.&lt;br /&gt;
&lt;br /&gt;
If using the CLI version you also need to make sure that the cron process is run as the correct user. This is not an issue with the web version. &lt;br /&gt;
&lt;br /&gt;
Example... installing cron on Ubuntu/Debian Linux. Assuming logged in as root..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;use the crontab command to open a crontab editor window for the www-data user. This is the user that Apache (the web server) runs as on Debian based systems&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ crontab -u www-data -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;This will open an editor window. To run the cli cron script every 1 minute, add the line:&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/1 * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: the final &#039;&#039;&#039;&amp;gt;/dev/null&#039;&#039;&#039; sends all the output to the &#039;bin&#039; and stops you getting an email every 1 minute.&lt;br /&gt;
&lt;br /&gt;
== Setting up cron on your system ==&lt;br /&gt;
 &lt;br /&gt;
Choose the information for your server type:&lt;br /&gt;
&lt;br /&gt;
*[[Cron with Unix or Linux]]- Cron services on various UNIX and Linux flavored operating systems.&lt;br /&gt;
*[[Cron with Windows OS]] - Cron services in Windows&lt;br /&gt;
*&#039;&#039;Apple OSX&#039;&#039; - use the built-in &#039;crontab&#039; service which is exactly the same as [[Cron with Unix or Linux]]. However, you might want to do it the &#039;Apple way&#039; using launchd - see [[Cron with MAC OS X]]&lt;br /&gt;
*[[Cron with web hosting services]]- Cron services in various web hosting examples.&lt;br /&gt;
&lt;br /&gt;
Here are some more instructions for specific hosts (please check that these are up to date):&lt;br /&gt;
&lt;br /&gt;
*[[Cron on 1and1 shared servers]]&lt;br /&gt;
&lt;br /&gt;
== Using third party cron service ==&lt;br /&gt;
 &lt;br /&gt;
Besides using cron hosted on your own server, you may use third party cron service (usually called webcron):&lt;br /&gt;
&lt;br /&gt;
*[https://cron-job.org/ cron-job.org] is a free service. (1Minute cron is possible)&lt;br /&gt;
&lt;br /&gt;
*[https://www.easycron.com EasyCron] - A webcron service provider that eliminates the need of crontab or other task schedulers to set cron job.&lt;br /&gt;
&lt;br /&gt;
=== Cron settings in Moodle ===&lt;br /&gt;
&lt;br /&gt;
An admin can set cron execution via command line only or a cron password for remote access in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Remote cron===&lt;br /&gt;
Using the &#039;web based&#039; version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web &#039;page&#039; on a Windows based Moodle server.&lt;br /&gt;
&lt;br /&gt;
==Scheduling tasks==&lt;br /&gt;
An administrator can schedule cron tasks very precisely from Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks, see [[Scheduled tasks]]&lt;br /&gt;
&lt;br /&gt;
==Running cron for several Moodle servers==&lt;br /&gt;
* Tasks can run in parallel and processes use locking to prevent tasks from running at the same time which allows cron to be triggered from multiple web servers that serve the same Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* If you are running different Moodle instances on the same server, then each Moodle instance needs a cron job. (Even a single Apache web server can run different Moodle instances on different domains by using its virtual hosts capability [https://httpd.apache.org/docs/2.2/vhosts/index.html https://httpd.apache.org/docs/2.2/vhosts/index.html].)&lt;br /&gt;
&lt;br /&gt;
== Debugging Scheduled Tasks ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, a particular cron task may not be working correctly. In Moodle versions before 2.7 - any cron task that was throwing exceptions would prevent the rest of cron from running. The only way to monitor if cron was completing each time, was to add some automated checking of the output of running cron (e.g. searching for the string &amp;quot;Cron completed at &amp;quot;).&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.7 and later, a single failing scheduled task will not prevent the remaining tasks from completing. When any single scheduled task fails, it is marked as a failure, and scheduled to be reattempted. If the task keeps failing, the next scheduled time will be backed off until it is attempted at most once every 24 hours. But checking the [[Scheduled tasks]] admin page, you can see if any task is currently failing (it will have a non-zero fail delay - which is the number of seconds to wait before reattempting a failed task). A simple way to debug a failing task, is to run it immediately using the [[Administration via command line#Scheduled_tasks|cli scheduled task runner]] and monitor the output.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Scheduled tasks]]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Cron Wikipedia article on cron function]&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=139263#p609060 How to log the output of a Scheduled Task on Windows] - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=324443 Cron Lock] &lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[ja:Cron]]&lt;br /&gt;
[[de:Cron-Job]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Upload_users&amp;diff=127132</id>
		<title>Upload users</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Upload_users&amp;diff=127132"/>
		<updated>2017-03-16T14:30:36Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Hints */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Accounts}}&lt;br /&gt;
==Uploading users via text file==&lt;br /&gt;
&lt;br /&gt;
There are many 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;
&#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 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.&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 (eg, [https://notepad-plus-plus.org/ Notepad++]) 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. &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;
* The auth field must be used if the site uses an alternative authentication method, such as LDAP, as otherwise the authentication method will default to manual and users using a different auth method won&#039;t be able to log in.&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.&lt;br /&gt;
&lt;br /&gt;
For custom profile fields that are dates, use the ISO standard format YYYY-MM-DD, eg. 2014-06-19 which will then be properly localized in the interfaced.&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;code&amp;gt;suspended&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. If a user is previously set as inactive / suspended then a value of 0 will unsuspend them.&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;
*&#039;&#039;&#039;System role&#039;&#039;&#039; (Optional)&lt;br /&gt;
:&amp;lt;code&amp;gt;sysrole1,sysrole2,sysrole3&amp;lt;/code&amp;gt; etc&lt;br /&gt;
Users may be uploaded to a system role (usually Manager or Course creator)  by entering the shortname of that role. Other roles can only be uploaded if they have already been assigned in the &#039;system&#039; context. See [[Creating custom roles]]. Multiple roles can be assigned using &amp;lt;code&amp;gt;sysrole2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sysrole3&amp;lt;/code&amp;gt;, etc. fields. Note that the number suffix in no way relates to the number suffixes on the enrolment fields. The numbers must go up in sequence starting at 1.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Unassigning roles&#039;&#039;&#039;&lt;br /&gt;
Users can also be removed from a given system role by entering the shortname of that role prefixed with a minus symbol: &#039;-&#039;. If the user is currently assigned to that role, they are removed from it. If the user is not currently assigned to that system role, the field value is ignored. However, the field value must refer to a system role that does exist on the system, otherwise an error will occur.&lt;br /&gt;
[[File:GlobalRoles1.png|thumb|500px|center|Example of a file for uploading users with global/system roles]]&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;
==Upload user process==&lt;br /&gt;
&lt;br /&gt;
# Create file for uploading&lt;br /&gt;
# Go to &#039;&#039;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 various settings to better control the desired upload behaviour. These settings are found on the &amp;quot;Upload users preview&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: errors updating existing accounts can affect your users badly. &#039;&#039;&#039;&#039;&#039;Be careful&#039;&#039;&#039;&#039;&#039; when using the options to update.&lt;br /&gt;
&lt;br /&gt;
====Upload type====&lt;br /&gt;
The Upload type specifies how to handle existing accounts.&lt;br /&gt;
;Add new only, skip existing users : is the default Moodle upload type. It creates a new user account for each new record in the uploaded file. If an existing &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is found (i.e., the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; in the uploaded file matches an existing &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;, that record is &#039;&#039;&#039;skipped&#039;&#039;&#039;. By skipping the existing user account, the data in the existing record is not touched (in contrast to the &amp;quot;Add new and update existing users&amp;quot; option) and a second new user account is &#039;&#039;&#039;not&#039;&#039;&#039; created (in contrast to the &amp;quot;Add all, append number to usernames if needed&amp;quot; option). &lt;br /&gt;
;Add all, append number to usernames if needed : creates a new user account for each record in the uploaded file. If an existing user account is found, a new account will be created with a number appended to the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. For example, if a user account for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; &#039;jsmith&#039; already exists and a new record in the uploaded file contains a record for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; &#039;jsmith&#039; an additional user account is created with a 1 &#039;&#039;&#039;appended&#039;&#039;&#039; to the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; to produce user &#039;jsmith1&#039;. &lt;br /&gt;
;Add  new and update existing users : creates a new user account for each new user in the upload file. If an existing user account with the same &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; is found, the account information is &#039;&#039;&#039;updated&#039;&#039;&#039; by the data in the uploaded file. &lt;br /&gt;
;Update existing users only : ignores any new users found in the upload file and updates the user account if a matching &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; record is found in the uploaded file.&lt;br /&gt;
&lt;br /&gt;
====New user password====&lt;br /&gt;
When creating a new user account Moodle can create a new password (if one is not provided) or require a password in the uploaded file.&lt;br /&gt;
;Create password if needed : creates a default password for the new user account if one is not provided in the uploaded file.&lt;br /&gt;
;Field required in file : requires that a password be provided in the uploaded file in order. If a password is not provided, an error is generated and the user account is not created.&lt;br /&gt;
&lt;br /&gt;
====Existing user details====&lt;br /&gt;
The Existing user details options are only available when the Upload type allows existing user accounts to be updated. It specifies how Moodle should process user detail information for existing users.&lt;br /&gt;
;No changes : ignores user detail data in the uploaded and leaves the existing user account data unchanged.&lt;br /&gt;
;Override with file : overwrites data in the existing user account with the data provided in the uploaded file.&lt;br /&gt;
;Override with file and defaults : overwrites data in the existing user account with data provided in the uploaded file and fills in the default values for existing user details when no data is provided in the uploaded file.&lt;br /&gt;
;Fill in missing from file and defaults : adds data in the existing user account with data provided in the uploaded file if the field is empty (does not already contain data) and fills in the default values for existing user details when no data is provided in the uploaded file.&lt;br /&gt;
&lt;br /&gt;
====Existing user password====&lt;br /&gt;
The Existing user password option specifies how to handle password data for existing user accounts when Existing user details is set to overwrite data.&lt;br /&gt;
;No changes : ignores password field in the uploaded user file and leaves the existing user account password untouched&lt;br /&gt;
;Update : overwrites the existing user account password with the password provided in the uploaded file&lt;br /&gt;
&lt;br /&gt;
====Force password change====&lt;br /&gt;
The Force password change option specifies when to tag a user account so that the next login attempt will require the user to change the user&#039;s password.&lt;br /&gt;
;Users having a weak password : If the user account has a weak password as defined by the stie&#039;s [[Password_policy#Password_policy|Password policy]] then the user will be forced to change the password during the next login attempt. This option is not shown if there the site does not have a [[Password_policy#Password_policy|Password policy]], in other words &amp;lt;code&amp;gt;$CFG-&amp;gt;passwordpolicy&amp;lt;/code&amp;gt; must be set to see this option. &lt;br /&gt;
;None : None of the users in the uploaded file will be forced to change the password during the user&#039;s next login attempt.&lt;br /&gt;
;All : All of the users in the uploaded file will be forced to change the password during the user&#039;s next login attempt.&lt;br /&gt;
&lt;br /&gt;
====Allow renames====&lt;br /&gt;
If the uploaded flie contains the special &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; field, it is possible to rename a user from the &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; to a new &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. The default setting is to &#039;&#039;&#039;not&#039;&#039;&#039; allow renames. Keep in mind that renaming a user will require the user to use the new username when logging in.&lt;br /&gt;
;No : ignores the &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; field and leaves the existing user account&#039;s &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; field unchanged.&lt;br /&gt;
;Yes : allows the existing user account&#039;s &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; to be changed by the data provided in the uploaded file&#039;s &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; field. The &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; will be searched for and then updated with the data provided in the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; column. &lt;br /&gt;
&lt;br /&gt;
====Allow deletes====&lt;br /&gt;
If the uploaded file contains the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; special field, it is possible to use the upload file to delete existing user accounts. The default setting is to &#039;&#039;&#039;not&#039;&#039;&#039; allow deletes. Keep in mind that deleting a user account will prevent that user from logging in. As a protection, site administrator user accounts cannot be deleted with this method. &lt;br /&gt;
;No : ignores the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; special field in the uploaded file and leaves the existing user account unchanged&lt;br /&gt;
;Yes : allows the existing user account to be deleted when the value of the of the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; field is 1. &lt;br /&gt;
&lt;br /&gt;
====Allow suspending and activating of accounts====&lt;br /&gt;
If the uploaded file contains the &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt; special field, it is possible to use the upload file to either suspend or make active (unsuspend) existing user accounts. The default setting is to allow suspending/activating of existing user accounts. Keep in mind that suspending an existing user account will prevent that user from logging in. &lt;br /&gt;
;Yes : allows the existing user account to be suspended when the value of the of the &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt; field is 1. &lt;br /&gt;
;No : ignores the &amp;lt;code&amp;gt;suspended&amp;lt;/code&amp;gt; special field in the uploaded file and leaves the existing user account status unchanged.&lt;br /&gt;
&lt;br /&gt;
====Prevent email address duplicates====&lt;br /&gt;
It is possible, but &#039;&#039;&#039;not&#039;&#039;&#039; recommended to upload users with duplicate email addresses. By default, uploading users with duplicate email addresses is prevented. See MDL-38104 for some discussion. Further, since MDL-41115 added the ability for users to login with their email address it is even more important that duplicate email addresses be avoided.&lt;br /&gt;
&lt;br /&gt;
To allow duplicate email addresses, go to Site administration ► Plugins ► Authentication ► Manage authentication. You can tick &amp;quot;Allow accounts with same email&amp;quot;. Then on the upload users screen you will be allowed to change the &amp;quot;Prevent email address duplicates&amp;quot; setting. However, doing this is not recommended. For more info, see the [[Managing_authentication#Allow_accounts_with_same_email|Managing authentication]] docs page&lt;br /&gt;
;Yes : prevents user accounts from being created from the uploaded if an existing user account already has the same email address as found in the uploaded file&#039;s  &amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; column.&lt;br /&gt;
;No : allows user accounts to be created if an existing user account already has the same email address found in the uploaded file&#039;s  &amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; column.&lt;br /&gt;
&lt;br /&gt;
====Standardise usernames====&lt;br /&gt;
Standardise usernames is used by default to convert the username to all lower case and to strip out illegal characters. It is possible to not standardise the usernames; however, doing so is &#039;&#039;&#039;not&#039;&#039;&#039; recommended.&lt;br /&gt;
;Yes : standardises usernames found in the uploaded file before updating existing or creating new user accounts so that the username contains only lowercase letters and numbers.&lt;br /&gt;
;No : skips standardising usernames found in the uploaded file so that the newly created or updated usernames will be exactly as they are in the uploaded file (&#039;&#039;&#039;not recommended&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
For those seeking a more technical explanation, the process for standardising the usernames consists of ensuring the characters are all UTF-8 (fix_utf8) encoded, converting the username to lower case, and then stripping out non-letters/non-number characters (unless &#039;&#039;Site administration &amp;gt; Security &amp;gt; Site policies &amp;gt; Allow extended characters in usernames&#039;&#039; is set on) with something similar to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$username = preg_replace(&#039;/[^-\.@_a-z0-9]/&#039;, &#039;&#039;, $username);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Select for bulk user actions====&lt;br /&gt;
After the uploaded file has finished being processed (all new accounts have been created and existing accounts updated as specified by the previous settings), there is an option to select some of those user accounts to perform additional [[admin/user/user_bulk|bulk user actions]] such as &lt;br /&gt;
*Confirm user accounts created through Email-based self-registration which are not yet confirmed by the user&lt;br /&gt;
*Send a message (requires Messaging to be enabled)&lt;br /&gt;
*Delete user accounts&lt;br /&gt;
*Display a list of users on a page&lt;br /&gt;
*Download user data in text, ODS or Excel file format&lt;br /&gt;
*Force users to change their passwords&lt;br /&gt;
*Add users to a cohort&lt;br /&gt;
&lt;br /&gt;
By default, no users are selected for [[admin/user/user_bulk|bulk user actions]].&lt;br /&gt;
&lt;br /&gt;
;No : No users are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
;New users : Only newly created users are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
;Updated users : Only updated user accounts are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
;All users : All users found (existing updated users and newly created user accounts) in the uploaded file are selected for [[admin/user/user_bulk|bulk user actions]]&lt;br /&gt;
&lt;br /&gt;
===Default values===&lt;br /&gt;
&lt;br /&gt;
You can provide default user values for some fields not included in the uploaded file. Some fields include:&lt;br /&gt;
*Email display&lt;br /&gt;
*Forum auto-subscribe&lt;br /&gt;
*City/town&lt;br /&gt;
*ID number&lt;br /&gt;
*Institution&lt;br /&gt;
*Department&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;
==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; or &amp;quot;USA&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, as defined in the database fields.  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. The error will be &amp;quot;User not added - error&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The sizes of some common fields, in number of characters, are currently (3.2):&lt;br /&gt;
&lt;br /&gt;
*username - 100 	 &lt;br /&gt;
*password - 255 	 &lt;br /&gt;
*idnumber - 255 	 &lt;br /&gt;
*firstname - 100 	 &lt;br /&gt;
*lastname - 100 	 &lt;br /&gt;
*lastnamephonetic - 255 	 &lt;br /&gt;
*firstnamephonetic - 255 	 &lt;br /&gt;
*middlename - 255 	 &lt;br /&gt;
*alternatename - 255 &lt;br /&gt;
*institution -  255 	 &lt;br /&gt;
*department - 255 	 &lt;br /&gt;
*address - 255 	 &lt;br /&gt;
*city - 120 	 &lt;br /&gt;
*icq -15 	 &lt;br /&gt;
*skype - 50 	 &lt;br /&gt;
*yahoo - 50 	 &lt;br /&gt;
*aim - 50&lt;br /&gt;
*msn - 50 	 &lt;br /&gt;
*phone1 - 20 	 &lt;br /&gt;
*phone2  - 20&lt;br /&gt;
&lt;br /&gt;
===Time zones===&lt;br /&gt;
&lt;br /&gt;
The entry is case sensitive so &amp;lt;code&amp;gt;Europe/London&amp;lt;/code&amp;gt; will work but &amp;lt;code&amp;gt;europe/london&amp;lt;/code&amp;gt; will not. Use the names from the Timezone list found in &#039;&#039;Site administration &amp;gt; Location &amp;gt; Default timezone&#039;&#039; in their proper format.&lt;br /&gt;
&lt;br /&gt;
===All user fields listed here===&lt;br /&gt;
:All the user fields that are valid in an upload file are listed below, except for any custom fields you may have created (for which see below.)&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;firstname,lastname,username,email,password,auth,idnumber,institution,department,city,country,timezone,lang,mailformat,maildisplay,maildigest,htmleditor,autosubscribe,skype,msn,aim,yahoo,icq,phone1,phone2,address,url,description,descriptionformat,oldusername,deleted,suspended,alternatename,lastnamephonetic,firstnamephonetic,middlename&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
TIP: You can copy/paste the above as plain text and save it as a csv file to use as a template header for your upload files.&lt;br /&gt;
&lt;br /&gt;
The courses are listed by number as&amp;lt;pre&amp;gt;course1,course2,course3,course4&amp;lt;/pre&amp;gt; etc.&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;
===Capabilities===&lt;br /&gt;
&lt;br /&gt;
You may wish to create a limited role to allow some users access to this function. Create a role and assign to the user at the system/site level with the following capabilities allowed&lt;br /&gt;
* moodle/site:uploadusers&lt;br /&gt;
* moodle/role:assign&lt;br /&gt;
* In &#039;Allow role assignments&#039; permit this new role to assign the required roles&lt;br /&gt;
&lt;br /&gt;
In particular, don&#039;t forget the moodle/role:assign capability (even if these users have it in the courses they will be enrolling users in - it won&#039;t work).&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125737</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125737"/>
		<updated>2016-10-28T20:40:55Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Create the (moodledata) data directory */&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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 (including host provided Moodle installers), you are strongly advised to only 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_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 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 typically 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 default way Moodle caches data you may have serious 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125736</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125736"/>
		<updated>2016-10-28T20:38:17Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Download and copy files into place */&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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 (including host provided Moodle installers), you are strongly advised to only 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_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 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 typically 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125735</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125735"/>
		<updated>2016-10-28T20:36:51Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Download and copy files into place */&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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 (including host provided Moodle installers), you are strongly advised to only 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_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125734</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125734"/>
		<updated>2016-10-28T20:35:56Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* 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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require tuning to get the best out of Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125733</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125733"/>
		<updated>2016-10-28T20:34:26Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* 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]] (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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&lt;br /&gt;
&lt;br /&gt;
For very large sites, you are much better starting with a small pilot and gaining some experience and insight. A &amp;quot;what hardware do I need for 50,000 user?&amp;quot; style post in the forums is highly unlikely to get a useful answer.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125732</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=125732"/>
		<updated>2016-10-28T20:20:54Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Installation is complete :) */&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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 access Moodle through your web browser (using the same URL as you set during the install process), log in as your admin user and creatse a new course. See  [[Adding a new course|create a new course]].&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Security_keys&amp;diff=125508</id>
		<title>Security keys</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Security_keys&amp;diff=125508"/>
		<updated>2016-10-07T09:02:49Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Vital information missing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RSS feeds}}&lt;br /&gt;
A security key or token enables other systems to access Moodle securely. A security key may be used for secure RSS feeds or web services.&lt;br /&gt;
&lt;br /&gt;
A user can obtain a security key via the Preferences link of the user menu top right and then entering the key in an external application accessing Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: In order for this to be accessible the user needs the moodle/webservice:create token capability. The easiest way to do this is to allow the capability for the Authenticated User role. This does not allow the user to use web services, only to create a token.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At any time, a user can reset their key by clicking the reset link. A new different key is automatically generate which will then need to be entered in the external application.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The security keys page can not generate web service keys/tokens for admins. Admins can create a token manually from the administration block: &#039;&#039; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage tokens&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Secure RSS feeds==&lt;br /&gt;
&lt;br /&gt;
Secure RSS feeds are a way you can read [[Using_RSS_feeds|forum posts, blog entries, etc]] while you are offline, and without having to log in.  For example, if you want to read the posts in a forum, you usually need to log in to Moodle.  But if your site administrator has [[RSS_feeds_settings|enabled RSS]], these posts are available as a feed you can subscribe to with a [http://en.wikipedia.org/wiki/Comparison_of_feed_aggregators feed reader], and you can read entries even when you don&#039;t have access to the Internet.&lt;br /&gt;
&lt;br /&gt;
Secure RSS feeds allow your feed reader, which usually expects feeds to be publicly available, to download material from Moodle without having to log in.&lt;br /&gt;
&lt;br /&gt;
Whenever you are viewing an activity that provides an RSS feed, look in the Administration block for a link labelled &amp;quot;RSS feed of posts&amp;quot;.  This link is unique to your Moodle account.  Paste it into your feed reader to have it obtain new entries for you automatically.&lt;br /&gt;
&lt;br /&gt;
If you ever think your RSS feed token has been compromised in some way, e.g. you have lost a mobile phone that subscribed to a news forum, you can request a new one by clicking the &#039;&#039;Reset&#039;&#039; link on the &#039;&#039;Security Keys&#039;&#039; page from the Preferences link in your user menu.  This will disable the old feed token and generate a new one.  You can then visit the activities you wish to subscribe to and copy the URL, which will contain your new security key.&lt;br /&gt;
&lt;br /&gt;
[[Category:Web Services]]&lt;br /&gt;
&lt;br /&gt;
[[ja:セキュリティキー]]&lt;br /&gt;
[[es:Claves de seguridad]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=PHP&amp;diff=125420</id>
		<title>PHP</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=PHP&amp;diff=125420"/>
		<updated>2016-09-21T09:45:56Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* PHP Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
PHP is the scripting language in which Moodle is developed. It is integrated with your web server. The web server detects php pages (by their extension) and sends them to PHP for execution. PHP must be installed and configured properly for Moodle to work effectively (or at all). &lt;br /&gt;
&lt;br /&gt;
==PHP Settings==&lt;br /&gt;
Check these settings in your php.ini or .htaccess file (if you&#039;re using Apache). For settings which use ON/OFF as their values, you can substitute 1 for ON and 0 for OFF if you prefer. If you change php.ini, don&#039;t forget to restart the server. &lt;br /&gt;
* &#039;&#039;register_globals&#039;&#039; &#039;&#039;&#039;MUST&#039;&#039;&#039; be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* &#039;&#039;safe_mode&#039;&#039; needs to be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* &#039;&#039;memory_limit&#039;&#039; needs to be at least 96M (although some functions may not work if this low).  Moodle will refuse to install if lower. 128M is recommended. Large systems may need an even higher setting.&lt;br /&gt;
* &#039;&#039;session.save_handler&#039;&#039; needs to be set to FILES.&lt;br /&gt;
* &#039;&#039;magic_quotes_gpc&#039;&#039; should be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* &#039;&#039;magic_quotes_runtime&#039;&#039; needs to be OFF.&lt;br /&gt;
* &#039;&#039;file_uploads&#039;&#039; needs to be ON.&lt;br /&gt;
* &#039;&#039;session.auto_start&#039;&#039; needs to be OFF.&lt;br /&gt;
* &#039;&#039;session.bug_compat_warn&#039;&#039; needs to be OFF - (Feature removed as of PHP 5.4. PHP 5.4 is a minimum requirement of Moodle 2.7)&lt;br /&gt;
* The temp folder must be defined and writeable by your webserver user&lt;br /&gt;
* Check the error display/logging section. Make sure the settings are appropriate for your server use.&lt;br /&gt;
* &#039;&#039;post_max_size&#039;&#039; and &#039;&#039;upload_max_filesize&#039;&#039; restrict the maximum file size that can be uploaded.&lt;br /&gt;
* Check the &#039;&#039;[mail function]&#039;&#039; and database section (for your chosen database) to make sure they match your server configuration.&lt;br /&gt;
&lt;br /&gt;
==HTTP_RAW_POST_DATA errors==&lt;br /&gt;
Some users are experiencing $HTTP_RAW_POST_DATA related errors, when establishing connection between MNET servers or making AJAX web services requests.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Request for server name returned empty response&lt;br /&gt;
 &lt;br /&gt;
    line 134 of /mnet/lib.php: call to debugging()&lt;br /&gt;
    line 115 of /admin/mnet/peers.php: call to mnet_get_public_key()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These errors are affecting users running moodle on PHP 5.6 version and it&#039;s a PHP bug on the &#039;&#039;&#039;always_populate_raw_post_data&#039;&#039;&#039; setting the default value to 0.&lt;br /&gt;
&lt;br /&gt;
To avoid the error messages above, please change the value following setting on your php.ini file:&lt;br /&gt;
* &#039;&#039;&#039;always_populate_raw_post_data&#039;&#039;&#039; should be changed to &#039;&#039;&#039;-1&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
For more information about this bug, see: https://bugs.php.net/bug.php?id=66763&lt;br /&gt;
&lt;br /&gt;
==Finding the correct php.ini==&lt;br /&gt;
Sometimes it is not obvious where the php.ini file is located or you may even find more than one. To be certain run &#039;phpinfo&#039; - see below. The path of the php.ini file is a few lines down in the top section. &lt;br /&gt;
&lt;br /&gt;
Note that if you are using command-line (CLI) PHP for running cron (or anything else) it may be configured with a &#039;&#039;different&#039;&#039; php.ini file.  To check, run the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
php -i | grep php.ini&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PHP Extensions and libraries==&lt;br /&gt;
The following PHP extensions are required or recommended (some, e.g. iconv, ctype and tokenizer are now included in PHP by default). Others will need to be installed or selected.&lt;br /&gt;
* The &#039;&#039;&#039;iconv&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;mbstring&#039;&#039;&#039; extension is recommended.&lt;br /&gt;
* The &#039;&#039;&#039;curl&#039;&#039;&#039; extension is required (required for networking and web services).&lt;br /&gt;
* The &#039;&#039;&#039;openssl&#039;&#039;&#039; extension is recommended (required for networking and web services).&lt;br /&gt;
* The &#039;&#039;&#039;tokenizer&#039;&#039;&#039; extension is recommended.&lt;br /&gt;
* The &#039;&#039;&#039;xmlrpc&#039;&#039;&#039; extension is recommended (required for networking and web services).&lt;br /&gt;
* The &#039;&#039;&#039;soap&#039;&#039;&#039; extension is recommended (required for web services).&lt;br /&gt;
* The &#039;&#039;&#039;ctype&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;zip&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;gd&#039;&#039;&#039; extension is recommended (required for manipulating images).&lt;br /&gt;
* The &#039;&#039;&#039;simplexml&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;spl&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;pcre&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;dom&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;xml&#039;&#039;&#039; extension is required.&lt;br /&gt;
* The &#039;&#039;&#039;intl&#039;&#039;&#039; extension is recommended.&lt;br /&gt;
* The &#039;&#039;&#039;json&#039;&#039;&#039; extension is required.&lt;br /&gt;
* &#039;&#039;&#039;The appropriate extension for your chosen database is also required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Other PHP extensions may be required to support optional Moodle functionality, especially external authentication and/or enrolment (e.g. LDAP extension for LDAP authentication and the sockets extension for Chat server).&lt;br /&gt;
&lt;br /&gt;
==Installing (missing) extensions==&lt;br /&gt;
&lt;br /&gt;
This depends on how PHP was installed on your machine and what access you have. Here are some possibilities:&lt;br /&gt;
* If this is a hosted server you are likely to have to ask the administrator or hosting company. &lt;br /&gt;
* If PHP was compiled from source you will need to recompile, changing the &#039;configure&#039; settings - see [[Compiling PHP from source]].&lt;br /&gt;
* If it was installed using packages (typically Linux) you can install the required package (see your Linux distribution&#039;s documentation)&lt;br /&gt;
* If you are using Windows you just need to uncomment the appropriate DLL files in php.ini&lt;br /&gt;
&lt;br /&gt;
After making any changes or additions, don&#039;t forget to re-start your web server.&lt;br /&gt;
&lt;br /&gt;
== .htaccess files ==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have access to the php.ini file or there are conflicting requirements with other PHP applications on the same server you may be able to change PHP settings in an .htaccess file. This should be placed in the &#039;root&#039; of your Moodle installation (i.e. the same place as the config.php file). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The file isn&#039;t always called .htaccess and may not work at all. Contact your server administrator to be sure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Settings are made by adding lines in one of two formats:&lt;br /&gt;
* php_value &#039;&#039;name value&#039;&#039;&lt;br /&gt;
* php_flag &#039;&#039;name on/off&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
* &#039;&#039;&#039;php_value memory_limit 128M&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;php_flag register_globals off&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==PHP info==&lt;br /&gt;
&lt;br /&gt;
The phpinfo display contains information about the configuration of your PHP installation. This is useful for checking:&lt;br /&gt;
* that your PHP installation meets Moodle&#039;s system requirements.&lt;br /&gt;
* the values that are currently applied to your server&#039;s PHP install, e.g. File upload limits&lt;br /&gt;
* that you have installed the required modules needed for Moodle to work, e.g. the LDAP module for LDAP authentication.&lt;br /&gt;
&lt;br /&gt;
=== Displaying phpinfo in Moodle===&lt;br /&gt;
&lt;br /&gt;
An administrator can find PHP info in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Server &amp;gt; PHP info&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Displaying phpinfo outside of Moodle ===&lt;br /&gt;
&lt;br /&gt;
To view the phpinfo information:&lt;br /&gt;
* Create a file called info.php using your text editor, containing this single line:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code php&amp;gt;&lt;br /&gt;
 &amp;lt;?php phpinfo(); ?&amp;gt;&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Save this file as info.php&lt;br /&gt;
* Upload this file into the root web accessible folder on your server.&lt;br /&gt;
* Now open this file in your browser. For example &amp;lt;nowiki&amp;gt;http://&amp;lt;server-name&amp;gt;/info.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Compiling PHP from source]]&lt;br /&gt;
* [https://docs.moodle.org/dev/Moodle_and_PHP7 Moodle and PHP7] in the developers documentation&lt;br /&gt;
*http://www.php.net/ - the PHP web site&lt;br /&gt;
*http://php.iis.net/ - Microsoft PHP Installer for IIS&lt;br /&gt;
&lt;br /&gt;
[[de:PHP-Versionen für Moodle]]&lt;br /&gt;
[[es:PHP]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=admin/environment/php_setting/memory_limit&amp;diff=125402</id>
		<title>admin/environment/php setting/memory limit</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=admin/environment/php_setting/memory_limit&amp;diff=125402"/>
		<updated>2016-09-19T09:06:08Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Environment}}&lt;br /&gt;
&#039;&#039;memory_limit&#039;&#039; should be at least 96M. Large sites may need much more. PHP 5.2.x requires higher memory_limit values than previous versions of PHP. 64bit operating systems require even more memory.&lt;br /&gt;
&lt;br /&gt;
[[Category:Environment|PHP]]&lt;br /&gt;
&lt;br /&gt;
[[es:admin/environment/php setting/memory limit]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=124955</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=124955"/>
		<updated>2016-08-18T14:26:50Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Download and copy files into place */&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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_31_STABLE git://git.moodle.org/moodle.git  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options you might consider:&lt;br /&gt;
&#039;&#039;--depth=1&#039;&#039;  for shallow cloning (only) latest revision&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;--single-branch&#039;&#039;  to limit cloning to a single branch, this fetches the Moodle 3.1 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=124954</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=124954"/>
		<updated>2016-08-18T14:25:18Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: Removing some &amp;#039;wordiness&amp;#039; and some poor grammar.&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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&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). Do not expect the standard server configuration to be optimal for Moodle. For example, the web server and database servers will almost certainly require optimisation to work optimally with Moodle.&lt;br /&gt;
&lt;br /&gt;
If a hosting provider is being used  ensure that all Moodle [{{Release notes}}#Server_requirements requirments] (such as PHP version) are met by the hosting platform before attempting the installation. It will help to become familiar with changing settings within the hosting provider&#039;s platform (e.g. PHP file upload maximums) as the options and tools provided vary.&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_31_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.1 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=124953</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Installing_Moodle&amp;diff=124953"/>
		<updated>2016-08-18T14:21:57Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* 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]] (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. 8GB plus is likely on a large production server&lt;br /&gt;
* Consider separate servers for the web &amp;quot;front ends&amp;quot; and the database. It is much easier to &amp;quot;tune&amp;quot;&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]]. Moodle scales easily by increasing hardware.&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 is 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_31_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.1 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;
&lt;br /&gt;
For ease of use you can install Moodle via the web. We recommend configuring your web server so that the page is not publicly accessible until the installation is complete.&lt;br /&gt;
&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>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Administration_via_command_line&amp;diff=124042</id>
		<title>Administration via command line</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Administration_via_command_line&amp;diff=124042"/>
		<updated>2016-06-09T09:55:00Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Tool for converting tables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Running CLI scripts==&lt;br /&gt;
If you have shell access to your web server, you may find various CLI (command line interface) scripts useful during Moodle administration. Core admin CLI tools are located in the &amp;lt;code&amp;gt;admin/cli/*&amp;lt;/code&amp;gt; folder. Other plugins provide their CLI functionality via scripts in their own cli folder. For example, the enrol_db sync script is located in &amp;lt;code&amp;gt;enrol/db/cli/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To avoid problems with access control, you should run them as the owner of the web server process. It is especially important for CLI installation and upgrade as they create new files in moodledata directory and the web server has to have write access to them. In Linux distributions, the user that runs the web server is usually apache or wwrun or httpd or something similar. As a root, you will probably want to execute Moodle CLI scripts like this:&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/your/moodle/dir&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/somescript.php --params&lt;br /&gt;
&lt;br /&gt;
Most of the scripts accept common --help (or -h) parameter to display the full usage information, for example:&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/install.php --help&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
&lt;br /&gt;
Moodle can be upgraded from the command line. As with the installation script, there is either interactive or non-interactive mode of the upgrade. The script itself does not put the site into the maintenance mode, you have to do it on your own. Also, the script does not backup any data (if you read this page, you probably have some own scripts to backup your moodledata and the database, right?)&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/upgrade.php&lt;br /&gt;
&lt;br /&gt;
Upgrading via command line is a very comfortable way of Moodle upgrade if you use Git checkout of the Moodle source code (see [[Git for Administrators]]). See the following procedure how to upgrade your site within several seconds to the most recent version while preserving your eventual local customizations tracked in git repository:&lt;br /&gt;
&lt;br /&gt;
    $ cd /var/www/sites/moodle/htdocs/&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --enable&lt;br /&gt;
    $ git pull&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/upgrade.php&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --disable&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
There are two modes of installing Moodle from the command line. In interactive mode, the install script asks you for all data needed to properly set up new Moodle site. In non-interactive mode, you must provide all required data as the script parameters and then the new site is installed silently. The parameters can be passed in the interactive mode, too. The provided values are then used as the default values during the interactive session.&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/install.php --lang=cs&lt;br /&gt;
&lt;br /&gt;
If required, the database install may be skipped, with just config.php populated.&lt;br /&gt;
&lt;br /&gt;
   $ sudo -u apache /usr/bin/php admin/cli/install.php --skip-database&lt;br /&gt;
&lt;br /&gt;
== Maintenance mode ==&lt;br /&gt;
&lt;br /&gt;
To switch your site into the maintenance mode via CLI, you can use&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --enable&lt;br /&gt;
&lt;br /&gt;
To turn maintenance mode off, just execute the same script with --disable parameter.&lt;br /&gt;
&lt;br /&gt;
== Offline mode ==&lt;br /&gt;
&lt;br /&gt;
In some situations, you may want to switch your Moodle site into offline mode so that it is not accessible via the web but you can not stop the web server completely (typically because there are other web pages and applications running there). If a file called &amp;lt;code&amp;gt;climaintenance.html&amp;lt;/code&amp;gt; exists in the root folder of moodledata directory, Moodle will automatically display the contents of that file instead of any other page.&lt;br /&gt;
&lt;br /&gt;
    $ cd /var/www/sites/moodle/moodledata/&lt;br /&gt;
    $ echo &#039;&amp;amp;lt;h1&amp;amp;gt;Sorry, maintenance in progress&amp;amp;lt;/h1&amp;amp;gt;&#039; &amp;amp;gt; climaintenance.html&lt;br /&gt;
&lt;br /&gt;
You can prepare a nice formatted HTML page to inform your users about the server being down and keep in the moodledata directory under a name like &amp;lt;code&amp;gt;climaintenance.off&amp;lt;/code&amp;gt; and rename it to the &amp;lt;code&amp;gt;climaintenance.html&amp;lt;/code&amp;gt; if needed.&lt;br /&gt;
&lt;br /&gt;
== Custom site defaults ==&lt;br /&gt;
&lt;br /&gt;
During the install and upgrade via CLI, Moodle sets the administration variables to the default values. You can use different defaults. See MDL-17850 for details. Shortly, all you need to do is to add a file &amp;lt;code&amp;gt;local/defaults.php&amp;lt;/code&amp;gt; into your Moodle installation. The format of the file is like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$defaults[&#039;pluginname&#039;][&#039;settingname&#039;] = &#039;settingvalue&#039;; // for plugins&lt;br /&gt;
$defaults[&#039;moodle&#039;][&#039;settingname&#039;] = &#039;settingvalue&#039;;     // for core settings&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These defaults are used during install, upgrade and are also displayed as defaults on Site administration pages.&lt;br /&gt;
&lt;br /&gt;
== Reset user password ==&lt;br /&gt;
&lt;br /&gt;
If you happen to forget your admin password (or you want to set a password for any other user on the site), you can use reset_password.php script. The script sets the correctly salted password for the given user.&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/reset_password.php&lt;br /&gt;
&lt;br /&gt;
== MySQL storage engine conversion ==&lt;br /&gt;
&lt;br /&gt;
If you run your Moodle site with MySQL database backend and use the default MyISAM as the storage engine for your tables, you may want to convert them to use some more reliable engine like InnoDB (actually, you should want to switch to PostgreSQL ;-) anyway).&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/mysql_engine.php --engine=InnoDB&lt;br /&gt;
&lt;br /&gt;
==Converting InnoDB tables to Barracuda==&lt;br /&gt;
&lt;br /&gt;
Sites using MySQL with database tables using Antelope as the file format are recommended to convert the tables to the Barracuda file format.&lt;br /&gt;
&lt;br /&gt;
This is because tables using Antelope as the file format cannot handle more than 10 text columns. This file formats only supports &#039;&#039;compact&#039;&#039; and &#039;&#039;redundant&#039;&#039; row formats for backward compatibility reasons. This may cause a problem on larger sites when restoring a course, in which case the following error will be displayed: &lt;br /&gt;
&lt;br /&gt;
 Row size too large (&amp;gt;8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help.&lt;br /&gt;
&lt;br /&gt;
Barracuda is the newest innoDB file format. In addition to supporting &#039;&#039;compact&#039;&#039; and &#039;&#039;redundant&#039;&#039; row formats, Barracuda also supports &#039;&#039;compressed&#039;&#039; and &#039;&#039;dynamic&#039;&#039; row formats. &lt;br /&gt;
&lt;br /&gt;
However, converting tables to Barracuda is only recommended, and not required, since not all MySQL users are affected. (It may only be a problem for larger sites.)&lt;br /&gt;
&lt;br /&gt;
===Tool for converting tables===&lt;br /&gt;
&lt;br /&gt;
A command line tool is included in Moodle for converting tables to Barracuda.&lt;br /&gt;
&lt;br /&gt;
To view tables requiring conversion, use the list option:&lt;br /&gt;
&lt;br /&gt;
 $ php admin/cli/mysql_compressed_rows.php --list&lt;br /&gt;
&lt;br /&gt;
Here is an example output:&lt;br /&gt;
&lt;br /&gt;
 mdl_data                            Compact     (needs fixing) &lt;br /&gt;
 mdl_data_fields                     Compact     (needs fixing)&lt;br /&gt;
 mdl_enrol_paypal                    Compact     (needs fixing)&lt;br /&gt;
&lt;br /&gt;
To proceed with the conversion, run the command using the fix option:&lt;br /&gt;
&lt;br /&gt;
 $ php admin/cli/mysql_compressed_rows.php --fix&lt;br /&gt;
&lt;br /&gt;
Successful table conversion will be reported in the output, for example:&lt;br /&gt;
&lt;br /&gt;
 mdl_data                   ... Compressed&lt;br /&gt;
 mdl_data_fields            ... Compressed&lt;br /&gt;
 mdl_enrol_paypal           ... Compressed&lt;br /&gt;
&lt;br /&gt;
Please note that the commands must be executed on your moodle directory. Once tables are fixed, the warning message will no longer be displayed.&lt;br /&gt;
 &lt;br /&gt;
For further information on InnoDB file formats see the [http://dev.mysql.com/doc/innodb/1.1/en/glossary.html#glos_antelope MySQL InnoDB glossary - Antelope] and the [http://dev.mysql.com/doc/innodb/1.1/en/glossary.html#glos_barracuda MySQL InnoDB glossary - Barracuda].&lt;br /&gt;
&lt;br /&gt;
If you get errors due to having insufficient privileges to run these commands (this is quite likely) then the easiest solution is to generate the required SQL commands using,&lt;br /&gt;
&lt;br /&gt;
 $ php admin/cli/mysql_compressed_rows.php --showsql&lt;br /&gt;
&lt;br /&gt;
You can then copy the generated SQL into your mysql client running as the &#039;root&#039; user.&lt;br /&gt;
&lt;br /&gt;
== Running cron via command line ==&lt;br /&gt;
&lt;br /&gt;
In versions 1.x, you could execute admin/cron.php either from command line or via the web. Since Moodle 2.0, only admin/cli/cron.php script can be run via command line.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Scheduled tasks are automatically run by the cron script, but the specific tasks which run on each cron iteration are determined by the scheduled tasks configuration. It is possible to override the scheduled tasks configuration and run a single scheduled task immediately using the admin/tool/task/cli/schedule_task.php script. &lt;br /&gt;
&lt;br /&gt;
This script accepts the following arguments:&lt;br /&gt;
&lt;br /&gt;
 --list - list all the known scheduled tasks. The tasks are listed by the class name used to run the task. This class name is required as the argument to the next option in order to run a specific task immediately.&lt;br /&gt;
&lt;br /&gt;
 --execute=&amp;lt;task&amp;gt; - Runs a single scheduled task immediately - regardless of scheduling settings. This will even run disabled tasks. Tasks will still use locking to prevent concurrent execution of the same task - even on clusters. The format of the &amp;lt;task&amp;gt; argument must be the same as returned by the --list option above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must escape the &amp;quot;\&amp;quot; with an extra \ when using the --execute command. Take the following for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;php schedule_task.php --list&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
== List of scheduled tasks (http://yourserver.com/moodle) ==&lt;br /&gt;
\enrol_imsenterprise\task\cron_task                10 * * * * *      ASAP&lt;br /&gt;
\logstore_legacy\task\cleanup_task                 * 5 * * * *       ASAP&lt;br /&gt;
\logstore_standard\task\cleanup_task               * 4 * * * *       Wednesday, November 12, 2014, 4:35 AM&lt;br /&gt;
\mod_forum\task\cron_task                          * * * * * *       ASAP&lt;br /&gt;
\core\task\automated_backup_task                   50 * * * * *      ASAP&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the first task in that list, you would execute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;php schedule_task.php --execute=\\enrol_imsenterprise\\task\\cron_task&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database transfer==&lt;br /&gt;
&lt;br /&gt;
A command line script for [[Database transfer]] may be found in &#039;&#039;admin/tool/dbtransfer/cli/migrate.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Purge caches==&lt;br /&gt;
&lt;br /&gt;
You can purge caches using this script:&lt;br /&gt;
&lt;br /&gt;
  php admin/cli/purge_caches.php&lt;br /&gt;
&lt;br /&gt;
==Fix course / module sequences==&lt;br /&gt;
&lt;br /&gt;
In rare cases (such as after upgrading from a very old version of Moodle), the course / section / module sequence data can be out of sync. This can cause various problems for affected courses, such as sections not appearing, backups failing, pages not displaying etc. There is a specific check to check for errors caused by this problem, and to fix the data in the database if they are found. To run this script please use the command below:&lt;br /&gt;
&lt;br /&gt;
  php admin/cli/fix_course_sequence.php -c=* --fix&lt;br /&gt;
&lt;br /&gt;
This will check every course in Moodle and report which ones had errors and were fixed.&lt;br /&gt;
&lt;br /&gt;
==Fix orphaned question categories==&lt;br /&gt;
&lt;br /&gt;
When a quiz is created, a new question category for the quiz is automatically created. In versions of Moodle prior to 2.9.1, if the quiz is deleted, the question category and any questions in the category remain in database. These orphaned question categories may be fixed by running the admin/cli/fix_orphaned_question_categories.php script with the --fix option.&lt;br /&gt;
&lt;br /&gt;
==Search and replace text==&lt;br /&gt;
&lt;br /&gt;
This script can be used to search and replace text throughout the whole database. Use carefully and backup first always. More info in [[Search and replace tool]].&lt;br /&gt;
&lt;br /&gt;
  php admin/tool/replace/cli/replace.php --search=//oldsitehost --replace=//newsitehost&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* MDL-35736 - Manage plugins via command line&lt;br /&gt;
* MDL-36237 - Resort course list via CLI&lt;br /&gt;
* [http://moosh-online.com/ MOOSH] - MOOdle SHell. It is a commandline tool that will allow you to perform most common Moodle tasks.&lt;br /&gt;
&lt;br /&gt;
[[fr:Administration en ligne de commande]]&lt;br /&gt;
[[de:Administration über Kommandozeile]]&lt;br /&gt;
[[ja:コマンドライン経由の管理]]&lt;br /&gt;
[[es:Administración por línea de comando]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123675</id>
		<title>Universal Office Converter (unoconv)</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123675"/>
		<updated>2016-05-19T08:55:01Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Installing unoconv on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Installing unoconv=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;unoconv&amp;quot; is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. &lt;br /&gt;
&lt;br /&gt;
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. &lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Linux ==&lt;br /&gt;
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:&lt;br /&gt;
&lt;br /&gt;
(Ubuntu 16.04 LTS)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.&lt;br /&gt;
&lt;br /&gt;
Potential problems:&lt;br /&gt;
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).&lt;br /&gt;
* If you are still running 14.04LTS then unoconv won&#039;t work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing &#039;python&#039; in the first line to &#039;python3&#039;. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on OS X ==&lt;br /&gt;
Download and install LibreOffice for Mac. Make sure to run it and verify it is working before continuing.&lt;br /&gt;
&lt;br /&gt;
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install ghostscript&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Windows ==&lt;br /&gt;
Download and install LibreOffice for windows.&lt;br /&gt;
&lt;br /&gt;
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. &lt;br /&gt;
&lt;br /&gt;
Rename the downloaded script to C:\unoconv\unoconv.py&lt;br /&gt;
&lt;br /&gt;
Create a batch file C:\unoconv\unoconv.bat with these contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@cd &amp;quot;C:\Program Files (x86)\LibreOffice 5\program&amp;quot;&lt;br /&gt;
@&amp;quot;python-core-3.3.0\bin\python.exe&amp;quot; unoconv.py %* &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set paths in Moodle. &lt;br /&gt;
&lt;br /&gt;
Login as admin and go to Site administration ► Server ► System paths&lt;br /&gt;
&lt;br /&gt;
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)&lt;br /&gt;
&lt;br /&gt;
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)&lt;br /&gt;
&lt;br /&gt;
Test ghostscript and unoconv are working correctly in the admin test pages &amp;quot;Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Run a unoconv listener ==&lt;br /&gt;
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it&#039;s request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.&lt;br /&gt;
&lt;br /&gt;
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.&lt;br /&gt;
&lt;br /&gt;
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]&lt;br /&gt;
&lt;br /&gt;
== Offload processing to a different server ==&lt;br /&gt;
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.&lt;br /&gt;
&lt;br /&gt;
How to do this:&lt;br /&gt;
&lt;br /&gt;
Install unoconv on each webservers and the remote server following the installation instructions above. &lt;br /&gt;
&lt;br /&gt;
Make sure unoconv is started at boot time on the remote server with the &amp;quot;--listener&amp;quot; argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). &lt;br /&gt;
&lt;br /&gt;
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.&lt;br /&gt;
&lt;br /&gt;
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. &lt;br /&gt;
&lt;br /&gt;
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# Wrapper script for unoconv to forward processing.&lt;br /&gt;
# Install to /usr/bin/unoconv-remote with 755 permissions&lt;br /&gt;
/usr/bin/unoconv --server=&amp;lt;ip of remote server&amp;gt; &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
{{Installing_Moodle}}&lt;br /&gt;
&lt;br /&gt;
[[es:mod/assign/feedback/editpdf/testunoconv]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123674</id>
		<title>Universal Office Converter (unoconv)</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Universal_Office_Converter_(unoconv)&amp;diff=123674"/>
		<updated>2016-05-19T08:53:01Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Installing unoconv on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Installing unoconv=&lt;br /&gt;
&lt;br /&gt;
&amp;quot;unoconv&amp;quot; is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. &lt;br /&gt;
&lt;br /&gt;
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. &lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Linux ==&lt;br /&gt;
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:&lt;br /&gt;
&lt;br /&gt;
(Ubuntu 16.04 LTS)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.&lt;br /&gt;
&lt;br /&gt;
Potential problems:&lt;br /&gt;
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).&lt;br /&gt;
* If you are still running 14.04LTS then unoconv won&#039;t work as shipped. This might not be the most efficient route but it worked by installing unoconv from the package manager as above. You will need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing &#039;python&#039; in the first line to &#039;python3&#039;. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on OS X ==&lt;br /&gt;
Download and install LibreOffice for Mac. Make sure to run it and verify it is working before continuing.&lt;br /&gt;
&lt;br /&gt;
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install unoconv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install ghostscript&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.&lt;br /&gt;
&lt;br /&gt;
== Installing unoconv on Windows ==&lt;br /&gt;
Download and install LibreOffice for windows.&lt;br /&gt;
&lt;br /&gt;
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. &lt;br /&gt;
&lt;br /&gt;
Rename the downloaded script to C:\unoconv\unoconv.py&lt;br /&gt;
&lt;br /&gt;
Create a batch file C:\unoconv\unoconv.bat with these contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@cd &amp;quot;C:\Program Files (x86)\LibreOffice 5\program&amp;quot;&lt;br /&gt;
@&amp;quot;python-core-3.3.0\bin\python.exe&amp;quot; unoconv.py %* &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set paths in Moodle. &lt;br /&gt;
&lt;br /&gt;
Login as admin and go to Site administration ► Server ► System paths&lt;br /&gt;
&lt;br /&gt;
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)&lt;br /&gt;
&lt;br /&gt;
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)&lt;br /&gt;
&lt;br /&gt;
Test ghostscript and unoconv are working correctly in the admin test pages &amp;quot;Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Run a unoconv listener ==&lt;br /&gt;
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it&#039;s request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.&lt;br /&gt;
&lt;br /&gt;
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.&lt;br /&gt;
&lt;br /&gt;
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]&lt;br /&gt;
&lt;br /&gt;
== Offload processing to a different server ==&lt;br /&gt;
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.&lt;br /&gt;
&lt;br /&gt;
How to do this:&lt;br /&gt;
&lt;br /&gt;
Install unoconv on each webservers and the remote server following the installation instructions above. &lt;br /&gt;
&lt;br /&gt;
Make sure unoconv is started at boot time on the remote server with the &amp;quot;--listener&amp;quot; argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). &lt;br /&gt;
&lt;br /&gt;
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.&lt;br /&gt;
&lt;br /&gt;
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. &lt;br /&gt;
&lt;br /&gt;
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# Wrapper script for unoconv to forward processing.&lt;br /&gt;
# Install to /usr/bin/unoconv-remote with 755 permissions&lt;br /&gt;
/usr/bin/unoconv --server=&amp;lt;ip of remote server&amp;gt; &amp;quot;$@&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
{{Installing_Moodle}}&lt;br /&gt;
&lt;br /&gt;
[[es:mod/assign/feedback/editpdf/testunoconv]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Cron&amp;diff=119566</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Cron&amp;diff=119566"/>
		<updated>2015-08-10T11:57:28Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Working out the Moodle cron command */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
The Moodle &#039;cron&#039; process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background.   The Moodle cron script runs different tasks at differently scheduled intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A special program (typically called - not surprisingly - &#039;cron&#039;) is used to run the Moodle cron script at a regular interval.  The Moodle cron script runs tasks include sending mail, updating Moodle reports, RSS feeds, activity completions, posting forum messages and other tasks. Since different tasks have different schedules, not every task will run in Moodle when the cron script is triggered. &lt;br /&gt;
&lt;br /&gt;
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows the simplest solution is to create a task in the Windows Task Scheduler and set it to run at regular intervals. On shared hosting, you should find the documentation (or ask support) how cron is configured. &lt;br /&gt;
&lt;br /&gt;
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a &#039;crontab&#039; which all users have.  &lt;br /&gt;
&lt;br /&gt;
== General discussion ==&lt;br /&gt;
&lt;br /&gt;
See the later sections for your server type; this section contains some general background information. &lt;br /&gt;
&lt;br /&gt;
There are essentially two steps to implementing cron:&lt;br /&gt;
# identifying the correct command to run&lt;br /&gt;
# finding the right place on your system to put the command&lt;br /&gt;
&lt;br /&gt;
=== Working out the Moodle cron command ===&lt;br /&gt;
&lt;br /&gt;
Moodle has two different ways to deploy cron which use different scripts within the Moodle install. These are as follows...&lt;br /&gt;
# The CLI (command line interpreter) script. This will be at the path &amp;lt;pre&amp;gt;/path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; If in doubt, this is the correct script to use. This needs to be run by a &#039;PHP CLI&#039; program on your computer. So the final command may look something like &amp;lt;pre&amp;gt;/usr/bin/php /path/to/moodle/admin/cli/cron.php&amp;lt;/pre&amp;gt; You can (and should) try this on your command line to see if it works. &#039;&#039;&#039;WARNING: Check your command-line PHP version is compatible with your chosen version of Moodle. The command-line PHP program is different to the one running your web site and is not always the same version.&#039;&#039;&#039;&lt;br /&gt;
# The web based script. This needs to be run from a web browser and will be accessed via a web url something like &#039;&#039;&#039;http://your.moodle.site/admin/cron.php&#039;&#039;&#039;. You can find command line based web browser (e.g. wget) so the final command may look like &amp;lt;pre&amp;gt;/usr/bin/wget http://your.moodle.site/admin/cron.php&amp;lt;/pre&amp;gt; This has the advantage that it can be run from *anywhere*. If you can&#039;t get cron to work on your machine it can be run somewhere else.&lt;br /&gt;
&lt;br /&gt;
===The web based Moodle cron command===&lt;br /&gt;
* As of Moodle 2.9, the cron job can no longer be run from web by default. You will get an error message:&lt;br /&gt;
 !!! Sorry, internet access to this page has been disabled by the administrator. !!! &lt;br /&gt;
* You can change this in &#039; Dashboard ► Site administration ► Security ► Site policies &#039; by deselecting &#039;Cron execution via command line only&#039;.&lt;br /&gt;
** You will be warned that &#039;Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.&#039;&lt;br /&gt;
** You can then write a &#039;Cron password for remote access&#039;. If this field is left empty, no password is required.&lt;br /&gt;
** This means that the cron.php script cannot be run from a web browser without supplying the password using the following form of URL:&lt;br /&gt;
  http://site.example.com/admin/cron.php?password=opensesame&lt;br /&gt;
&lt;br /&gt;
=== Finding the right place to put the command ===&lt;br /&gt;
&lt;br /&gt;
This really does depend on the system you are using and you should find and read the documentation for your platform or hosting. In most cases getting the Moodle cron to run consists of establishing the correct command (above) and then adding it, and the time to run the command, to some sort of file. This might be either through a specific user interface or by editing the file directly.&lt;br /&gt;
&lt;br /&gt;
If using the CLI version you also need to make sure that the cron process is run as the correct user. This is not an issue with the web version. &lt;br /&gt;
&lt;br /&gt;
Example... installing cron on Ubuntu/Debian Linux. Assuming logged in as root..&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;use the crontab command to open a crontab editor window for the www-data user. This is the user that Apache (the web server) runs as on Debian based systems&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ crontab -u www-data -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;This will open an editor window. To run the cli cron script every 1 minute, add the line:&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
*/1 * * * * /usr/bin/php  /path/to/moodle/admin/cli/cron.php &amp;gt;/dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: the final &#039;&#039;&#039;&amp;gt;/dev/null&#039;&#039;&#039; sends all the output to the &#039;bin&#039; and stops you getting an email every 1 minute.&lt;br /&gt;
&lt;br /&gt;
== Setting up cron on your system ==&lt;br /&gt;
 &lt;br /&gt;
Choose the information for your server type:&lt;br /&gt;
&lt;br /&gt;
*[[Cron with Unix or Linux]]- Cron services on various UNIX and Linux flavored operating systems.&lt;br /&gt;
*[[Cron with Windows OS]] - Cron services in Windows&lt;br /&gt;
*&#039;&#039;Apple OSX&#039;&#039; - use the built-in &#039;crontab&#039; service which is exactly the same as [[Cron with Unix or Linux]]. However, you might want to do it the &#039;Apple way&#039; using launchd - see [[Cron with MAC OS X]]&lt;br /&gt;
*[[Cron with web hosting services]]- Cron services in various web hosting examples.&lt;br /&gt;
&lt;br /&gt;
Here are some more instructions for specific hosts (please check that these are up to date):&lt;br /&gt;
&lt;br /&gt;
*[[Cron on 1and1 shared servers]]&lt;br /&gt;
&lt;br /&gt;
== Using third party cron service ==&lt;br /&gt;
 &lt;br /&gt;
Besides using cron hosted on your own server, you may use third party cron service (usually called webcron):&lt;br /&gt;
&lt;br /&gt;
*[https://cron-job.org/ cron-job.org] is a free service. (1Minute cron is possible)&lt;br /&gt;
&lt;br /&gt;
*[https://www.easycron.com EasyCron] - A webcron service provider that eliminates the need of crontab or other task schedulers to set cron job.&lt;br /&gt;
&lt;br /&gt;
=== Cron settings in Moodle ===&lt;br /&gt;
&lt;br /&gt;
An admin can set cron execution via command line only or a cron password for remote access in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Remote cron===&lt;br /&gt;
Using the &#039;web based&#039; version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web &#039;page&#039; on a Windows based Moodle server.&lt;br /&gt;
&lt;br /&gt;
==Scheduling tasks==&lt;br /&gt;
An administrator can schedule cron tasks very precisely from Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks, see [[Scheduled tasks]]&lt;br /&gt;
&lt;br /&gt;
==Running cron for several Moodle servers==&lt;br /&gt;
* Tasks can run in parallel and processes use locking to prevent tasks from running at the same time which allows cron to be triggered from multiple web servers that serve the same Moodle instance.&lt;br /&gt;
&lt;br /&gt;
* If you are running different Moodle instances on the same server, then each Moodle instance needs a cron job. (Even a single Apache web server can run different Moodle instances on different domains by using its virtual hosts capability [https://httpd.apache.org/docs/2.2/vhosts/index.html https://httpd.apache.org/docs/2.2/vhosts/index.html].)&lt;br /&gt;
&lt;br /&gt;
== Debugging Scheduled Tasks ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, a particular cron task may not be working correctly. In Moodle versions before 2.7 - any cron task that was throwing exceptions would prevent the rest of cron from running. The only way to monitor if cron was completing each time, was to add some automated checking of the output of running cron (e.g. searching for the string &amp;quot;Cron completed at &amp;quot;).&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.7 and later, a single failing scheduled task will not prevent the remaining tasks from completing. When any single scheduled task fails, it is marked as a failure, and scheduled to be reattempted. If the task keeps failing, the next scheduled time will be backed off until it is attempted at most once every 24 hours. But checking the [[Scheduled tasks]] admin page, you can see if any task is currently failing (it will have a non-zero fail delay - which is the number of seconds to wait before reattempting a failed task). A simple way to debug a failing task, is to run it immediately using the [[Administration via command line#Scheduled_tasks|cli scheduled task runner]] and monitor the output.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [http://www.coursebit.net/moodle-cron-job/ All About the Moodle Cron Job]&lt;br /&gt;
* [https://docs.moodle.org/37/en/Scheduled_tasks Scheduled tasks Moodle docs]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Cron Wikipedia article on cron function]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=41827 Cron - can someone give me a quick confirmation of function?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97684 Cronjob Question]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97457 Slow cron : avoiding simultaneous cron]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=117168 Visibility of cron.php]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=139263#p609060 How to log the output of a Scheduled Task on Windows] - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.&lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[ja:Cron]]&lt;br /&gt;
[[de:Cron-Job]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Video&amp;diff=119565</id>
		<title>Video</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Video&amp;diff=119565"/>
		<updated>2015-08-10T10:48:26Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Working with media}}&lt;br /&gt;
*Video is a very powerful tool to use in a Moodle course, allowing students, for example to catch up on lectures they missed, learn from a &amp;quot;how to&amp;quot; screencast, or improve their language skills  by watching native speakers interact.&lt;br /&gt;
*For a discussion on the best type of video file for Moodle, see [http://moodle.org/mod/forum/discuss.php?d=143478| here]&lt;br /&gt;
&#039;&#039;&lt;br /&gt;
*For a discussion of the best programs for creating screencasts, see [http://moodle.org/mod/forum/discuss.php?d=147891| here]&lt;br /&gt;
&lt;br /&gt;
==Where to host the videos==&lt;br /&gt;
&lt;br /&gt;
*Whenever possible, it is preferable to upload your videos to Moodle, storing them on your own server as you retain ultimate control. However, when server space or upload limits are restricted, it is convenient to upload videos to an online site like youtube [http://www.youtube.com] or  Vimeo[http://vimeo.com]. They can easily be embedded inside Moodle from such sites and privacy can still be maintained if you choose their private video sharing option.&lt;br /&gt;
&lt;br /&gt;
===Cross domain video hosting===&lt;br /&gt;
&lt;br /&gt;
Flash video players require permission to play videos hosted on a different URL, e.g. yourmoodle.org needs permission to play video files hosted at yourvideo.org. The permission files are stored on the root domain of where the video files are hosted, e.g. yourvideos.org/crossdomain.xml. If yourvideos.org does not have a cross domain policy file that permits yourmoodle.org to play videos, Flash Player will not permit it. Further details are available here [http://code.google.com/p/moodle-mplayer/wiki/CrossDomainSecurity].&lt;br /&gt;
&lt;br /&gt;
Many public video hosting services, such as YouTube.com, already have catch-all cross domain policy files in place and so videos can be played from them via your Moodle without any cross domain security issues arising.&lt;br /&gt;
&lt;br /&gt;
==Ways of displaying video==&lt;br /&gt;
&lt;br /&gt;
===Linking to a video online elsewhere===&lt;br /&gt;
*If your video is hosted elsewhere online (such as youtube) you can simply link to the relevant page by choosing &#039;&#039;Add a resource&amp;gt;[[URL|URL]]&#039;&#039; and pasting in the relevant link.&lt;br /&gt;
*For more information, see [[URL|URL]]&lt;br /&gt;
*Note that, in an establishment where certain video sharing sites might be banned, your students might not be able to access your video through Moodle.&lt;br /&gt;
&lt;br /&gt;
===Uploading a video for students to download===&lt;br /&gt;
*Choose this option if you wish to upload your video to Moodle and give users the option to download it to their own computers.&lt;br /&gt;
*Choose &#039;&#039;Add an activity or  resource&amp;gt;[[File|File]]&#039;&#039;&lt;br /&gt;
*For more information, see [[File|File]]&lt;br /&gt;
*Note that the way the video will display depends on the software the user has on their own computer. This could mean that some students might be unable to view your video. (See this discussion [http://moodle.org/mod/forum/discuss.php?d=143478| here])&lt;br /&gt;
&lt;br /&gt;
===Embedding a video in its own player===&lt;br /&gt;
*Moodle has an inbuilt video player called Flowplayer. If the [[Multimedia plugins filter|multimedia plugins filter]] is enabled by the administrator, videos embedded into the text editor will play inline in Flowplayer.&lt;br /&gt;
*Anywhere that Moodle&#039;s  text editor is available, it is possible to embed a video, for example in a [[Label|label]] or a [[Page|page]], a course topic summary, a [[Description_question_type| quiz description]] or a [[Lesson|lesson]].&lt;br /&gt;
*One exception seems to be MP4 files.  They don&#039;t seem to play in Flowplayer unless hacked.  See discussion here: http://moodle.org/mod/forum/discuss.php?d=208849&lt;br /&gt;
&lt;br /&gt;
====Using the Moodle media icon====&lt;br /&gt;
*With your editing turned on, click into the HTML editor where you wish to embed your video. &lt;br /&gt;
*Click the Moodle media icon as in the following screenshot:&lt;br /&gt;
[[File:Addmedia.png]]&lt;br /&gt;
*Click &#039;&#039;Browse repositories&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:attomediaupload.png]]&lt;br /&gt;
&lt;br /&gt;
*The file picker will appear:&lt;br /&gt;
[[File:Filepickermedia.png]]&lt;br /&gt;
*Either click &#039;&#039;Upload a file&#039;&#039; to upload from your computer or choose the appropriate repository from which you wish to bring in your video. (What you see will depend on what the Moodle admin has enabled)&lt;br /&gt;
*Note: &#039;&#039;&#039;To search for and embed a video from youtube, [[Youtube_videos|see here]]&#039;&#039;&#039;&lt;br /&gt;
*Change the &#039;&#039;save as/author/license&#039;&#039; settings if desired and click &#039;&#039;upload this file&#039;&#039; or &#039;&#039;select this file&#039;&#039;&lt;br /&gt;
*Your video will appear in a preview player. Click &#039;&#039;Insert&#039;&#039; at the bottom&lt;br /&gt;
*&#039;&#039;&#039;&#039;&#039;Don&#039;t panic&#039;&#039;!&#039;&#039;&#039; You will now only get a blue text link of your video:&lt;br /&gt;
[[File:Moodletvgirlpreview.png]]&lt;br /&gt;
*When you click &#039;&#039;save changes&#039;&#039; to return to the main course page, your video will display:&lt;br /&gt;
[[File:Moodletvgirl2.png]]&lt;br /&gt;
&lt;br /&gt;
====Using a hyperlink====&lt;br /&gt;
(Note - this method has no advantage over using the  media icon, but was popular in older versions of Moodle)&lt;br /&gt;
*With your editing turned on, click into the HTML editor where you wish to embed your video.&lt;br /&gt;
*Type some blank spaces (or some text) and select them.&lt;br /&gt;
*Click the hyperlink icon as in the following screenshot.(The icon will only be clickable if you have selected text or spaces)&lt;br /&gt;
[[File:Hyperlinkicon.png]]&lt;br /&gt;
*Click &#039;Browse repositories&#039;&lt;br /&gt;
*This takes you to the file picker. Follow the instructions for uploading/selecting your video as for using the Moodle media icon.&lt;br /&gt;
*When your video is chosen, it will appear in the link URL box as below. Click &#039;&#039;Insert:&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;&#039;&#039;Don&#039;t panic!&#039;&#039;&#039;&#039;&#039; You will now only get a blue line (if you selected blank spaces) or the actual text underlined in the HTML editor:&lt;br /&gt;
[[File:linklinkatto.png]]&lt;br /&gt;
*When you click &#039;&#039;save changes&#039;&#039; to return to the main course page, your video will display.&lt;br /&gt;
&lt;br /&gt;
====Using embed code to display external videos====&lt;br /&gt;
*Go to your chosen video sharing site and find the embed code of the video you wish to display. Copy this code.&lt;br /&gt;
*With your editing turned on, click into the HTML editor where you wish to embed your video.&lt;br /&gt;
*Click the HTML code icon as in the following screenshot:&lt;br /&gt;
[[File:Htmlcodeicon.png]]&lt;br /&gt;
*Paste your embed code into the box:&lt;br /&gt;
[[File:Embedcode.png]]&lt;br /&gt;
*Scroll down and click &amp;quot;update&amp;quot;.&lt;br /&gt;
*Your video will be previewed in the HTML editor. Click &#039;&#039;save changes&#039;&#039; for it to display on the page&lt;br /&gt;
[[File:Youtubevideo.png]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Video_FAQ|Video FAQ]]&lt;br /&gt;
*[[Multimedia plugins filter]]&lt;br /&gt;
*[http://www.mguhlin.org/2012/01/embedding-videos-in-moodle-22.html Embedding Videos in #Moodle 2.2] blog post from Miguel Guhlin&lt;br /&gt;
*[[Videofile]] plugin with multilanguage captions capability&lt;br /&gt;
*[https://moodle.org/mod/forum/discuss.php?d=317841 Moodle.org forum discussion about players and encoding]&lt;br /&gt;
&lt;br /&gt;
[[de:Video]]&lt;br /&gt;
[[es:Video]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Upload_courses&amp;diff=114281</id>
		<title>Upload courses</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Upload_courses&amp;diff=114281"/>
		<updated>2014-08-24T09:35:32Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Course information fields */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Courses}}&lt;br /&gt;
An administrator can upload multiple courses via text file in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Courses &amp;gt; Upload courses&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In addition to creating new courses, this functionality may also be used to update or delete courses, or import content from another course. For information on using this functionality to create course templates, see [[Adding a new course]]&lt;br /&gt;
&lt;br /&gt;
==Upload courses==&lt;br /&gt;
&lt;br /&gt;
To upload one or more courses&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Courses &amp;gt; Upload courses&#039;&#039;&lt;br /&gt;
# Either drag and drop the CSV file or click the &#039;Choose a file&#039; button and select the file in the file picker&lt;br /&gt;
# Select appropriate import options carefully, then click the preview button.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:26uploadcourses.png|250px|thumb|Upload courses admin screen]]&lt;br /&gt;
|&lt;br /&gt;
|[[File:uploadcoursesresults.png|250px|thumb|Courses successfully uploaded]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: It is also possible to use the command-line tool &#039;&#039;admin/tool/uploadcourse/cli/uploadcourse.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
When using the web interface, use the &#039;&#039;Preview&#039;&#039; option to see if any errors were detected in the previewed rows. If you proceed with the upload and there were something wrong detected with a course, it will be ignored.&lt;br /&gt;
&lt;br /&gt;
=== Short file example ===&lt;br /&gt;
uploadcourse.csv:&lt;br /&gt;
&lt;br /&gt;
Note: shortname, fullname, and category are required.&lt;br /&gt;
&lt;br /&gt;
The category field takes the id of the category, with the default category Miscellaneous having id 1. Categories must already exist. If you put a category id that does not exist, you will receive a &amp;quot;Could not resolve category by ID&amp;quot; error during upload preview, and courses in that category will not be created. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code bash&amp;gt;&lt;br /&gt;
shortname,fullname,category,summary,enrolment_1,enrolment_1_role,enrolment_1_enrolperiod,role_student&lt;br /&gt;
courserestored,Course restored,1,a summary,manual,student,1 month,&lt;br /&gt;
courserestored2,Course restored 2,1,a summary,,,,&lt;br /&gt;
courserestored3,Course restored 3,1,a summary,,,,padawan&lt;br /&gt;
courserestored4,Course restored 4,1,&amp;quot;a summary, with comma&amp;quot;,manual,student,1 month,padawan&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice there are no spaces between the items.&lt;br /&gt;
&lt;br /&gt;
==Creating the text file==&lt;br /&gt;
&lt;br /&gt;
The text file to upload courses must be a CSV file. It accepts the following columns which are divided in two categories, the course information, and the course actions.&lt;br /&gt;
&lt;br /&gt;
===Course information fields===&lt;br /&gt;
&lt;br /&gt;
Most of those settings are available on the settings page of a course. Please refer to [[Course settings]] for more information. Field names must be lower-case.&lt;br /&gt;
&lt;br /&gt;
;shortname&lt;br /&gt;
: The shortname&lt;br /&gt;
;fullname&lt;br /&gt;
: The full name&lt;br /&gt;
;idnumber&lt;br /&gt;
: The ID number&lt;br /&gt;
;category&lt;br /&gt;
: The ID of the category to place the course in. This takes precedence over &#039;&#039;category_idnumber&#039;&#039; and &#039;&#039;category_path&#039;&#039;.&lt;br /&gt;
;category_idnumber&lt;br /&gt;
: The ID number of the category to place the course in. This takes precedence over &#039;&#039;category_path&#039;&#039;.&lt;br /&gt;
;category_path&lt;br /&gt;
: The path of the category to place the course in. If you want to place the course in a category named &amp;quot;Science-Fiction&amp;quot; which is located under the category &amp;quot;Movies&amp;quot;, the value to provide is: &amp;lt;code&amp;gt;Movies / Science-Fiction&amp;lt;/code&amp;gt;. Note that the separator must be &amp;lt;code&amp;gt;[space]/[space]&amp;lt;/code&amp;gt;. Also note that the category MUST exist, it will not be created.  If you want to place the course in the top-level category &amp;quot;Movies&amp;quot;, the value to provide is: &amp;lt;code&amp;gt;Movies&amp;lt;/code&amp;gt;&lt;br /&gt;
;visible&lt;br /&gt;
: 1 if the course is visible, 0 if hidden&lt;br /&gt;
;startdate&lt;br /&gt;
: The time at which the course starts. Please note that this value is passed to the PHP function [http://php.net/manual/en/function.strtotime.php strtotime] to generate a timestamp. Example 01.12.2014 (1st December 2014)&lt;br /&gt;
;summary&lt;br /&gt;
: The summary of the course&lt;br /&gt;
;format&lt;br /&gt;
: The course format to use, this must be a valid course format plugin name. E.g. &#039;&#039;weeks&#039;&#039;, &#039;&#039;topics&#039;&#039;.&lt;br /&gt;
;theme&lt;br /&gt;
: The theme to use&lt;br /&gt;
;lang&lt;br /&gt;
: The language to use&lt;br /&gt;
;newsitems&lt;br /&gt;
: The number of news items&lt;br /&gt;
;showgrades&lt;br /&gt;
: 1 to show the gradebook to students, 0 to hide it.&lt;br /&gt;
;showreports&lt;br /&gt;
: 1 to show the activity reports, 0 to hide it.&lt;br /&gt;
;legacyfiles&lt;br /&gt;
: 1 to enable the legacy course files, 0 not to.&lt;br /&gt;
;maxbytes&lt;br /&gt;
: The maximum upload size of the course in bytes. Use 0 for the site limit.&lt;br /&gt;
;groupmode&lt;br /&gt;
: 0 for &#039;&#039;No groups&#039;&#039;, 1 for &#039;&#039;Separate groups&#039;&#039; and 2 for &#039;&#039;Visible groups&#039;&#039;.&lt;br /&gt;
;groupmodeforce&lt;br /&gt;
: 1 to force the group mode, otherwise enter 0.&lt;br /&gt;
;enablecompletion&lt;br /&gt;
: 1 to enable the activity completion, 0 not to.&lt;br /&gt;
&lt;br /&gt;
====Enrolment fields====&lt;br /&gt;
&lt;br /&gt;
Some fields can be constructed to enable and configure enrolment methods. The fields must be named &#039;&#039;enrolment_[number]&#039;&#039; for the enrolment method name, and &#039;&#039;enrolment_[number]_property&#039;&#039; for its properties.&lt;br /&gt;
&lt;br /&gt;
;enrolment_[number]&lt;br /&gt;
: The name of the enrolment method&lt;br /&gt;
;enrolment_[number]_delete&lt;br /&gt;
: 1 to delete this enrolment method from the course, if set to 1 all the other properties will be ignored.&lt;br /&gt;
;enrolment_[number]_disable&lt;br /&gt;
: 1 to disable this enrolment method from the course, if set to 1 all the other properties will be ignored.&lt;br /&gt;
;enrolment_[number]_startdate&lt;br /&gt;
: The enrolment start date. This value is passed to the PHP function strtotime().&lt;br /&gt;
;enrolment_[number]_enddate&lt;br /&gt;
: The enrolment end date. This value is passed to the PHP function strtotime().&lt;br /&gt;
;enrolment_[number]_enrolperiod&lt;br /&gt;
: Number of seconds, or if not a value understood by strtotime() such as &amp;quot;4 days&amp;quot;.&lt;br /&gt;
;enrolment_[number]_role&lt;br /&gt;
: The role short name&lt;br /&gt;
;enrolment_[number]_[property]&lt;br /&gt;
: Where property is understood by the specified enrolment method&lt;br /&gt;
;enrolment_[number]_password&lt;br /&gt;
: The course enrolment key&lt;br /&gt;
&lt;br /&gt;
Note: Upload courses is not yet compatible with all [[Enrolments|enrolment methods]] (MDL-43127).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 enrolment_1: manual&lt;br /&gt;
 enrolment_1_role: student&lt;br /&gt;
 enrolment_1_enrolperiod: 1 month&lt;br /&gt;
 &lt;br /&gt;
 enrolment_2: self&lt;br /&gt;
 enrolment_2_startdate: 2013-01-30&lt;br /&gt;
&lt;br /&gt;
====Role renaming====&lt;br /&gt;
&lt;br /&gt;
To rename some roles, using the following pattern:&lt;br /&gt;
&lt;br /&gt;
;role_[shortname]&lt;br /&gt;
: The new name of the role &#039;&#039;[shortname]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 role_student: Apprentice&lt;br /&gt;
 role_teacher: Master&lt;br /&gt;
 role_mycustomrole: Jedi&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the short name for the teacher role is &#039;&#039;editingteacher&#039;&#039; and the short name for the non-editing teacher is &#039;&#039;teacher&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Course action fields===&lt;br /&gt;
&lt;br /&gt;
Those settings take precedence over the &#039;&#039;Course process&#039;&#039; parameters.&lt;br /&gt;
&lt;br /&gt;
;delete&lt;br /&gt;
: 1 to delete the course &lt;br /&gt;
;rename&lt;br /&gt;
: The shortname to rename the course to&lt;br /&gt;
;backupfile&lt;br /&gt;
: An absolute path to a backup file (.mbz) to import in the course&lt;br /&gt;
;templatecourse&lt;br /&gt;
: The short name of a course to import the content from&lt;br /&gt;
;reset&lt;br /&gt;
: 1 to reset the course&lt;br /&gt;
&lt;br /&gt;
===Mandatory fields===&lt;br /&gt;
&lt;br /&gt;
;shortname&lt;br /&gt;
: This field is mandatory for every operation, with the only exception of creating new courses. See details on the course process parameter &#039;&#039;Shortname template&#039;&#039; for more information.&lt;br /&gt;
;fullname&lt;br /&gt;
: Required when creating a new course.&lt;br /&gt;
;category, category_idnumber, category_path&lt;br /&gt;
: One of these is required when creating a course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Import options===&lt;br /&gt;
&lt;br /&gt;
To prevent unexpected behaviour, you have to specify what you want the tool to be able to do.&lt;br /&gt;
&lt;br /&gt;
;Upload mode&lt;br /&gt;
: This allows you to specify if courses can be created and/or updated.&lt;br /&gt;
;Update mode&lt;br /&gt;
: If you allow courses to be updated, you also have to tell the tool what to update the courses with.&lt;br /&gt;
;Allow deletes&lt;br /&gt;
: Whether the &#039;&#039;delete&#039;&#039; field is accepted or not&lt;br /&gt;
;Allow renames&lt;br /&gt;
: Whether the &#039;&#039;rename&#039;&#039; field is accepted or not&lt;br /&gt;
;Allow resets&lt;br /&gt;
: Whether the &#039;&#039;reset&#039;&#039; field is accepted or not&lt;br /&gt;
&lt;br /&gt;
===Course process===&lt;br /&gt;
&lt;br /&gt;
This allows you to specify actions to be taken for every course uploaded.&lt;br /&gt;
&lt;br /&gt;
;Shortname template&lt;br /&gt;
: If you are creating courses without a shortname, you can use this field to automatically generate a shortname. This field accepts two placeholders: %i for the ID number, %f for the summary.&lt;br /&gt;
;Restore file&lt;br /&gt;
: A backup file (.mbz) to import in the course after create/update.&lt;br /&gt;
;Restore from course&lt;br /&gt;
: The shortname of a course to import content from after create/update.&lt;br /&gt;
;Reset after upload&lt;br /&gt;
: Whether to reset the course after creating/updating it.&lt;br /&gt;
&lt;br /&gt;
===Default course values===&lt;br /&gt;
&lt;br /&gt;
Those are values that can be set in the web interface for all the fields that are not specified in the CSV file. Note that they are always used when creating a course, but only when specified during update (see &#039;&#039;Update mode&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==Increasing speed==&lt;br /&gt;
&lt;br /&gt;
When importing the content of a backup file, or another course, you are advised to enable the setting &#039;&#039;keeptempdirectoriesonbackup&#039;&#039;. This will considerably speed up the process of the upload if you are importing multiple times from the same source.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Demo screencast: [http://youtu.be/MzK2jb-9SwE Bulk course creation]&lt;br /&gt;
* [[Upload users]]&lt;br /&gt;
* [http://www.moodleblog.net/2013/11/24/creating-course-templates-in-moodle-2-6/ Creating course templates in Moodle 2.6] blog post by Mary Cooch&lt;br /&gt;
&lt;br /&gt;
[[de:Kurse hochladen]]&lt;br /&gt;
[[es:Subir cursos]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Caching&amp;diff=113033</id>
		<title>Caching</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Caching&amp;diff=113033"/>
		<updated>2014-06-10T08:30:10Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Performance}}&lt;br /&gt;
&lt;br /&gt;
A cache is a collection of processed data that is kept on hand and re-used in order to avoid costly repeated database queries.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.4 saw the implementation of MUC, the Moodle Universal Cache. This new system allows certain functions of Moodle (eg string fetching) take advantage of different installed cache services (eg files, ram, memcached).&lt;br /&gt;
&lt;br /&gt;
In future versions of Moodle we will continue expanding the number of Moodle functions that use MUC, which will continue improving performance, but you can already start using it to improve your site.&lt;br /&gt;
&lt;br /&gt;
==General approach to performance testing==&lt;br /&gt;
&lt;br /&gt;
Here is the general strategy you should be taking:&lt;br /&gt;
&lt;br /&gt;
# Build a test environment that is as close to your real production instance as possible (eg hardware, software, networking, etc)&lt;br /&gt;
# Make sure to remove as many uncontrolled variables as you can from this environment (eg other services)&lt;br /&gt;
# Use a tool to place a realistic, but simulated and repeatable load upon you server. (eg jmeter or selenium).&lt;br /&gt;
# Decide on a way to measure performance of the server by capturing data (ram, load, time taken, etc)&lt;br /&gt;
# Run your load and measure a baseline performance result.&lt;br /&gt;
# Change one variable at a time, and re-run the load to see if performance gets better or worse.  Repeat as necessary.&lt;br /&gt;
# When you discover settings that result in a consistent performance improvement, apply to your production site.&lt;br /&gt;
&lt;br /&gt;
==Cache configuration in Moodle==&lt;br /&gt;
&lt;br /&gt;
Since Moodle 2.4, Moodle has provided a caching plugin framework to give administrators the ability to control where Moodle stores cached data. For most Moodle sites the default configuration should be sufficient and it is not necessary to change the configuration. For larger Moodle sites with multiple servers, administrators may wish to use memcached, mongodb or other systems to store cache data. The cache plugin screen provides administrators with the ability to configure what cache data is stored where.&amp;lt;br /&amp;gt;&lt;br /&gt;
Caching in Moodle is controlled by what is known as the Moodle Universal Cache. Commonly referred to MUC.&lt;br /&gt;
&lt;br /&gt;
This document explains briefly what MUC is before proceeding into detail about the concepts and configuration options it offers.&lt;br /&gt;
&lt;br /&gt;
==The basic cache concepts in Moodle==&lt;br /&gt;
Caching in Moodle isn&#039;t as complex as it first appears. A little background knowledge will go a long way in understanding how cache configuration works.&lt;br /&gt;
&lt;br /&gt;
===Cache types===&lt;br /&gt;
Lets start with cache types (sometimes referred to as mode). There are three basic types of caches in Moodle.&lt;br /&gt;
&lt;br /&gt;
The first is the application cache. This is by far the most commonly used cache type in code. Its information is shared by all users and its data persists between requests. Information stored here is usually cached for one of two reasons, either it is required information for the majority of requests and saves us a one of more database interactions or it is information that is accessed less frequently but is resource intensive to generate.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default this information is stored in an organised structure within your Moodle data directory.&lt;br /&gt;
&lt;br /&gt;
The second cache type is the session cache. This is just like the PHP session that you will already be familiar with, in fact it uses the PHP session by default. You may be wondering why we have this cache type at all, but the answer is simple. MUC provides a managed means of storing, and removing information that is required between requests. It offers developers a framework to use rather than having to re-invent the wheel and ensures that we have access to a controlled means of managing the cache as required.&amp;lt;br /&amp;gt;&lt;br /&gt;
Its important to note that this isn&#039;t a frequently used cache type as by default session cache data is stored in the PHP session and the PHP session is stored in the database. Uses of the session cache type are limited to small datasets as we don&#039;t want to bloat sessions and thus put strain on the database.&lt;br /&gt;
&lt;br /&gt;
The third and final type is the request cache. Data stored in this cache type only persists for the lifetime of the request. If you&#039;re a PHP developer think of it like a managed static variable.&amp;lt;br /&amp;gt;&lt;br /&gt;
This is by far the least used of the three cache types, uses are often limited to information that will be accessed several times within the same request, usually by more than area of code.&lt;br /&gt;
Cached information is stored in memory by default.&lt;br /&gt;
&lt;br /&gt;
==== Cache types and multiple-server systems ====&lt;br /&gt;
&lt;br /&gt;
If you have a system with multiple front-end web servers, the application cache must be shared between the servers. In other words, you cannot use fast local storage for the application cache, but must use shared storage or some other form of shared cache such as a shared memcache.&lt;br /&gt;
&lt;br /&gt;
The same applies to session cache, unless you use a &#039;sticky sessions&#039; mechanism to ensure that within a session, users always access the same front-end server.&lt;br /&gt;
&lt;br /&gt;
===Cache backends===&lt;br /&gt;
Cache backends are where data actually gets stored. These include things like the file system, php session, Memcached, and memory.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default just file system, php session, and memory are used within Moodle.&amp;lt;br /&amp;gt;&lt;br /&gt;
We don&#039;t require that a site has access to any other systems such a Memcached. Instead that is something you are responsible for installing and configuring yourself.&amp;lt;br /&amp;gt;&lt;br /&gt;
When cache backends are mentioned think of systems outside of Moodle that can be used to store data. The MongoDB server, the Memcache server and similiar &amp;quot;server&amp;quot; applications.&lt;br /&gt;
&lt;br /&gt;
===Cache stores===&lt;br /&gt;
Cache stores are a plugin type within Moodle. They facilitate connecting Moodle to the cache backends discussed above.&amp;lt;br /&amp;gt;&lt;br /&gt;
Moodle ships with the three defaults mentioned above as well as Memcache, Memcached, and MongoDB.&amp;lt;br /&amp;gt;&lt;br /&gt;
You can find other cache store plugins in the [https://moodle.org/plugins/browse.php?list=category&amp;amp;id=48 plugins database].&amp;lt;br /&amp;gt;&lt;br /&gt;
The code for these is located within cache/stores in your Moodle directory root.&lt;br /&gt;
&lt;br /&gt;
Within Moodle you can configure as many cache stores as your architecture requires. If you have several Memcache servers for instance you can create an cache store instance for each.&amp;lt;br /&amp;gt;&lt;br /&gt;
Moodle by default contains three cache store instances that get used when you&#039;ve made no other configuration.&lt;br /&gt;
* A file store instance is created which gets used for all application caches. It stores its data in your moodledata directory.&lt;br /&gt;
* A session store instance is created which gets used for all session caches. It stores its data in the PHP session, which by default is stored if your database.&lt;br /&gt;
* A static memory store instance is created which gets used for all request cache types. Data exists in memory for just the lifetime of a request.&lt;br /&gt;
&lt;br /&gt;
===Caches: what happens in code===&lt;br /&gt;
Caches are created in code and are used by the developer to store data they see a need to cache.&amp;lt;br /&amp;gt;&lt;br /&gt;
Lets keep this section nice and short because perhaps you are not a developer. There is one very important point you must know about.&amp;lt;br /&amp;gt;&lt;br /&gt;
The developer does not get any say in where the data gets cached. They must specify the following information when creating a cache to use.&lt;br /&gt;
# The type of cache they require.&lt;br /&gt;
# The area of code this cache will belong to (the API if you will).&lt;br /&gt;
# The name of the cache, something they make up to describe in one word what the cache stores.&lt;br /&gt;
&lt;br /&gt;
There are several optional requirements and settings they can specify as well, but don&#039;t worry about that at this point.&amp;lt;br /&amp;gt;&lt;br /&gt;
The important point is that they can&#039;t choose which cache backend to use, they can only choose the type of cache they want from the three detailed above.&lt;br /&gt;
&lt;br /&gt;
===How it ties together===&lt;br /&gt;
&lt;br /&gt;
This is best described in relation to roles played in an organisation.&lt;br /&gt;
&lt;br /&gt;
# The system administrator installs the cache backends you wish to use. Memcache, XCache, APC and so on.&amp;lt;br /&amp;gt;Moodle doesn&#039;t know about these, they are outside of Moodle&#039;s scope and purely the responsibility of your system administrator.&lt;br /&gt;
# The Moodle administrator creates a cache store instance in Moodle for each backend the site will make use of.&amp;lt;br /&amp;gt;There can be one or more cache stores instances for each backend. Some backends like Memcached have settings to create separated spaces within one backend.&lt;br /&gt;
# The developer has created caches in code and is using them to store data.&amp;lt;br /&amp;gt;He doesn&#039;t know anything about how you will use your caches, he just creates a &amp;quot;cache&amp;quot; and tells Moodle what type it is best for it.&lt;br /&gt;
# The Moodle administrator creates a mapping between a cache store instance and a cache.&amp;lt;br /&amp;gt;That mapping tells Moodle to use the backend you specify to store the data the developer wants cached.&lt;br /&gt;
&lt;br /&gt;
In addition to that you can take things further still.&lt;br /&gt;
* You can map many caches to a single cache store instance.&lt;br /&gt;
* You can map multiple cache store instances to a single cache with priority (primary ... final)&lt;br /&gt;
* You can map a cache store instance to be the default store used for all caches of a specific type that don&#039;t otherwise have specific mappings.&lt;br /&gt;
&lt;br /&gt;
If this is the first time you are reading about the Moodle Universal Cache this probably sounds pretty complex but don&#039;t worry it will be discussed in better detail as we work through how to configure the caching in Moodle.&lt;br /&gt;
&lt;br /&gt;
==Advanced concepts==&lt;br /&gt;
These concepts are things that most sites will not need to know or concern themselves about.&lt;br /&gt;
&lt;br /&gt;
You should only start looking here if you are looking to maximise performance on large sites running over clustered services with shared cache backends, or on multi-site architecure again where information is being shared between sites.&lt;br /&gt;
&lt;br /&gt;
===Locking===&lt;br /&gt;
&lt;br /&gt;
The idea of locking is nothing new, it is the process of controlling access in order to avoid concurrency issues.&lt;br /&gt;
&lt;br /&gt;
MUC has a second type of plugin, a cache lock plugin that gets used when caches require it. To date no caches have required it. A cache by nature is volatile and any information that is absolutely mission critical should be a more permanent data store likely the database.&lt;br /&gt;
&lt;br /&gt;
Nonetheless there is a locking system that cache definitions can require within their options and that will be applied when interacting with a cache store instance.&lt;br /&gt;
&lt;br /&gt;
===Sharing===&lt;br /&gt;
&lt;br /&gt;
Every bit of data that gets stored within a cache has a calculated unique key associated with it.&amp;lt;br /&amp;gt;&lt;br /&gt;
By default part of that key is the site identifier making any content stored in the cache specific to the site that stored it. For most sites this is exactly what you want.&amp;lt;br /&amp;gt;&lt;br /&gt;
However in some situations its beneficial to allow mutiple sites, or somehow linked sites to share cached data.&amp;lt;br /&amp;gt;&lt;br /&gt;
Of course not all caches can be shared, however some certainly can and by sharing you can further reduce load and increase performance by maximising resource use.&lt;br /&gt;
&lt;br /&gt;
This is an advanced feature, if you choose to configure sharing please do so carefully.&lt;br /&gt;
&lt;br /&gt;
To make use of sharing you need to first configure identical cache store instances in the sites you want to share information, and then on each site set the sharing for the cache to the same value.&lt;br /&gt;
&lt;br /&gt;
; Sites with the same site ID : This is the default, it allows for sites with the same site ID to share cached information. It is the most restrictive but is going to work for all caches. All other options carry an element of risk in that you have to ensure the information in the cache is applicable to all sites that will be accessing it.&lt;br /&gt;
; Sites running the same version : All sites accessing the backend that have the same Moodle version can share the information this cache has stored in the cache store.&lt;br /&gt;
; Custom key : For this you manually enter a key to use for sharing. You must then enter the exact same key into the other sites you want to share information.&lt;br /&gt;
; Everyone : The cached data is accessible to all other sites accessing the data. This option puts the ball entirely in the Moodle administrators court.&lt;br /&gt;
&lt;br /&gt;
As an example if you had several Moodle sites all the same version running on server with APC installed you could decide to map the language cache to the APC store and configure sharing for all sites running the same version.&amp;lt;br /&amp;gt;&lt;br /&gt;
The language cache for sites on the same version is safe to share, it is used on practically every page, and APC is extremely fast. These three points may result in a nice wee performance boost for your sites.&lt;br /&gt;
&lt;br /&gt;
==The cache configuration screen==&lt;br /&gt;
&lt;br /&gt;
The cache configuration screen is your one stop shop for configuring caching in Moodle.&amp;lt;br /&amp;gt;&lt;br /&gt;
It gives you an overview of how caching is currently configured for your site and it provides links to all of the actions you can perform to configure caching to your specific needs.&lt;br /&gt;
&lt;br /&gt;
===Accessing the cache configuration screen===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-01-configuration-screen.png|thumb|500px|The cache configuration screen in Moodle 2.6]]&lt;br /&gt;
&lt;br /&gt;
The cache configuration screen can only be accessed by users with the &#039;&#039;moodle/site:config&#039;&#039; capability. By default this is only admins.&amp;lt;br /&amp;gt;&lt;br /&gt;
Once logged in the configuration screen can be found in the Settings block under &#039;&#039;&#039;Site Administration &amp;gt; Plugins &amp;gt; Caching &amp;gt; Configuration&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Installed cache stores===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-02-installed-cache-stores.png|thumb|500px|Installed cache stores screenshot]]&lt;br /&gt;
&lt;br /&gt;
This is showing you a list of cache store plugins that you have installed.&amp;lt;br /&amp;gt;&lt;br /&gt;
For each plugin you can quickly see whether it is ready to be used (any php requirements have been met), how many store instances already exist on this site, the cache types that this store can be used for, what features it supports (advanced) and any actions you can perform relating to this store.&lt;br /&gt;
&lt;br /&gt;
Often the only action available is to create a new store instance.&amp;lt;br /&amp;gt;&lt;br /&gt;
Most stores support having multiple instances, however not all as you will see that that the session cache and static request cache do not. For those two stores it does not make sense to have multiple instances.&lt;br /&gt;
&lt;br /&gt;
===Configured store instances===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-03-configured-store-instances.png|thumb|500px|Configured store instances screenshot]]&lt;br /&gt;
&lt;br /&gt;
Here you get a list of the cache store instances on this site.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Store name&#039;&#039;&#039; : The name given to this cache store instance when it is created so that you can recognise it. It can be anything you want and is only used so that you can identify the store instance.&lt;br /&gt;
; &#039;&#039;&#039;Plugin&#039;&#039;&#039; : The cache store plugin of which this is an instance of.&lt;br /&gt;
; &#039;&#039;&#039;Ready&#039;&#039;&#039; : A tick gets shown when all PHP requirements have been met as well as any connection or set-up requirements have been verified.&lt;br /&gt;
; &#039;&#039;&#039;Store mappings&#039;&#039;&#039; : The number of caches this store instance has been mapped to explicitly. Does not include any uses through default mappings (discussed below).&lt;br /&gt;
; &#039;&#039;&#039;Modes&#039;&#039;&#039; : The modes that this cache store instance can serve.&lt;br /&gt;
; &#039;&#039;&#039;Supports&#039;&#039;&#039; : &#039;&#039;Advanced&#039;&#039;. The features supported by this cache store instance.&lt;br /&gt;
; &#039;&#039;&#039;Locking mechanism&#039;&#039;&#039; : &#039;&#039;Advanced&#039;&#039;. The locking mechanism this cache store instance will make use of. We&#039;ve not discussed this yet, but read on and you&#039;ll find information on it.&lt;br /&gt;
; &#039;&#039;&#039;Actions&#039;&#039;&#039; : Any actions that can be performed against this cache store instance.&lt;br /&gt;
&lt;br /&gt;
===Known cache definitions===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-04-known-cache-definitions.png|thumb|500px|Known cache definitions screenshot]]&lt;br /&gt;
&lt;br /&gt;
The idea of a cache definition hasn&#039;t been discussed here yet. It is something controlled by the developer. When they create a cache they can do so in two ways, the first is by creating a cache definition. This is essentially telling Moodle about the cache they&#039;ve created. The second way is to create an Adhoc cache. Developers are always encouraged to use the first method. Only caches with a definition can be mapped and further configured by the admin. Adhoc caches will make use of default settings only.&amp;lt;br /&amp;gt;&lt;br /&gt;
Typically Adhoc caches are only permitted in situations where the cache is small and configuring it beyond defaults would provide no benefit to administrators. Really its like saying you the administrator doesn&#039;t need to concern yourself with it.&lt;br /&gt;
&lt;br /&gt;
For each cache shown here you get the following information:&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Definition&#039;&#039;&#039; : A concise description of this cache.&lt;br /&gt;
; &#039;&#039;&#039;Mode&#039;&#039;&#039; : The cache type this cache is designed for.&lt;br /&gt;
; &#039;&#039;&#039;Component&#039;&#039;&#039; : The code component the cache is associated with.&lt;br /&gt;
; &#039;&#039;&#039;Area&#039;&#039;&#039; : The area of code this cache is serving within the component.&lt;br /&gt;
; &#039;&#039;&#039;Store mappings&#039;&#039;&#039; : The store or stores that will be used for this cache.&lt;br /&gt;
; &#039;&#039;&#039;Sharing&#039;&#039;&#039; : How is sharing configured for this site.&lt;br /&gt;
; &#039;&#039;&#039;Actions&#039;&#039;&#039; : Any actions that can be performed on the cache. Typically you can edit the cache store instance mappings, edit sharing, and purge the cache.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also find at the bottom of this table a link title &amp;quot;Rescan definitions&amp;quot;. Clicking this link will cause Moodle to go off an check all core components, and installed plugins looking for changes in the cache definitions.&amp;lt;br /&amp;gt;&lt;br /&gt;
This happens by default during upgrade, and if a new cache definition is encountered. However should you find yourself looking for a cache that isn&#039;t there this may be worth a try.&amp;lt;br /&amp;gt;&lt;br /&gt;
It is also handy for developers as it allows them to quickly apply changes when working with caches. It is useful when tweaking cache definitions to find what works best.&lt;br /&gt;
&lt;br /&gt;
Information on specific cache definitions can be found on the [[Cache definitions]] page.&lt;br /&gt;
&lt;br /&gt;
===Summary of cache lock instances===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-05-summary-of-cache-lock-instances.png|thumb|500px|Summary of cache lock instances screenshot]]&lt;br /&gt;
&lt;br /&gt;
As mentioned above cache locking is an advanced concept in MUC.&amp;lt;br /&amp;gt;&lt;br /&gt;
The table here shows information on the configured locking mechanisms available to MUC. By default just a single locking mechanism is available, file locking.&lt;br /&gt;
At present there are no caches that make use of this and as such I won&#039;t discuss it further here.&lt;br /&gt;
&lt;br /&gt;
===Stores used when no mapping is present===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-06-stores-used-when-no-mapping-is-present.png|thumb|500px|Mapping of default stores screenshot]]&lt;br /&gt;
&lt;br /&gt;
This table quickly shows which cache store instances are going to be used for cache types if there are specific mappings in place.&amp;lt;br /&amp;gt;&lt;br /&gt;
Of simply this shows the default cache store instances.&lt;br /&gt;
&lt;br /&gt;
At the bottom you will notice there is a link &amp;quot;Edit mappings&amp;quot; that takes you to a page where you can configure this.&lt;br /&gt;
&lt;br /&gt;
==Adding cache store instances==&lt;br /&gt;
&lt;br /&gt;
The default configuration is going to work for all sites, however you may be able to improve your sites performance by making use of various caching backends and techniques. The first thing you are going to want to do is add cache store instances configured to connect to/use the cache backends you&#039;ve set up.&lt;br /&gt;
&lt;br /&gt;
===File cache===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-07-add-file-cache-store.png|thumb|300px|Adding a file cache store screenshot]]&lt;br /&gt;
&lt;br /&gt;
When on the cache configuration screen within the &#039;&#039;Installed cache stores&#039;&#039; table you should be able to see the File cache plugin, click &#039;&#039;`Add instance`&#039;&#039; to start the process of adding a file cache store instance.&lt;br /&gt;
&lt;br /&gt;
When creating a file cache there is in fact only one required param, the store name. The store name is used to identify the file store instance in the configuration interface and must be unique to the site.&lt;br /&gt;
It can be anything you want, but we would advice making it something that describes you intended use of the file store.&lt;br /&gt;
&lt;br /&gt;
The following properties can also be specified, customising where the file cache will be located, and how it operates.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Cache path&#039;&#039;&#039; : Allows you to specify a directory to use when storing cache data on the file system. Of course the user the webserver is running as must have read/write access to this directory. By default (blank) the Moodledata directory will be used.&lt;br /&gt;
; &#039;&#039;&#039;Auto create directory&#039;&#039;&#039; : If enabled when the cache is initialised if the specified directory does not exist Moodle will create it. If this is specified and the directory does not exist the the cache will be deemed not ready and will not be used.&lt;br /&gt;
; &#039;&#039;&#039;Single directory store&#039;&#039;&#039; : By default the file store will create a subdirectory structure to store data in. The first 3 characters of the data key will be used as a directory. This is useful in avoiding file system limits it the file system has a maximum number of files per directory. By enabling this option the file cache will not use subdirectories for storage of data. This leads to a flat structure but one that is more likely hit file system limits. Use with care.&lt;br /&gt;
; &#039;&#039;&#039;Prescan directory&#039;&#039;&#039; : One of the features the file cache provides is to prescan the storage directory when the cache is first used. This leads to faster checks of files at the expense of an in-depth read.&lt;br /&gt;
&lt;br /&gt;
The file cache store is the default store used for application caches and by default the moodledata directory gets used for the cache.&lt;br /&gt;
File access can be a taxing resource in times of increased load and the following are some ideas about configuring alternative file stores in order to improve performance.&lt;br /&gt;
&lt;br /&gt;
First up is there a faster file system available for use on your server.&amp;lt;br /&amp;gt;&lt;br /&gt;
Perhaps you&#039;ve an SSD installed but are not using it for your moodledata directory because space is a premium.&amp;lt;br /&amp;gt;&lt;br /&gt;
You should consider creating a directory or small partition on your SSD and creating a file store to use that instead of your Moodle data directory.&lt;br /&gt;
&lt;br /&gt;
Next you&#039;ve not got a faster drive available for use, but you do have plenty of free space.&amp;lt;br /&amp;gt;&lt;br /&gt;
Something that may be worth giving a shot would be to create a small partition on the drive you&#039;ve got installed that uses a performance orientated file system.&amp;lt;br /&amp;gt;&lt;br /&gt;
Many linux installations these days for example use EXT4, a nice file system but one that has overheads due to the likes of journalling.&amp;lt;br /&amp;gt;&lt;br /&gt;
Creating a partition and using a file system that has been optimised for performance may give you that little boost you are looking for. Remember caches are designed to be volatile and choosing a file system for a cache is different decision to choosing a file system for your server.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally if you&#039;re ready to go to lengths and have an abundance of memory on your server you could consider creating a ramdisk/tmpfs and pointing a file store at that.&lt;br /&gt;
Purely based in memory, it is volatile exactly like the cache is, and file system performance just isn&#039;t going to get much better than this.&amp;lt;br /&amp;gt;&lt;br /&gt;
Of course you will be limited in space and you are essentially taking that resource away from your server.&lt;br /&gt;
&lt;br /&gt;
Please remember with all of these ideas that they are just ideas.&amp;lt;br /&amp;gt;&lt;br /&gt;
What ever you choose - test, test, test, be sure of the decision you make.&lt;br /&gt;
&lt;br /&gt;
===Memcache===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-08-add-memcache-store.png|thumb|300px|Add Memcache store screenshot]]&lt;br /&gt;
&lt;br /&gt;
Before you can add a Memcache store instance you must first have a Memcached server you can access and have the Memcache php extension installed and enabled on your web server.&lt;br /&gt;
&lt;br /&gt;
Like the file store you must provide a the store name. It is used to identify the store instance in the configuration interface and must be unique to the site.&amp;lt;br /&amp;gt;&lt;br /&gt;
For a Memcache store you must also enter the Memcache server, or servers you wish it to make use of.&lt;br /&gt;
Servers should be added one per line and each line can contain 1 to 3 properties separated by colons.&lt;br /&gt;
# The URL or IP address of the server (required)&lt;br /&gt;
# The port the server is listening on (optional)&lt;br /&gt;
# The weight to give this server (optional)&lt;br /&gt;
&lt;br /&gt;
For example, if you had two Memcached instances running on your server, one configured for the default port, and one configured for 11212 you would use the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
127.0.0.1:11212&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally you can also specify a key prefix to use. What you enter here will prefixed to all keys before accessing the server and can be used to effectively partition the Memcache space in a recognisable way. This can be handy if you have a management tool for you Memcached server that you use to inspect what is stored there.&lt;br /&gt;
&lt;br /&gt;
===Memcached===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-09-add-memcached-store.png|thumb|300px|Add Memcached store screenshot]]&lt;br /&gt;
&lt;br /&gt;
Like the Memcache store you must first have a Memcached server you can access and have the Memcached php extension installed and enabled on your server.&lt;br /&gt;
&lt;br /&gt;
Also like the Memcache store there are two required parameters in configuring a Memcached store.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Store name&#039;&#039;&#039; : It is used to identify the store instance in the configuration interface and must be unique to the site.&lt;br /&gt;
; &#039;&#039;&#039;Servers&#039;&#039;&#039; : The servers you wish this cache store use. See below for details.&lt;br /&gt;
&lt;br /&gt;
Servers should be added one per line and each line can contain 1 to 3 properties separated by colons.&lt;br /&gt;
# The URL or IP address of the server (required)&lt;br /&gt;
# The port the server is listening on (optional)&lt;br /&gt;
# The weight to give this server (optional)&lt;br /&gt;
&lt;br /&gt;
For example, if you had two Memcached instances running on your server, one configured for the default port, and one configured for 11212 you would use the following:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
127.0.0.1:11212&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also several optional parameters you can set when creating a Memcached store.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Use compression&#039;&#039;&#039; : Defaults to true, but can be disabled if you wish.&lt;br /&gt;
; &#039;&#039;&#039;Use serialiser&#039;&#039;&#039; : Allows your to select which serialiser gets used when communicating with the Memcache server. By default the Memcached extension and PHP only provide one serialised, however there is a couple of others available for installation if you go looking for them. One for example is the igbinary found at https://github.com/igbinary/igbinary.&lt;br /&gt;
; &#039;&#039;&#039;Prefix key&#039;&#039;&#039; : Allows you to set some characters that will be prefixed to all keys before interacting with the server.&lt;br /&gt;
; &#039;&#039;&#039;Hash method&#039;&#039;&#039; : The hash method provided by the Memcached extension is used by default here. However you can select to use an alternative if you wish. http://www.php.net/manual/en/memcached.constants.php provides a little information on the options available. Please note if you wish to you can also override the default hash function PHP uses within your php.ini.&lt;br /&gt;
; &#039;&#039;&#039;Buffer writes&#039;&#039;&#039; : Disabled by default, and for good reason. Turning on buffered writes will minimise interaction with the Memcached server by buffering io operations. The downside to this is that on a system with any concurrency there is a good chance multiple requests will end up generating the data because no one had pushed it to the Memcached server when they first requested it. Enabling this can be advantageous for caches that are only accessed in capability controlled areas for example where multiple interaction is taking a toll on network resources or such. But that is definitely on the extreme tweaking end of the scale.&lt;br /&gt;
&lt;br /&gt;
===MongoDB===&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-10-add-mongodb-store.png|thumb|300px|Add MongoDB store screenshot]]&lt;br /&gt;
&lt;br /&gt;
MongoDB is an open source document orientated NoSQL database. Check out their website www.mongodb.org for more information.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Store name&#039;&#039;&#039; : Used to identify the store instance in the configuration interface and must be unique to the site.&lt;br /&gt;
; &#039;&#039;&#039;Server&#039;&#039;&#039; : This is the connection string for the server you want to use. Multiple servers can be specified using a comma-separated list.&lt;br /&gt;
; &#039;&#039;&#039;Database&#039;&#039;&#039; : The name of the database to make use of.&lt;br /&gt;
; &#039;&#039;&#039;Username&#039;&#039;&#039; : The username to use when making a connection.&lt;br /&gt;
; &#039;&#039;&#039;Password&#039;&#039;&#039; : The password of the user being used for the connection.&lt;br /&gt;
; &#039;&#039;&#039;Replica set&#039;&#039;&#039; : The name of the replica set to connect to. If this is given the master will be determined by using the ismaster database command on the seeds, so the driver may end up connecting to a server that was not even listed.&lt;br /&gt;
; &#039;&#039;&#039;Use&#039;&#039;&#039; : If enabled the usesafe option will be used during insert, get, and remove operations. If you&#039;ve specified a replica set this will be forced on anyway.&lt;br /&gt;
; &#039;&#039;&#039;Use safe value&#039;&#039;&#039; : You can choose to provide a specific value for use safe. This will determine the number of servers that operations must be completed on before they are deemed to have been completed.&lt;br /&gt;
; &#039;&#039;&#039;Use extended keys&#039;&#039;&#039; : If enabled full key sets will be used when working with the plugin. This isn&#039;t used internally yet but would allow you to easily search and investigate the MongoDB plugin manually if you so choose. Turning this on will add an small overhead so should only be done if you require it.&lt;br /&gt;
&lt;br /&gt;
==Mapping a cache to a store instance==&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-11-store-mapping.png|thumb|300px|Cache definition store mapping screenshot]]&lt;br /&gt;
&lt;br /&gt;
Mapping a store instance to a cache tells Moodle to use that store instance when the cache is interacted with. This allows the Moodle administrator to control where information gets stored and to most importantly optimise performance of your site by making the most of the resources available to your site.&lt;br /&gt;
&lt;br /&gt;
To set a mapping first browse to the cache configuration screen.&amp;lt;br /&amp;gt;&lt;br /&gt;
Proceed to find the &#039;&#039;Known cache definitions&#039;&#039; table and within it find the cache you&#039;d like to map.&lt;br /&gt;
In the actions column select the link for &#039;&#039;&#039;Edit mappings&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The screen you are presented allows you to map one or more cache store instances to be used by this cache.&lt;br /&gt;
&lt;br /&gt;
If no stores are mapped for the cache then the default stores are used. Have a look at the section below for information on changing the default stores.&lt;br /&gt;
&lt;br /&gt;
If a single store instance is mapped to the cache the following occurs:&lt;br /&gt;
; &#039;&#039;Getting data from the cache&#039;&#039; : Moodle asks the cache to get the data. The cache attempts to get it from the store. If the store has it it gives it to the cache, and the cache gives it to Moodle so that it can use the data. If the store doesn&#039;t have it the a fail is returned and Moodle will have to generate the data and will most likely then send it to the cache.&lt;br /&gt;
; &#039;&#039;Storing data in the cache&#039;&#039; : Moodle will ask the cache to store some data, and the cache will give it to the cache store.&lt;br /&gt;
&lt;br /&gt;
If multiple store instances are mapped to the cache the following occurs:&lt;br /&gt;
; &#039;&#039;Getting data from a store&#039;&#039; : Moodle asks the cache to get the data. The cache attempts to get it from the first store. If the first store has it then it returns the data to the cache and the cache returns it to Moodle. If the first store doesn&#039;t have the data then it attempts to get the data from the second store. If the second store has it it returns it to the first store that then stores it itself before returning it to the cache. If it doesn&#039;t then the next store is used. This continue until either the data is found or there are no more stores to check.&lt;br /&gt;
; &#039;&#039;Storing data in the cache&#039;&#039; : Moodle will ask the cache to store some data, the cache will give it to every mapped cache store for storage.&lt;br /&gt;
&lt;br /&gt;
The main advantage to assigning multiple stores is that you can introduce cache redundancy. Of course this introduces an overhead so it should only be used when actually required.&lt;br /&gt;
The following is an example of when mapping multiple stores can provide an advantage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario:&lt;br /&gt;
You have have a web server that has a Moodle site as well as other sites.&lt;br /&gt;
You also have a Memcache server that is used by several sites including Moodle.&lt;br /&gt;
&lt;br /&gt;
Memcache has a limited size cache, that when full and requested to store more information frees space by dropping the least used cache entries.&lt;br /&gt;
&lt;br /&gt;
You want to use Memcache for your Moodle site because it is fast, however you are aware that it may introduce more cache misses because it is a heavily used Memcache server.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
To get around this you map two stores to caches you wish to use Memcache.&lt;br /&gt;
You make Memcache the primary store, and you make the default file store the final cache store.&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
By doing this you&#039;ve created redundancy, when something is requested Moodle first tries to get it from Memcache (the fastest store) and if its not there it proceeds to check the file cache.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just a couple more points of interest:&lt;br /&gt;
&lt;br /&gt;
* Mapping multiple caches will introduce overhead, the more caches mapped the more overhead.&lt;br /&gt;
* Consider the cache stores you are mapping to, if data remains there once set then there is no point mapping any further stores after it. This technique is primarily valuable in situations where data is not guaranteed to remain after being set.&lt;br /&gt;
* Always test your configuration. Enable the display of performance information and then watch which stores get used when interacting with Moodle in such a way as to trigger the cache.&lt;br /&gt;
&lt;br /&gt;
==Setting the stores that get used when no mapping is present==&lt;br /&gt;
&lt;br /&gt;
[[Image:caching-27-12-default-store-mapping.png|thumb|300px|Setting which stores get used when no mapping is present screenshot]]&lt;br /&gt;
&lt;br /&gt;
This is really setting the default stores that get used for a cache type when there is not a specific mapping that has been made for it.&lt;br /&gt;
&lt;br /&gt;
To set a mapping first browse to the cache configuration screen.&amp;lt;br /&amp;gt;&lt;br /&gt;
Proceed to find the &#039;&#039;Stores used when no mapping is present&#039;&#039; table.&amp;lt;br /&amp;gt;&lt;br /&gt;
After the table you will find a link &#039;&#039;&#039;Edit mappings&#039;&#039;&#039;, click this.&lt;br /&gt;
&lt;br /&gt;
On the screen you are presented with you can select one store for each cache type to use when a cache of the corresponding type gets initialised and there is not an explicit mapping for it.&lt;br /&gt;
&lt;br /&gt;
Note that on this interface the drop downs only contain store instances that are suitable for mapping to the type.&lt;br /&gt;
Not all instances will necessarily be shown. If you have a store instance you don&#039;t see then it is not suitable for &#039;&#039;&#039;ALL&#039;&#039;&#039; the cache definitions that exist.&amp;lt;br /&amp;gt;&lt;br /&gt;
You will not be able to make that store instance the default, you will instead need to map it explicitly to each cache you want/can use it for.&lt;br /&gt;
&lt;br /&gt;
==Configuring caching for your site==&lt;br /&gt;
&lt;br /&gt;
This is where it really gets tricky, and unfortunately there is no step-by-step guide to this.&lt;br /&gt;
&lt;br /&gt;
How caching can be best configured for a site comes down entirely to the site in question and the resources available to it.&lt;br /&gt;
&lt;br /&gt;
What can be offered are some tips and tricks to get you thinking about things and to perhaps introduce ideas that will help you along the way.&lt;br /&gt;
&lt;br /&gt;
If you are reading this document and you&#039;ve learnt a thing or two about configuring caching on your site share your learnings by adding to the points here.&lt;br /&gt;
&lt;br /&gt;
* Plan it. It&#039;s a complex thing. Understand your site, understand your system, and really think how users will be using it all.&lt;br /&gt;
* If you&#039;ve got a small site the gains aren&#039;t likely to be significant, if you&#039;ve got a large site getting this right can lead to a substantial boost in performance.&lt;br /&gt;
* When looking at cache backends really research the advantages and disadvantages of each. Keep your site in mind when thinking about them. Depending upon your site you may find that no one cache backend is going to meet the entire needs of your site and that you will benefit from having a couple of backends at your disposal.&lt;br /&gt;
* Things aren&#039;t usually as simple as installing a cache backend and then using it. Pay attention to configuration and try to optimise it for your system. Test it separately and have an understanding of its performance before tell Moodle about it. The cache allows you to shift load off the database and reduce page request processing.&amp;lt;br /&amp;gt;If for instance you have Memcache installed but your connection has not been optimised for it you may well find yourself in a losing situation before you even tell Moodle about the Memcache server.&lt;br /&gt;
* When considering your default store instances keep in mind that they must operate with data sets of varying sizes and frequency. For a large site really your best bet is to look at each cache definition and map it to a store that is best suited for the data it includes and the frequency of access.&amp;lt;br /&amp;gt;Cache definitions have been documented [[Cache definitions]].&lt;br /&gt;
* Again when mapping store instances to caches really think about the cache you are mapping and make a decision based upon what you understand of your site and what you know about the cache.&amp;lt;br /&amp;gt;Cache definitions have been documented [[Cache definitions]].&lt;br /&gt;
* Test your configuration. If you can stress test it even better! If you turn on performance information Moodle will also print cache access information at the bottom of the screen. You can use this to visually check the cache is being used as you expect, and it will give you an indication of where misses etc are occurring.&lt;br /&gt;
* Keep an eye on your backend. Moodle doesn&#039;t provide a means of monitoring a cache backend and that is certainly something you should keep an eye on. Memcache for instance drops least used data when full to make room for new entries. APC on the other hand stops accepting data when full. Both will impact your performance if full and you&#039;re going to encounter misses. However APC when full is horrible, but it is much faster.&lt;br /&gt;
&lt;br /&gt;
==Other performance testing==&lt;br /&gt;
&lt;br /&gt;
Two links that might be useful to anyone considering testing performance on their own servers:&lt;br /&gt;
&lt;br /&gt;
* [http://www.iteachwithmoodle.com/2012/10/12/moodle-performance-testing-how-much-more-horsepower-do-each-new-versions-of-moodle-require/ Moodle performance testing: how much more horsepower do each new versions of Moodle require?]&lt;br /&gt;
* [http://www.iteachwithmoodle.com/2012/10/11/how-to-stress-test-your-moodle-server-using-loadstorm/ How to load test your Moodle server using Loadstorm]&lt;br /&gt;
&lt;br /&gt;
==Other performance advice for load-balanced web servers==&lt;br /&gt;
&lt;br /&gt;
# In Moodle 2.4 onwards with load-balanced web servers, don&#039;t use the default caching option that stores the data in moodledata on a shared network drive.   Use memcached instead.   See Tim Hunt&#039;s article on http://tjhunt.blogspot.de/2013/05/performance-testing-moodle.html&lt;br /&gt;
# In Moodle 2.6 onwards make sure you set $CFG-&amp;gt;localcachedir to some local directory in config.php (for each node).  This will speed up some of the disk caching that happens outside of MUC, such as themes, javascript, libraries etc.&lt;br /&gt;
&lt;br /&gt;
==More information==&lt;br /&gt;
* [[Cache definitions]] Information on the cache definitions found within Moodle.&lt;br /&gt;
* [[:dev:Cache API|Cache API]] Details of the Cache API.&lt;br /&gt;
* [[:dev:Cache API - Quick reference|Cache API - Quick reference]] A short, code focused page of on the Cache API.&lt;br /&gt;
* [[:dev:The Moodle Universal Cache (MUC)|The Moodle Universal Cache (MUC)]] The original cache specification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cache related forum discussions that may help in understanding MUC:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=217195 MUC is here, now what?] &lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=226123 Status of MUC?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=222250 Putting cachedir on local disks in cluster]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=232122 moodle cachestore_file]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other:&lt;br /&gt;
* [http://jfilip.ca/2013/08/20/moodle-2-4-5-vs-2-5-1-performance-and-muc-apc-cache-store/ Moodle 2.4.5 vs. 2.5.1 performance and MUC APC cache store] blog post by Justin Filip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[de:Caching]]&lt;br /&gt;
[[es:Cacheando]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/37/en/index.php?title=Using_Database&amp;diff=110789</id>
		<title>Using Database</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/37/en/index.php?title=Using_Database&amp;diff=110789"/>
		<updated>2014-03-06T13:10:21Z</updated>

		<summary type="html">&lt;p&gt;Howardsmiller: /* Importing many entries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Database}}&lt;br /&gt;
==Views==&lt;br /&gt;
&lt;br /&gt;
===View list===&lt;br /&gt;
&lt;br /&gt;
The list view shows multiple entries, possibly in a more abbreviated form to ensure all the information fits. You may use the controls at the bottom of the screen to search and sort the contents.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;View single&#039;&#039;: one item at a time&lt;br /&gt;
* &#039;&#039;View list&#039;&#039; : several items at a time (number is user defined)&lt;br /&gt;
* &#039;&#039;Add entry&#039;&#039; : add an item to the database&lt;br /&gt;
* &#039;&#039;Search&#039;&#039;    : search the entries &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:26databaseview.png]]&lt;br /&gt;
&lt;br /&gt;
=== View single ===&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may view only one entry at a time. This might allow you to view more detailed information than the list view.&lt;br /&gt;
&lt;br /&gt;
=== Add comment ===&lt;br /&gt;
&lt;br /&gt;
If comments have been enabled, you may add a comment.&lt;br /&gt;
&lt;br /&gt;
=== Rate entries ===&lt;br /&gt;
&lt;br /&gt;
If ratings have been enabled, and made viewable, by the database editor, you may [[Grades|grade]] other database entries, and view these ratings.&lt;br /&gt;
&lt;br /&gt;
==Adding an entry==&lt;br /&gt;
&lt;br /&gt;
Go to the &amp;quot;Add entry&amp;quot; tab and fill in the form.&lt;br /&gt;
===Deleting multiple entries===&lt;br /&gt;
{{New features}}&lt;br /&gt;
In List view, a checkbox will appear next to each entry. Select the entries you wish to delete and click the &#039;Delete selected&#039; button. Alternatively, click the &#039;Select all&#039; and the &#039;Delete all&#039; buttons to delete all entries. A warning message will appear asking you to verify what you wish to delete.&lt;br /&gt;
&lt;br /&gt;
==Automatically linking database entries==&lt;br /&gt;
&lt;br /&gt;
If the [[Database auto-linking filter]] is enabled, any entries in a database will be automatically linked to where the concept words and/or phrases appear within the same course. This includes forum postings, internal resources, week summaries etc.&lt;br /&gt;
&lt;br /&gt;
Note: If you do not want particular text to be linked (in a forum posting, say) then you should add &amp;lt;nolink&amp;gt; and &amp;lt;/nolink&amp;gt; tags around the text. Alternatively the filter can be disabled for a particular activity.&lt;br /&gt;
==Approving and undoing approval of entries==&lt;br /&gt;
&lt;br /&gt;
If, during database set up, &#039;Approval required&#039; was set to &#039;Yes&#039; then a teacher can approve an entry by clicking on the tick/checkmark icon.&lt;br /&gt;
&lt;br /&gt;
Once an entry has been approved, it is possible to undo the approval by clicking the circle with a line through it icon. {{New features}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:26databaseapprove.png|thumb|Entry approved]]&lt;br /&gt;
|[[File:26databaseunapprove.png|thumb|Approval undone]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing many entries==&lt;br /&gt;
You can import entries via a CSV file if you click the &amp;quot;Import entries&amp;quot; link under &#039;Database activity administration&#039; in the Settings block. CSV means Comma-Separated-Values and is a common format for text interchange.&lt;br /&gt;
&lt;br /&gt;
[[image:Databaseupload.png]]&lt;br /&gt;
&lt;br /&gt;
The easiest way to determine the format of the text file is to manually add an entry to the database and then export it. The resulting export text file may then be edited and used for importing entries. Here&#039;s a sample of what a very simple file will look like.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upload_csv_sample.png]]&lt;br /&gt;
&lt;br /&gt;
The expected file format is a plain text file with a list of field names as the first record. The data then follows, one record per line.&lt;br /&gt;
&lt;br /&gt;
The field delimiter defaults to a comma character and the field enclosure is not set by default (field enclosures are characters that surround each field in each record).&lt;br /&gt;
&lt;br /&gt;
Records should be delimited by new lines (usually generated by pressing RETURN or ENTER in your text editor). Tabs can be specified using \t and newlines by \n.&lt;br /&gt;
&lt;br /&gt;
Sample file:&lt;br /&gt;
&lt;br /&gt;
  name,height,weight&lt;br /&gt;
  Kai,180cm,80kg&lt;br /&gt;
  Kim,170cm,60kg&lt;br /&gt;
  Koo,190cm,20kg&lt;br /&gt;
&lt;br /&gt;
Note: Certain field types may not be supported.&lt;br /&gt;
&lt;br /&gt;
Do not put spaces after your commas or upload will fail!&lt;br /&gt;
&lt;br /&gt;
After upload page import.php comes back blank if it failed. &lt;br /&gt;
If successful you&#039;ll read a message like, &amp;quot;1 entries saved&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Exporting entries==&lt;br /&gt;
&lt;br /&gt;
You can export entries either in CSV (comma separated values) or ODS (OpenOffice Calc) formats by clicking the tab at the top or by clicking the &amp;quot;Export entries&amp;quot; link under &#039;Database activity administration&#039; in the Settings block. (Both CSV and ODS formats can be opened with MS Excel.)&lt;br /&gt;
&lt;br /&gt;
[[File:Databasexport.png]]&lt;br /&gt;
&lt;br /&gt;
When using the CSV format, the user can select either the comma, semicolon, or tab to separate the fields. The selection of the proper character is important. If users select to use a comma to separate the fields and some of the fields contain data with commas then the number of columns is going to be misaligned and likely cause confusion.&lt;br /&gt;
&lt;br /&gt;
Users can select which fields from the database they wish to have exported. By default, all fields are checked to be included. Choose the fields that you wish to have included in the export.&lt;br /&gt;
&lt;br /&gt;
Once the export type and the fields to be exported have been selected, clicking on the Export entries pushbutton will generate the file. The user will usually have the option of either opening or saving the file.&lt;br /&gt;
&lt;br /&gt;
For information on converting the date export (and import) format, see the discussion [https://moodle.org/mod/forum/discuss.php?d=220505 Standard Database Module - Dates].&lt;br /&gt;
&lt;br /&gt;
==Exporting to an external portfolio==&lt;br /&gt;
&lt;br /&gt;
If an external [[Portfolios|portfolio]] such as [[Mahara_portfolio|Mahara]] has been enabled by the administrator then users have the option to export individual entries to that portfolio. They will see at the bottom of a database entry an &amp;quot;export&amp;quot; icon to click on and select the portfolio to export to:&lt;br /&gt;
&lt;br /&gt;
[[File:Exportdatabasentry.png]]&lt;br /&gt;
&lt;br /&gt;
== Example databases ==&lt;br /&gt;
&lt;br /&gt;
Moodle.org has two good examples of the database module in action:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?id=6140 Moodle Buzz], a database of the titles, authors and web links to news articles mentioning Moodle&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=26 Themes], a database with screenshots, download links and user comments about Moodle [[Themes|themes]]&lt;br /&gt;
&lt;br /&gt;
== Creative uses ==&lt;br /&gt;
&lt;br /&gt;
You could use the database module to:&lt;br /&gt;
&lt;br /&gt;
* allow collaboration on building a collection of web links/books/journal references related to a particular subject&lt;br /&gt;
* display student created photos/posters/websites/poems for peer comment and review&lt;br /&gt;
* gather comments and votes on a shortlist of potential logos/mascot names/project ideas&lt;br /&gt;
* provide a [http://moodle.org/mod/forum/discuss.php?d=52699 student file storage area]&lt;br /&gt;
* maintain a log of what was done in a face-to-face class each day, so that absent students can get caught up themselves.  [http://moodle.org/mod/forum/discuss.php?d=115047 Example]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
*[http://school.demo.moodle.net/course/view.php?id=127&amp;amp;section=3 Examples of databases in the School demo site] (available for download)&lt;br /&gt;
* [[Dataform module]], which is a major enhancement of the Database module with improved browsing, editing, searching and other features.&lt;br /&gt;
* [[Glossary module]], which performs a similar though more specialised, text-based role&lt;br /&gt;
* [[Using Moodle book]] Chapter 12: Databases&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=3505 Database activity module forum]&lt;br /&gt;
* [http://treadwell.cce.cornell.edu/moodle_doc/database_moodle/index.html Screencast introducing the Database Module and walking through creating a database]&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?rid=2424 Tracking Students&#039; Reading with the Moodle Database Module] presentation&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=72260 Database Module: Each learner Private DB?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=84487 Database for Dummies please!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=89117 Restricting access to database content by user?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=139137 How to use the database activity module?]&lt;br /&gt;
&lt;br /&gt;
[[de:Datenbank nutzen]]&lt;br /&gt;
[[es:Usando BasedeDatos]]&lt;/div&gt;</summary>
		<author><name>Howardsmiller</name></author>
	</entry>
</feed>