<p>Moodle is primarily developed in Linux using PHP, Apache and MySQL, and regularly
tested with PostgreSQL and in Windows XP and Mac OS X environments.</p>
<p>All you should need are:</p>
<ol>
<li>a working installation of <AHREF="http://www.php.net/">PHP</A> (version
4.1.0 or later), with the following features enabled (most PHP installations
these days will have all of these):
<ul>
<LI>JPEG and/or PNG image editing support via the <AHREF="http://www.boutell.com/gd/">GD library</A></li>
<LI>Sessions support</LI>
<LI>File uploading allowed</LI>
</UL>
</LI>
<li>a working database server: <AHREF="http://www.mysql.com/">MySQL</A> or <AHREF="http://www.postgresql.org/">PostgreSQL</A> are recommended. (MSSQL, Oracle, Interbase, Foxpro, Access, ADO, Sybase, DB2 or ODBC are also theoretically supported but will require you to manually set up the database tables).</li>
</ol>
<p>On a Windows platform, the quickest way to satisfy these requirements is
to download <AHREF="http://www.foxserv.net/">FoxServ</A>,
or <AHREF="http://www.easyphp.org/">EasyPHP</A> which will install Apache,
PHP, and MySQL for you. Make sure you enable the GD module so Moodle can process
images - you may have to edit php.ini and remove the comment (;) from this
line: 'extension=php_gd.dll'.</p>
<p>On Mac OS X I highly recommend the <ahref="http://fink.sourceforge.net/">fink</a>
project as a way to download easily-maintainable packages for all of this.</p>
<p>If you're on Linux or another Unix then I'll assume you can figure all this out for yourself! ;-) </p>
</blockquote>
<P> </P>
<H3><ANAME="downloading"></A>2. Download</H3>
<blockquote>
<p>There are two ways to get Moodle, as a compressed package and via CVS. These
are explained in detail on the download page on <AHREF="http://moodle.com/">http://moodle.com/</A></p>
<p>After downloading and unpacking the archive, or checking out the files via
CVS, you will be left with a directory called "moodle", containing
a number of files and folders. </p>
<p>You can either place the whole folder in your web server documents directory,
in which case the site will be located at <B>http://yourwebserver.com/moodle</B>,
or you can copy all the contents straight into the main web server documents
directory, in which case the site will be simply <B>http://yourwebserver.com</B>.</p>
</blockquote>
<P> </P>
<H3><ANAME="site"></A>3. Site structure</H3>
<BLOCKQUOTE>
<p>Here is a quick summary of the contents of the Moodle folder, to help get
you oriented:</p>
<blockquote>
<p>config.php - the only file you need to edit to get started<br>
version.php - defines the current version of Moodle code<BR>
index.php - the front page of the site</p>
<ul>
<li>admin/ - code to administrate the whole server </li>
<li>auth/ - plugin modules to authenticate users </li>
<li>course/ - code to display and manage courses </li>
<li>doc/ - help documentation for Moodle (eg this page)</li>
<li>files/ - code to display and manage uploaded files</li>
<li>lang/ - texts in different languages, one directory per language </li>
<li>lib/ - libraries of core Moodle code </li>
<li>login/ - code to handle login and account creation </li>
<li>mod/ - all Moodle course modules</li>
<li>pix/ - generic site graphics</li>
<li>theme/ - theme packs/skins to change the look of the site.</li>
<li>user/ - code to display and manage users</li>
</ul>
<p> </p>
</blockquote>
</BLOCKQUOTE>
<H3><ANAME="data"></A>4. Create a data directory</H3>
<blockquote>
<p>Moodle will also need some space on your hard disk to store uploaded files,
such as course documents and user pictures.</p>
<p>Create a directory for this purpose somewhere. For security, it's best that
this directory is NOT accessible directly via the web. The easiest way to do this
is to simply locate it OUTSIDE the web directory, otherwise protect it
by creating a file in the data directory called .htaccess, containing this line:
<blockquote>
<PRE>deny from all</PRE>
</blockquote>
<p>To make sure that Moodle can save uploaded files in this directory, check that
the web server software (eg Apache) has permission to write
to this directory. On Unix machines, this means setting the owner of the directory
to be something like "nobody" or "apache".</p>
<p>On many shared hosting servers, you will probably need to restrict all file access
to your "group" (to prevent other webhost customers from looking at or changing your files),
but provide full read/write access to everyone else (which will allow the web server
to access your files). Speak to your server administrator if you are having
trouble setting this up securely.</p>
</blockquote>
<P> </P>
<H3><ANAME="database"></A>5. Create a database</H3>
<blockquote>
<p>You need to create an empty database (eg "moodle") in your database system
along with a special user (eg "moodleuser") that has access to that database
(and that database only). You could use the "root" user if you wanted to, but
this is not recommended for a production system: if hackers manage to discover
the password then your whole database system would be at risk, rather than
just one database.
</p>
<p>Example command lines for MySQL: </p>
<PRE>
# mysql -u root -p
> CREATE DATABASE moodle;
> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON moodle.*
TO moodleuser@localhost IDENTIFIED BY 'yourpassword';
> quit
# mysqladmin -p reload
</PRE>
<p>Example command lines for PostgreSQL: </p>
<PRE>
# su - postgres
> psql -c "create user moodleuser createdb;" template1
<p>On Windows systems: The simplest way is to use my package <ATITLE="Click to download this package (150k)"HREF="http://moodle.com/download/moodle-cron-for-windows.zip">moodle-cron-for-windows.zip</A>
which makes this whole thing very easy. You can also explore using the built-in
Windows feature for "Scheduled Tasks".</p>
</p>
</blockquote>
<H3><ANAME="course"></A>10. Create a new course</H3>
<blockquote>
<p>Now that Moodle is running properly, you can create a course. </p>
<p>Select "Create a new course" from the Admin page (or the admin
links on the home page).</p>
<p>Fill out the form, paying special attention to the course format. You don't
have to worry about the details too much at this stage, as everything can
be changed later by the teacher.</p>
<p>Press "Save changes", and you will be taken to a new form where
you can assign teachers to the course. You can only add existing user accounts
from this form - if you want to create a new teacher account then either ask
the teacher to create one for themselves (see the login page), or create one
for them using the "Add a new user" on the Admin page.</p>
<p>Once done, the course is ready to customise, and is accessible via the "Courses"