Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Beginning Administration 1 FAQ.

Beginning Administration 1 FAQ: Difference between revisions

From MoodleDocs
No edit summary
 
(251 intermediate revisions by 5 users not shown)
Line 1: Line 1:
There is always an element of frustration at the beginning of taking on a Moodle. For many of us, we are employed to do something else, but fall into this and while we have some knowledge or skills, we can often be stumped by the simple things. Not because we are not skilled, just we do not understand enough of the jargon surrounding Moodle to make it work for us. What many people have found is that they are pushing against a door that was never shut. Not a good analogy perhaps, but it does describe what can happen when we begin Administration of a Moodle.  
There is always an element of frustration at the beginning of taking on a Moodle. For many of us, we are employed to do something else, but fall into this. While we have some knowledge or skills, we can often be stumped by the simple things. Not because we are not skilled, just we do not understand enough of the jargon surrounding Moodle to make it work for us. What many people have found is that they are pushing against a door that was never shut. Not a good analogy perhaps, but it does describe what can happen when we begin Administration of a Moodle.  


Most of the questions and answers here can be located somewhere in the Forums if you want to spend the time looking for them. Thanks to all the unknowing and unknown contributors.  
Most of the questions and answers here can be located somewhere in the Forums, or the Moodle Docs, if you want to spend the time looking for them. All this FAQ does is concentrate some of the questions you may be asking in one place. Thanks to all the unknowing and unknown contributors.  


  The only assumption here about what you should know is that you know how to create and edit courses.  
This page has grown a bit quickly and is now over sized. So more pages have been added named [[Beginning Administration 2 FAQ]] and [[Beginning Administration 3 FAQ]]. A number of questions relating to specific, popular, areas have now been moved. One is the [[Front Page FAQ]] and the [[Xampp Installer FAQ]], others will probably follow.  


==What do I really need to know about PHP and MySQL or networking to be a successful Administrator?==
For the moment, ALL answers here relate specifically to '''Moodle 1.9.''x''''' and some earlier versions (e.g. 1.7 and 1.8). Moodle 2.0 questions are not answered here.  
Not a lot really. It is handy to know these things and mostly these are seriously advanced skills. You can get by without knowing too much, initially. Over time though, you may find that you are editing PHP pages more frequently, or directly accessing the database. If you are really interested in gaining those skills, there are a lot of web sites around that will get you started with minimal cost. There are plenty of books as well but professional coaching and tertiary training has the potential for becoming really expensive.    


==I am running Windows 2008 Server and IIS, which download packs should I use?==
For more specific information about Moodle 2.0.x try [https://docs.moodle.org/20/en/Beginning_Moodle_2.0_Administration Beginning Moodle 2.0 Administration].


There are a couple of installation packs you can download. Generally when downloading for the first time we go directly to the [http://download.moodle.org/windows/ Moodle packages for Windows] page. This is a very handy installation package that uses the Xampp installer to set up Apache, MySQL and PHP with a minimum of fuss. This package is the best for the Windows OS on a home Moodle or  a dedicated PC. It is easy to set up and to maintain.
__TOC__
[[Beginning Administration 2 FAQ]]


If you are using your Server as the location for your Moodle, the Xampp installer may not be helpful. You would be much better off using the [http://download.moodle.org/ Standard Moodle Packages]. While this is more work setting up, there are fewer opportunities for things to cancel each other out or cause errors in your network or in Moodle.
[[Xampp Installer FAQ]]


Installing anything, and Moodle is no exception, needs careful planning and clear strategies in place to achieve the desired outcomes. One suggestion is that Moodle should be installed on a dedicated machine, then as it becomes more popular, more heavily trafficked, another machine can be added. The Moodle can be mirrored and the load sharing properties of the NOS can be implemented. This strategy allows the system to grow at demand, organically, if you like while not compromising at any stage the security of the network itself. An alternative could be clustering machines, this is a considerably more cost effective solution to redundancy issues and just as effective as mirroring. The next question then is should it be [[#Installation on a Windows or a Linux server | Linux or Windows]]?
===I want to create a new site in Moodle, but which version should I use? 1.9. or 2.0. ===
In December 2010 this is a tough call. If you pick 1.9.9 to .11, you should probably plan on upgrading to Moodle 2.0 after it has been out a while (say June 2011). There were many changes made to the Moodle's User Interface and underlying structure in 2.0.  In any major new release there are always minor things that are discovered even after extensive testing.


==I have Ubuntu 8.04 server set up as LAMP server and used apt-get to install Moodle. MySQL is on another server, but Moodle won't work.==
Remember that moodle.org has switched to 2.0 and so have a few other large sites including demo.moodle.net, so it is stable. In the longer run, a new site might focus upon adding content to their new 2.0 site, stay away from any customization of underlying code and plan on upgrading every month or so. Then having used it for a while, consider what tweaks to make or add.  


apt-get is an Advanced Packaging Tool that automates the installation process for many Linux distros. While it is an excellent tool under many circumstances, it is not perfect, so it may very well be the problem. [[Administrator documentation#System-specific_Instructions_.26_Packages | Manual installations]] can be a bit more time consuming, but have a much greater chance of success.  
There is also the "old dog, new tricks" effect to consider. Do you want to start with one interface and code set, then switch later and have to relearn some things?  You maybe fine, but what about your teachers?  They are less likely to notice changes in a 2.0 build update and we can guarantee that going from 1.9x to 2.x is a big change that will not escape their notice.


==I have a valid web address, but as I install, I am getting an error message telling me I do not.==
:UPDATE: May 2011. Moodle 2.0.3 has been released and v2.1 has been announced for release in the near future. It is now obvious that new installations of v2.0.x are considerably more advantageous to the User than beginning with a v1.9.12 then changing at some, usually unspecified, time in the future.


Chances are that it is the config.php file that is pointing in the wrong direction. If you can use a text editor that can save in a UFT-8 format, open the config.php file and it may read something like:
===How can I get an overview of using Moodle?===
There are any number of books about Moodle 1.9.x. Perhaps the most immediately useful book is the [[Using Moodle book]] by Helen Foster and Jason Cole. While aimed more at using rather than administration, this book is a handy tool to work out many things about how the administration of your Moodle impacts on how Moodle can be used.  


  $CFG->wwwroot  = 'localhost';
===What do I really need to know about HTML, Javascript, PHP and MySQL or networking to be a successful Administrator?===
  $CFG->dirroot  = 'var/www/Moodle/moodle';
Not a lot.  Certainly you should know something about HTML and there are lots of web sites and books on this subject.  Generally speaking in Moodle, Javascript is a mid-level skill and, PHP and MySQL are advanced skills. If you are really interested in gaining more skills in these programs, there are lots of free to low cost to professional certification paths to follow. There are web sites around that will get you started with minimal cost. There are plenty of books as well. Individualized professional coaching/mentoring/consulting or certified training in several areas is obviously more expensive. Understanding Networking will also come in handy.  The more your site is customized from the standard Moodle package, the more you may need these skills.
  $CFG->dataroot = 'var/www/Moodle/moodledata';
 
when it should look something like:


    $CFG->wwwroot = <nowiki>'http://yourwebsiteURL';</nowiki>
===What tools do I need to use in the Administration of my Moodle===
    $CFG->dirroot = '/home/yourAccountName/public_html';
Different environments will allow to you use some different tools, but essentially, you can get away with just a text editor. There are any number of text editors, but use one that can save the files in a UTF-8 format. For Windows users, Notepad++, TextPad are two that come to mind and there are a lot more, but not Windows' native Notepad. ('''Windows Notepad''' is not fully UTF-8 compliant. Some of its own characters will not be read properly in PHP and Notepad may add additional spaces and end of line or end of file markers that will not be rendered in PHP or rendered badly, crashing the whole site.)
    $CFG->dataroot = '/home/yourAccountName/moodledata';
   
If you are being hosted then the provider may allow you access to something like CPanel in a Linux environment.  
 
This will also repair the error message:
  The 'Data Directory' you specified could not be found or created. Either correct the path or create that directory manually.


==I am getting a blank screen after installing to Windows Vista - What can I do next? ==
===Installation on a Windows or a Linux server ===
There are a great many Moodle documentation pages on this subject. The available Xampp/Windows version of Moodle is workable, but for a larger production (a site with many users, courses and volume)  Linux is the strongly recommended operating system. The simple truth is that it is easier to mirror and load share using Linux than Windows. Building and learning how to use Moodle is easier in Windows. However in the longer term, a Linux based installation is far stronger and thus a much better learning environment to start with for any Administrator. It is suggested that if you can, set up a Moodle in both environments, Ubuntu, SuseLinux and Debian are now relatively easy to install and configure. As for Windows, XP seems more stable than Vista. Windows 7 is reputed to be better than both earlier versions, but as Microsoft is intent on "automating" everything, it appears to be placing more stubborn blocks into the path of the installation of many useful applications. Use of Home versions in MS operating systems is not recommended for any production site.


Installing on Windows Vista has created a number of problems, and it seems that Microsoft has been so intent on improving security that it is refusing to allow very much to happen at all. There is an [[Installing Moodle on Windows Vista | installation page]] that can help you resolve most issues in Vista. Unfortunately, it is no guarantee of success.
Linux is probably better at things like clustering and mirroring. [[Moodle Clusters]] or [[Mirroring Moodle]] are two pages which are developing information about these topics that are useful for larger or more active sites.


== I want to use a dedicated server for Moodle, but how reliable is Moodle together with EasyPHP?==
===Which leads me to which version of Moodle should I use then?===
Obviously the constant updating processes available for Moodle should provide the opportunity for you to keep your Moodle current. But the reality is that we do not always have time to update to the latest release (consider reconstructing tweaks or going from 1.9 to 2.0). If you schedule regular updates, say one per month or one per quarter, this is still somewhat intensive. Most Moodle sites would be perfectly serviceable with a twice annual update, but it is entirely up to you, as the administrator, or the Moodle owners. It is a decision that should be made right at the outset of setting up the first Moodle. The best bet is to use the latest stable version, however often you want to update it.  See the "I want to create a new site in Moodle, but which version should I use? 1.9. or 2.0." question.


If you are going to use a dedicated machine for your Moodle, good idea by the way, then there is no need for you to use EasyPHP at all. If your Moodle server is using XP Pro and a static IP address, then it is easier for you to download and install the [http://download.moodle.org/windows/ Windows Installer Package].
===Should I use a test site to try things out?===
As a general tip, if you have a production site, that is a site that is being used by students or other enrolled persons on a regular basis, then it is a good investment to have a test site. This test site is used by you, the administrator, alone. In it, you can replicate your production site or any aspect of it, by taking a backup of something from your production site and restoring it to your test site. Try out something in this test Moodle first. This way you will always be on top of changes before you make them. If something goes wrong with your test site, it is simple to reinstall.


This package uses the Xampp installer to automatically install and configure Apache Server, MySQL and PHP. Once installation is complete and setup and running, all you may need do is to edit the config.php file to show your IP address. Just as long as you use a text editor that can save in a UTF-8 format.
For some circumstances, the [http://download.moodle.org/windows/ Windows Xaampp installer] may be a better choice for a Windows environment, and while it may not replicate specific server environmental problems, it is handy for a lot of other things. As an alternative, in either a Linux or Windows environment, if you need something specific, once your site is working, back it up and then restore it under a different folder in the web root. As long as no-one knows it is there, and there are no public links to it, then you are the only one who may access it. Of course, you can always make sure that no-one but you can enter the test site. You may not want to do that on one server - due to hosting constraints, so you may chose to create a separate installation on a different computer, which does make it easier to wreck your test site then restore it quickly.  


==When I try to select some pages in the Admin block, I get a "Timed Out" message and the screen reverts to the login page==
[[#top|Top]]
The suspicion here is that the installation process has gone a little wrong and it has not properly installed or configured the PHP engine, but this is a best guess. It is probably better to not waste time on trying to repair it but to reinstall. 


==Why am I just not getting how Permissions and Roles work?==
===Why am I just not getting how Permissions and Roles work?===
Our understanding of [[How permissions are calculated|permissions]] and [[Manage roles|Roles]] is usually based on what we have learned in our networking environment, we log in, we have a set of permission based on that log in and they determine what we can do. This "linear" explanation is based on what we see, not what really happens, of course.  
A new site administrator's understanding of [[How permissions are calculated|permissions]] and [[Manage roles|Roles]] is usually based on their networking environment knowledge. In short: we log in, we are given a set of permission based on that log in and these permissions determine what we can do in a single [[Context|context]]. This "linear" explanation is based on what we see, not what really happens, of course.  


In Moodle, permissions are also known as "capabilities" and they reside with the [[Manage roles|Role]]. The log-in ID does not carry any permissions with it, only a [[Manage roles|Role]]. So stop worrying about trying to learn about permissions, concentrate on the [[Manage roles|Role]] and how they work. Once you have a solid grasp of that, then you can worry about setting permissions.   
In Moodle, [[Role permissions|permissions]] are also known as "capabilities" and they reside with the [[Manage roles|Role]] and can be dependent upon the users location/activity in Moodle. The log-in ID does not carry any traditional network permissions with it, but an initial Role. So stop worrying about trying to learn about permissions, concentrate on the [[Manage roles|Role]] and how that works. Once you have a solid grasp of each Role, then you can worry about setting permissions.   


Roles are context based, so you should only assign Roles within the context of a Course or a Block. If you assign a Role in the Front Page, that Role is assigned to every part of the site. The best advice is that you DO NOT assign any roles from the Front Page.
Roles are [[Context|context]] based. The best advice is DO NOT assign any roles from the Front Page. If you assign a Role in the Front Page, that Role is assigned to every part of the site. A best practice is to only assign Roles within the context of a Course or a Category.


'''Different Roles''' can apply depending on the '''page''' the User is in.  
===What different roles can apply to users as they log in and move around inside the Moodle?===
Only one of many roles (a set of permissions) can be given to a users at log in.  As the user moves to different pages, they can specifically or generically (if they belong to a group of users) be assigned new roles for that just that area, or ''context''.  Here are some concepts that might help.


'''Before anyone logs in''' to the Moodle, sitting at the log in page, or public front page, depending how you have set your Moodle up, they have the role of '''"Guest"'''.   
'''Before anyone logs in''' to the Moodle, sitting at the log in page, or public front page, depending how you have set your Moodle up, they should have the role of '''"Guest"'''.  It is possible to change this but be careful.


'''When everyone''' logs into the Moodle, they become an "'''Authenticated User'''".  
In Moodle, '''when anyone''' with a user name and password logs into the Moodle, they become an "'''Authenticated User'''". How they are authenticated is different from their Role. At this point the contextual nature of Roles kicks in and determines permissions for every user, everywhere a User goes in the site a ''context'' is applied.


For [[#All students are enrolling in every course|reasons explained below]], you may want your Users to become "'''Students'''" while in the '''Front Page'''. (Be careful here, read on below before assigning roles.)
For [[#All students are enrolling in every course|reasons explained below]], you may want your Users to become "'''Students'''" while in the '''Front Page'''. (Be careful here, read on below before assigning roles.)


When they click to go to a Category page, they revert to an "'''Authenticated User'''". Once there, their User Name is scanned and their permissions are calculated and if they have permissions, they can have sufficient rights to be a "'''Teacher'''" or a "'''Course Creator'''" or even an "'''Administrator'''".  
When they click to go to a Category page, they revert to an "'''Authenticated User'''". Once there, their User Name is scanned and their permissions are calculated and if they have permissions, they can have sufficient rights to be a "'''Teacher'''" or a "'''Course Creator'''" or even an "'''Administrator'''", but for most people it will probably remain at '''Authenticated User'''.  


When they click to go to a Course, they may have the rights to be an "'''Administrator'''", a "'''Course Creator'''", a "'''Teacher'''" or a "'''Student'''" in that Course.
When they click to go to a Course, they may have the rights to be an "'''Administrator'''", a "'''Course Creator'''", a "'''Teacher'''" or a "'''Student'''" in that Course.


This does not mean they have any of those rights in any other page or Course.
This does not mean they have any of those rights in any other Category or Course. The Role assigned in one context may not apply in any other context.
 
===How can I be sure I am assigning Roles correctly?===
[[Assign_roles|Assigning Roles]] should be based purely on the page or activity (the [[Context|context]]) and the role you want that person(s) to play.
 
The first question is "what do I want this person to be able to do?" For most people using the Moodle, the obvious Role will be that of Student. Others will need to be [[Course_creator|Course Creators]] or [https://docs.moodle.org/en/Category:Teacher Teachers]. Some Teachers will be Course Creators. Really, the first question should be "what do I want this person to be able to do HERE?"
 
Essentially, if you get it wrong, then your courses can be wrecked. The basic rules are simple, "Do not assign a role in the Front Page." and "Assign roles in the context of the course or Category."
:'''Be aware''', if you create an Administrator role in a [[Add/edit_course_categories|Category]], that will apply across all [[Add/edit_course_categories#Adding_sub_course_categories|sub-Categories]] and [[Course|Courses]] in that Category. It will not apply to ANY other Category, sub-Categories or Courses. If someone is assigned the Role of "Teacher" at a Category level, that Role will apply in ALL sub-Categories and Courses in that Category.
 
[[#top|Top]]


Assigning Roles is based purely on the page, the context, of the role you want each person to play in that page. Be aware though, If you create an Administrator role in a Category, that will apply across all sub-Categories and Courses in that Category. It will not apply to ANY other Category, sub-Categories or Courses. If someone is assigned the Role of "Teacher" at a Category level, that Role will apply in ALL sub-Categories and Courses in that Category.  
===I changed some Roles and things have gone terribly wrong, I cannot log in as Administrator===
Chances are you have changed your Administrator Role, happens all the time and is easily fixed - if you have kept backups of your database. This problem is often caused by changing the default role for all users. Sometimes Administrators include themselves as part of the Role change - thus the problem. Open phpMyAdmin, and if you do not have it installed then do so, but if you are on a network use the full version, not the Moodle plugin - for your own security. Open the database and go to mdl_user table. Check for your own id and make sure you know your own id number. Go to the mdl_role_assignments table and look for YOUR USER ID. Be careful here, your user id number is not the same as the id number in this table, it should be showing in the userid field. If it is there, and the fields "roleid" and "contextid" should both read 1. If not then edit the row to show those values.  


When assigning Roles, ensure that the Role is assigned appropriately i.e. at the right level, in the right '''context'''.
If your id is not there then try these values starting from the "id" field on a line you know is no longer used or add a line into the table using the "Insert" page:
id = (lastid + 1 - this may be an auto-incrementing field so be careful) 1, 1, (your userid number here) 0, 0, 0,  (timevalue here, just copy the previous line's value), 0, (copy enrol value from previous line), 0. The entire line should read something like: 21, 1, 1, 352, 0, 0, 0, 1276947170, 0, manual, 0)


==We do not have "Teachers" and "Students" we use "Mentors" and "Mentees" in some courses as well as "Facilitators" and "Clients" in others, can I change these names?==
NOTE: This worked in a limited test on a Windows server and with XP, and should work if you write the SQL Insert statement correctly. The emphasis is on the "should", because this has not been tested, yet, on a large production server. This is why you need a backup of your database - in case this goes wrong. No guarantee here, sorry.  
[[Image:Rolerenaming03.gif|150px|thumb|left|Renaming Roles]]
Yes you can. Since the introduction of Moodle 1.9, you can assign the titles of any role to what you want. At the bottom of the [[Course settings | Course Settings Page]] is the Role Renaming dialog.  


Just change the names of those roles you want to change and you can safely ignore the rest. To ensure your renaming of the Roles carries over into a backup, make sure you include User Data and it will be there when you Restore.  
The only other, and admittedly faster, alternative is to delete the existing database and use your backup.


==How can I change the look of my Front Page to include a HTML block in the centre column?==
===How do I set the maximum upload file size limit?===
There are lots of different ways to do this but start at ''Administration > Front Page > [[Front Page settings]]''. [[Image:Frontpage04.gif|200px|thumb|right|The changing of Front Page settings.]]
This is probably the most frequently asked question, and the answer is not that straightforward. The changes that need be made are the same in all versions of Moodle, just in different OS' 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:
[[Image:Moodlefrontpage.gif|200px|thumb|left|Images inside a HTML table in a label.]]
  Server level
# Go to '''Front Page''' and change each setting to None, None, None None. This Front Page means '''before''' log in so what do you want your visitors to see?
  Moodle site level
# Go to '''Front page items when logged in''' and change each setting to what you want, or None, None, None, None. This displays '''after''' log in.
  Course level
# Go to '''Include a topic section''' and click this ON, a tick appears in the check box.
  Activity level
# Go to '''Save Changes''' and when saved, return to the Front Page.
# Click the "Turn editing on" button and you should see two drop-down combo boxes and a number of icons.
# Select the "Add a resource" and take your pick of either a Label or a Web Page. (Hint: The label is perhaps a better option here, but suit yourself.


At this point you can edit the label or web page any way you want. You are taken to the WYSIWYG editor so you can include any text or image you like. When done, save it and return to your Front Page and the changes you made should appear.  
Perhaps the best place to find this information is at [https://docs.moodle.org/en/File_upload_size File upload size] There is a full explanation for a number of different OSs but there are a few missing.  


You can also make the blocks used on the Front Page position themselves on the left or the right and have a HTML label taking up the rest of the page. This is a two column option.  
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.


You can also have a single column option by deleting or hiding all your blocks and just use the HTML block.  
===The previous answer is OK if you control the server, but I am hosted, what can I do to override limitations set by my Host?===
Before doing this, consult with your host, they may have very different ideas about what your Moodle should be permitted - try not to tread on their toes - they may get annoyed at you breaching your user conditions. In an Apache server, you can create a file called '''.htaccess''' which can allow you to override some of the limitations set by PHP on your Moodle. Be aware that this file only applies to your Moodle, and nothing else. Your host will often place a .htaccess file into your root folder which will usually read something like:
  deny from all
  AllowOverride None
These are security related, so there is no need to delete them or otherwise edit them. To overwrite set values in the hosts php.ini file, you may want to use:
  php_value upload_max_filesize 512M
  php_value post_max_size 512M
To overwrite boolean or logical settings use:
  php_flag register_globals off
or
  php_flag register_globals 0


You are not limited here either, if you want a message for welcoming people and still show the default Front Page or anything else, then the list of items in the '''Front Page''' and '''Front page items when logged in''' are accessible.
Something similar can be done in IIS, but it is a lot more complex.  


Experiment with different configurations or options, you might hit on one that is spectacular, or more likely, meets your needs better than any other option. 
Thanks Muano


==Help! My site broke - How do I fix it?==
===We have an older version of Moodle, but as a new Administrator, I want to upgrade to the latest version, but how?===
Moodle was made to be broken - seriously. Quite often these statements are made: 
Practice first before [[Upgrading]] a production site! There are risks in upgrading any software package. Also, as a new administrator, you may not completely understand what has been installed on your production Moodle site.  A combination of upgrading a version 1.6 site to 1.9 that has 6 [[Contributed code]] modules added to it can be a complicated process. Upgrading from Moodle 1.9.x to Moodle 2.0 may be a little more problematic, there are a large number of database changes, as well as a number of changes to backup files that may cause some heartburn for people.  
:::My site has suddenly broken, only the header will display on any page except for user login.
:::As soon as anyone is logged in, only the header shows.
:::The site was working perfectly but not now.


Or variations on that theme.  
The quickest way would be to [[Site backup|backup]] your current database, and see [[#What_is_the_best_way_of_updating_my_Moodle.3F|"What is the best way of updating my Moodle?"]]. Remember though, do the next new administrator a favor and document your process and all changes you make.


Why these things happen is usually you have done something or changed something or someone else has done it and the site falls over. You can spend hours trying to fix it, but in most cases it is just better to dump it and start again, a lot less time consuming. 
One issue will be problems in the database. Some tables may have incrementally changed so restoring may become a lot more difficult than it should be. It may be less difficult in the long run to create a new site, then back up each course from the old site and restore each course to the new site. Or if you have a knowledge of SQL, you may be able to create your own SQL queries to rewrite the older tables and store the data in a format the new database can accept.
# Completely delete your entire Moodle, everything must go.
# Reinstall Moodle using exactly the same settings you started with.
# Overwrite the database from your [[Site backup]].  


Alternatively, you can just restore from your [[Site backup]].
[[#top|Top]]


This is why you must backup regularly. The bigger the database, the more frequent the [[Site backup|backups]] required.
===What is the best way of updating my Moodle?===
There is no "best way" as such, there are a number of different methods. Perhaps the simplest way is to recognise that you can utilize the "connectionless" nature of Moodle. (Simple as in this should work anywhere, but you may want to check out other methods as well.)
 
Moodle comes in three parts
#The Moodle database - managed by one of four DBMS like MySQL, Postgres, MSSQL or Oracle.
#The moodledata folder - which holds uploaded files
#The Moodle code folder.  


'''TIP''': Keep two Moodles, one public and one private. Do things to the private Moodle and test them out. If it works then you can employ the same change in your public Moodle. If it doesn't then you have not damaged anything. It is much easier to deliberately break and repair or re-install your small private Moodle than to try and do it to a public Moodle.
'''When updating your Moodle, first things first, backup everything in each of these folders - just in case.'''


==I want to hide the Latest News Block from anyone not logged in.==
If you are not sure how to do this, look at the [[Backup_and_restore_FAQ|Backup and Restore FAQ]] before doing anything.  
Log in as an Administrator then turn editing on


# Click on the assign roles icon (usually the first icon) in the header of the [[:Category:Block|block]] to be hidden, in this case the [[Latest News block]] (but this should work for all [[:Category:Block|blocks]]).
Download and install the new version of Moodle to a folder that will not overwrite your existing Moodle, giving the database another name. Check that it works. You may want to think about putting it onto a different drive, or different computer even.  
# This takes you to the Assign roles page so then click the "Override permissions" tab.
# Select the role "Guest".
# Reset the capability moodle/block:view to '''prevent'''.
# Click the "Save changes" button.


This should hide the [[:Category:Block|block]] from everyone until they have logged in. You can apply this to all [[:Category:Block|blocks]].
'''Copy the config.php''' file of your older installation, to a place it will not be overwritten during the update.
Copy the code base of the new installation into the folder of your older production site, returning the copied older Moodle's config.php file.  


==All students are enrolling in every course==
Things that can go wrong:
*You unzip the new installation and when installing it overwrites your existing moodledata folder. Copy back your earlier version, overwriting the newer.
*You overwrite the existing database. Restore your backup.   


This comes back to the contextual nature of Roles.  
Suggested by [[User:Tim Hunt|Tim Hunt]].


Make sure your users are '''not''' assigned to the student role at the site level.
===How to diagnose a Hacked Moodle Site?===
Check in site '''administration > users > permissions > assign system roles''' - there should be nobody in the student role
This item is not designed to frighten anyone about Moodle security, just sometimes a hacker can be a little better than our protective systems. Like any popular web based program, Moodle is in a constant game of "catch-up" with latest hacker techniques. Please check the [[Security]] page for more tips and procedures.
Then go to '''users > permissions > user policies''' and check that the default user in Moodle is "authenticated user" and not student


And this is where it can all get so confusing. In the context of the SITE the default user needs to be "authenticated user".  
First thing to do is to check the ''config.php'' file in your Moodle folder. This controls the basic settings. Check for anything that is written between these two lines:
<?php /// Moodle Configuration File
 
unset($CFG);


So you have solved one problem, but then you notice that as soon as you have done that, the site news forum disappeared from the Front Page after a successful log in, even if you have forced all logged in users to be subscribed.  
If something is there delete it. Once it is deleted, check the file permissions and make sure that the file is owned by the administrator and is set for '''read only'''.  


# Go to ''Administration > Front Page > [[Front Page settings]]''.
There are other ways Moodle has been hacked, but usually, the files targeted are the config.php and index.php. Unfortunately, sometimes all the .php files are attacked. Upgrading Moodle, backing up everything, checking permissions and folder locations are some of the things you can do to either reduce the risk or recover quickly. With a large installed base of users and an active community, most hacks are discovered and reported quickly, and solutions found.
# Go to '''Default frontpage role''' and select '''Student'''. This affects a number of things, but it does not mean everyone becomes a student in ALL courses, only a Student on the front page.


This changes your '''Front Page Role''' to Student but keep the '''default user''' as it is.
For more information, go to [[Hacked_site_recovery|Hacked site recovery page]]. This offers more detailed information.


Roles in Moodle are '''contextual'''. In making these changes, '''ALL''' logged in users are "authenticated users" in the context of the '''SITE''' and at the same time ALL logged in users are "Students" in the context of the Front Page. Once they leave the Front Page, they revert to being "authenticated users" until they enter a page or a Course where they have been assigned a different role, Student, Teacher, Course Creator or Administrator.
===How do I set Moodle & Moodledata folder permissions in the server environment.===
You should already have gone through the [[Installing Moodle]] guide and this should have provided you with some information. However, due to the manner in which Moodle has been created, the documentation tends to concentrate on the LAMP configuration.  


==The Staff at my School want to see what other Staff Members are doing. Can I set this up easily?==
The other question is how can I set permissions in IIS.  
Yes, you can. In many instances a lot of Staff Members will want to look at what their colleagues are doing and make sure they are working within whatever academic parameters need to be met. While this may seem intrusive for a lot of teachers, it is is a very easy way of getting a cross-fertilization of ideas in cross-curricular studies.


As the number of courses grow, this can mean that Teachers "My courses" block can grow to a ridiculous length. To get around this issue, set up a fake user id that is enrolled in all courses. If all Staff know the User ID they can access other courses easily. To limit this though, you may consider using a different faked ID for each subject area or discipline or category and make that ID available only to those people delivering courses in that subject, discipline, or category.
This [http://moodle.org/mod/forum/discuss.php?d=107382 discussion] in the Using Moodle Forum about this topic could be really valuable for IIS users.


==I just migrated my Moodle to a server and now no-one can see it. What happened?==
===Help! My site broke - How do I fix it?===
Moodle was made to be broken - seriously. Quite often these statements are made: 
:::My site has suddenly broken, only the header will display on any page except for user login.
:::As soon as anyone is logged in, only the header shows.
:::The site was working perfectly but not now.


Usually the issue is a simple one and can be fixed with your text editor:
Or variations on that theme.


#Open your text editor and navigate to your config.php file in the Moodle root.  
Why these things happen is usually you have done something or changed something or someone else has done it and the site falls over. You can spend hours trying to fix it, but in most cases it is just better to dump it and start again, a lot less time consuming. 
#Look for the line <nowiki>$CFG->wwwroot = 'http://localhost/';</nowiki>
# Completely delete your entire Moodle, everything must go.  
#Change the "localhost" to your server IP address, e.g.<nowiki>$CFG->wwwroot = 'http://10.45.78.165/';</nowiki>
# Reinstall Moodle using exactly the same settings you started with.
#Save and exit your file editor
# Overwrite the database from your [[Site backup]].  


This should now work. What it should also do is to update all your internal links, courses, images and everything to reflect the IP address.  
Alternatively, you can do a [[Site restore]] from your [[Site backup]].  


==Installation on a Windows or a Linux server ==
This is why you must backup regularly. The bigger the database, the more frequent the [[Site backup|backups]] required.
This item will cause some problems for a good many people. The Windows version of Moodle is workable, but for a seriously working Moodle site, the advantage lies firmly with Linux. The simple truth is that it is easier to mirror and load share using Linux than Windows. Building and learning how to use Moodle is easier in Windows, although that is arguable, but in the longer term, a Linux based installation is far stronger and a much better learning environment for any Administrator. It is suggested that if you can, set up a Moodle in both environments, Ubuntu, SuseLinux and Debian are now relatively easy to install and configure. As for Windows, XP seems more stable than Vista, as long as you stay away from Home versions in either. You can test any of these statements for yourself. The major advantage though seems to lie in the ease at which Linux machines can be clustered for redundancy. - My opinion only, debate in a forum is most welcome.


There is one issue here though, and it may be saved for a future question. There is currently little information easily available for the clustering of computers and what discussion there has been about mirroring has not been encouraging. High cost servers have always been out of the reach of a good many organizations and viable alternatives are urgently required. If anyone has any information they would not mind sharing, please put it on these pages about [[Moodle Clusters]] or [[Mirroring Moodle]].
'''TIP''': Keep two Moodles, one public and one private. Do things to the private Moodle and test them out. If it works then you can employ the same change in your public Moodle. If it doesn't then you have not damaged anything. It is much easier to deliberately break and repair or re-install your small private Moodle than to try and do it to a public Moodle.


==I upgraded Ubuntu from 8.10 to 9.04 and have lost my Moodle - where did it go?==
Another reason a site is broken is because it has been [[#How_to_diagnose_a_Hacked_Moodle_Site.3F|hacked]], which is another issue.
In this situation, usually, you will get the Apache "It works" message but when you try to access the Moodle, it will come back with an error message telling you it cannot locate the Moodle. You can try to locate the Moodle yourself, and update the various files, like config.php:


  unset($CFG);
===I am having trouble with blocks, I can't see them, what do I do?===
The [[Blocks FAQ]] will provide many answers here and what follows may not necessarily be the right answer. Log into your Moodle as normal and then type this:
<nowiki>http://www.mysitename.org/]admin/blocks.php</nowiki>
into the address bar. This will take you directly to the blocks page and you will be able to reset any hidden block.


  $CFG->dbtype = 'mysql';
===I have a valid web address, but as I install, I am getting an error message telling me I do not.===
  $CFG->dbhost = 'localhost';
Chances are that it is the config.php file that is pointing in the wrong direction. If you can use a text editor that can save in a UTF-8 format, open the config.php file and it may read something like:
  $CFG->dbname = 'moodle';
  $CFG->dbuser = 'moodleuser';
  $CFG->dbpass = 'xxxx';
  $CFG->prefix = 'mdl_';


   $CFG->dbpersist = "false";
   $CFG->wwwroot  = 'localhost';
  $CFG->dirroot  = 'var/www/Moodle/moodle';
  $CFG->dataroot  = 'var/www/Moodle/moodledata';
 
when it should look something like:


  $CFG->wwwroot = '<nowiki>http://10.90.56.110</nowiki>';
    $CFG->wwwroot = <nowiki>'http://yourwebsiteURL';</nowiki>
  $CFG->dirroot = '/var/www/moodle';
    $CFG->dirroot = '/home/yourAccountName/public_html';
  $CFG->dataroot = '/var/moodledata';
    $CFG->dataroot = '/home/yourAccountName/moodledata';
   $CFG->directorypermissions = 00777;
   
   $CFG->admin = 'admin';
If you are being hosted then the provider may allow you access to something like CPanel in a Linux environment.
  require_once("$CFG->dirroot/lib/setup.php")
 
This will also repair the error message:
   The 'Data Directory' you specified could not be found or created.
  Either correct the path or create that directory manually.
 
In a Windows environment it may look something like:
    $CFG->wwwroot = <nowiki>'http://yourwebsiteURL';</nowiki>
    $CFG->dirroot   = 'C:\Moodle\server\moodle';
    $CFG->dataroot  = 'C:\Moodle\server/moodledata';
 
===I can not login and get the error message "Unfortunately, cookies are currently not enabled in your browser"===
With all these kinds of errors the first thing to do is to check the config.php file. Make sure that the file is pointing to the right places. It should look something like:
 
  $CFG->wwwroot = <nowiki>'http://yourwebsiteURL'</nowiki>;
  $CFG->dirroot = '/home/yourAccountName/public_html';
  $CFG->dataroot = '/home/yourAccountName/moodledata';
 
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script <nowiki>http://yourserver/moodle/lib/session-test.php</nowiki>.


Reedit and change wwwroot to to what your IP address is, even if it has not changed, re-enter the path.  
If your server is on shared hosting check that you have sufficient disk space quota. An insufficient quota will prevent new sessions being created and nobody will be able to login.


Check the actual location and make sure the dirroot and dataroot are also correct.  
Carefully check the permissions in your 'moodledata' area. The web server needs to be able to write to the 'sessions' subdirectory.  
Try it and if it works, then you have successfully re-configured the Moodle, but do not count on it. This method seems pretty hit and miss.  


It may be faster and safer to just reinstall the Moodle, so make sure you have a backup prepared to go if needed.
Finally, check the bottom of the config.php file. Make sure there is nothing after the <nowiki>?></nowiki>, '''this means no characters, no spaces, no carriage returns'''. If the ?> is on line 26 and the debug error says config.php line 28, you have extra lines.  


==I have just taken over a Moodle and now can't log in to it as Admin and others get the message "Your session has timed out. Please login again.".==
[[#top|Top]]


===I have just taken over a Moodle and now can't log in to it as Admin and others get the message "Your session has timed out. Please login again.".===
You should already know the version of Moodle you are using, (if you are not sure then go to Notifications and in the bottom left corner of the centre block you will see the Version + (build number)).  
You should already know the version of Moodle you are using, (if you are not sure then go to Notifications and in the bottom left corner of the centre block you will see the Version + (build number)).  


Line 210: Line 245:


If you are already using a later version of Moodle, then you should be communicating with your ISP to see what the problem may be. Alternatively, you may be able to access the log files, in which case you may be able to query each element of the Moodle.   
If you are already using a later version of Moodle, then you should be communicating with your ISP to see what the problem may be. Alternatively, you may be able to access the log files, in which case you may be able to query each element of the Moodle.   
It is also recommended that you constantly update your Moodle site. You can start considering this option using [[CVS_for_Administrators | CVS]] files.  
It is also recommended that you constantly update your Moodle site. You can start considering this option using [[CVS_for_Administrators | CVS]] files.  


==I just restored a course to the Front Page Site files and now I am having serious trouble with the site==
[[#top|Top]]
 
===All students are enrolling in every course===
Your '''site''' is probably assigning a student role initially to all new users. You might want to change this setting. This is another example of the contextual nature of [[Roles]] and what is discussed here is in the context of the '''''entire site'''''.
 
First check to see who is assigned the student role at the site level. Go to the site administration block > users > permissions > assign system roles - there should be nobody in the student role. Move users you do not want to have student role (be able to enroll in all courses in the entire site), out of this role into the Potential user column.
 
To change the default user role, in the site '''Administration > Users > Permissions > User Policies''', look for "Default role for all users".  Make sure the default user is "[[Authenticated user]]" and not "[[Student]]".


There are a number of issues here. Firstly, the Site files link in the Administrator's block is an open folder that anyone can access. Putting anything in there can expose is to anyone who wants to look.  
Confused about why this is logical? We have been checking the default user setting for the '''entire Moodle site''. In MoodleSpeak, the site context always applies until another context specifically changes the role. Remember, students take courses.  Some sites want all new users to be able to be automatically enrolled in all site courses.  So from the first moment that users logs into these sites,  the site role default is that of student. Other Moodle sites want to be more selective. Thus they might assign the default site role as "authenticated user". This will allow each course to determine the new role (probably a student role) when the user tries to enter it.  
[[Image:Restorecmf01.gif|200px|thumb|left|Course Restore options]]
Restoring Courses needs be done in the appropriate area. From an Administrator's point of view, it is better to have a single restoration point, a dummy course you can use to restore Courses within.  


Moodle provides you with a process that allows you to select where you want Courses to be restored to and how you want them restored, so the dummy course is a practicable solution, and it affords a modicum of consistency within the site.
In correcting the student issue, you may have created another problem - your Site news forum has disappeared.  See below.


This is not a problem for Teachers or Course Creators, they can Backup and Restore only in those pages that recognize them as having a Role greater than an Authenticated User.
[[#top|Top]]


==I have been asked to move an activity from one course to another course. How can I do that?==
=== My site news forum disappeared from the front page for students===
The site news forum disappeared from the [[Front Page]] after a successful log in for your students.  You have forced all logged in users to be subscribed via the forum settings.  Check to see if some or all of your users are no longer "students" or teachers in the [[Context]] of the Front Page.  


Firstly, the Teacher of the course can do this, it is not really a job the Administrator should have to do. The only time you need be involved is if there are different Teachers for the two courses.  
Go to ''Site Administration block > Front Page > [[Front Page settings]]> Default frontpage role''.  Change to '''Student'''. Remember this is a change to a different area of Moodle than that described above. This change occurs specifically in the context of the front page, and is not a site wide change.  


To do this is actually simple, which is why Teachers can do it. In the course, the individual lesson can be backed up.  Go to Course > Administration > Backup and with the list of checkboxes  presented, uncheck anything you do not want to move. Select the Continue button to backup the files you want to move.  
This affects a number of things. Please note that the default [[Roles|front page role]] is like a role in a course and it does not apply to other courses. Ths is different to the [[#All_students_are_enrolling_in_every_course| assigned roles]] in the front page.


Moodle allows you to move files between folders in the same course and between courses. To move the backup zip file to another folder within the course, just use the Move dialogue. This is the same as it is for moving other files or images within the admin context. To move between courses requires a little more thought and make sure you know Category as well as both the short and full names of the destination course.
===I just migrated my Moodle to a server and now no-one can see it. What happened?===
Usually the issue is a simple one and can be fixed with your text editor and a special program:


Once you have the files backed up in a zip file located in the Files area of your course: 
#Open your text editor and navigate to your config.php file in the Moodle root.
# Select the Restore option.
#Look for the line <nowiki>$CFG->wwwroot = 'http://localhost/';</nowiki>
# Moodle will say 
#Change the "localhost" to your server IP address, e.g.<nowiki>$CFG->wwwroot = 'http://10.45.78.165/';</nowiki>
  "You are about to start the restore process for:
#Save and exit your file editor
  backup-myfiles-20090716-0813.zip"
#Run the ./admin/replace.php because your image links will still point to localhost
# Select "Yes"
##So put <nowiki>http://localhost/</nowiki> in the first box (your old address)
# Which takes you to the first Course Restore page so click "Continue".  
##Put <nowiki>http://10.45.78.165/</nowiki> in the second box (your new address)
# The second Course Restore page asks you where you want to put the soon to be unzipped backup files.
##After you are sure the above is exactly correct, click on "Yes, do it now".
# From the drop down combo box select "Restore course : Existing course, add data to it" option.
# Enter the Category, the short name and full name of the course and check the Target Role, it should read "Student" but not always.
# Select "Continue" - it will ask you again what the destination folder is, select that one and it will automatically go to the next page.
# Select the "Restore this course now" button.  


Moodle will give you the message "Restore completed successfully" if it worked, click "Continue"
This should now work. What it should also do is to update all your internal links, courses, images and everything to reflect the IP address.


At this point you may need to rearrange the newly installed files, in the same way as always, or you may chose to leave them for the Teacher to place where they need to go.  
The same process is used when you have installed to your own server and want to make it available to your Users, but if you have no courses, then you do not have to run the replace.php file.


==See also==
===See also===
*[[Beginning Administration 2 FAQ | Beginning Administration FAQs - 2]]
*[[Beginning Administration 3 FAQ | Beginning Administration FAQs - 3]]
*[[Beginning Administration 4 FAQ | Beginning Administration FAQs - 4]]
*[[Front_Page_FAQ|Front Page FAQ]]
*[[Installation FAQ]]
*[[Installation FAQ]]
*[[Administration FAQ]]
*[[Administration FAQ]]
*[[Xampp Installer FAQ]]
*[https://docs.moodle.org/20/en/Beginning_Moodle_2.0_Administration | Beginning Moodle 2.0 Administration]
*[[:Category:Administrator | Index of all Administrator-related pages]]
*[[:Category:Administrator | Index of all Administrator-related pages]]


[[Category:FAQ]]
[[Category:FAQ]]

Latest revision as of 00:37, 18 January 2012

There is always an element of frustration at the beginning of taking on a Moodle. For many of us, we are employed to do something else, but fall into this. While we have some knowledge or skills, we can often be stumped by the simple things. Not because we are not skilled, just we do not understand enough of the jargon surrounding Moodle to make it work for us. What many people have found is that they are pushing against a door that was never shut. Not a good analogy perhaps, but it does describe what can happen when we begin Administration of a Moodle.

Most of the questions and answers here can be located somewhere in the Forums, or the Moodle Docs, if you want to spend the time looking for them. All this FAQ does is concentrate some of the questions you may be asking in one place. Thanks to all the unknowing and unknown contributors.

This page has grown a bit quickly and is now over sized. So more pages have been added named Beginning Administration 2 FAQ and Beginning Administration 3 FAQ. A number of questions relating to specific, popular, areas have now been moved. One is the Front Page FAQ and the Xampp Installer FAQ, others will probably follow.

For the moment, ALL answers here relate specifically to Moodle 1.9.x and some earlier versions (e.g. 1.7 and 1.8). Moodle 2.0 questions are not answered here.

For more specific information about Moodle 2.0.x try Beginning Moodle 2.0 Administration.

Beginning Administration 2 FAQ

Xampp Installer FAQ

I want to create a new site in Moodle, but which version should I use? 1.9. or 2.0.

In December 2010 this is a tough call. If you pick 1.9.9 to .11, you should probably plan on upgrading to Moodle 2.0 after it has been out a while (say June 2011). There were many changes made to the Moodle's User Interface and underlying structure in 2.0. In any major new release there are always minor things that are discovered even after extensive testing.

Remember that moodle.org has switched to 2.0 and so have a few other large sites including demo.moodle.net, so it is stable. In the longer run, a new site might focus upon adding content to their new 2.0 site, stay away from any customization of underlying code and plan on upgrading every month or so. Then having used it for a while, consider what tweaks to make or add.

There is also the "old dog, new tricks" effect to consider. Do you want to start with one interface and code set, then switch later and have to relearn some things? You maybe fine, but what about your teachers? They are less likely to notice changes in a 2.0 build update and we can guarantee that going from 1.9x to 2.x is a big change that will not escape their notice.

UPDATE: May 2011. Moodle 2.0.3 has been released and v2.1 has been announced for release in the near future. It is now obvious that new installations of v2.0.x are considerably more advantageous to the User than beginning with a v1.9.12 then changing at some, usually unspecified, time in the future.

How can I get an overview of using Moodle?

There are any number of books about Moodle 1.9.x. Perhaps the most immediately useful book is the Using Moodle book by Helen Foster and Jason Cole. While aimed more at using rather than administration, this book is a handy tool to work out many things about how the administration of your Moodle impacts on how Moodle can be used.

What do I really need to know about HTML, Javascript, PHP and MySQL or networking to be a successful Administrator?

Not a lot. Certainly you should know something about HTML and there are lots of web sites and books on this subject. Generally speaking in Moodle, Javascript is a mid-level skill and, PHP and MySQL are advanced skills. If you are really interested in gaining more skills in these programs, there are lots of free to low cost to professional certification paths to follow. There are web sites around that will get you started with minimal cost. There are plenty of books as well. Individualized professional coaching/mentoring/consulting or certified training in several areas is obviously more expensive. Understanding Networking will also come in handy. The more your site is customized from the standard Moodle package, the more you may need these skills.

What tools do I need to use in the Administration of my Moodle

Different environments will allow to you use some different tools, but essentially, you can get away with just a text editor. There are any number of text editors, but use one that can save the files in a UTF-8 format. For Windows users, Notepad++, TextPad are two that come to mind and there are a lot more, but not Windows' native Notepad. (Windows Notepad is not fully UTF-8 compliant. Some of its own characters will not be read properly in PHP and Notepad may add additional spaces and end of line or end of file markers that will not be rendered in PHP or rendered badly, crashing the whole site.)

Installation on a Windows or a Linux server

There are a great many Moodle documentation pages on this subject. The available Xampp/Windows version of Moodle is workable, but for a larger production (a site with many users, courses and volume) Linux is the strongly recommended operating system. The simple truth is that it is easier to mirror and load share using Linux than Windows. Building and learning how to use Moodle is easier in Windows. However in the longer term, a Linux based installation is far stronger and thus a much better learning environment to start with for any Administrator. It is suggested that if you can, set up a Moodle in both environments, Ubuntu, SuseLinux and Debian are now relatively easy to install and configure. As for Windows, XP seems more stable than Vista. Windows 7 is reputed to be better than both earlier versions, but as Microsoft is intent on "automating" everything, it appears to be placing more stubborn blocks into the path of the installation of many useful applications. Use of Home versions in MS operating systems is not recommended for any production site.

Linux is probably better at things like clustering and mirroring. Moodle Clusters or Mirroring Moodle are two pages which are developing information about these topics that are useful for larger or more active sites.

Which leads me to which version of Moodle should I use then?

Obviously the constant updating processes available for Moodle should provide the opportunity for you to keep your Moodle current. But the reality is that we do not always have time to update to the latest release (consider reconstructing tweaks or going from 1.9 to 2.0). If you schedule regular updates, say one per month or one per quarter, this is still somewhat intensive. Most Moodle sites would be perfectly serviceable with a twice annual update, but it is entirely up to you, as the administrator, or the Moodle owners. It is a decision that should be made right at the outset of setting up the first Moodle. The best bet is to use the latest stable version, however often you want to update it. See the "I want to create a new site in Moodle, but which version should I use? 1.9. or 2.0." question.

Should I use a test site to try things out?

As a general tip, if you have a production site, that is a site that is being used by students or other enrolled persons on a regular basis, then it is a good investment to have a test site. This test site is used by you, the administrator, alone. In it, you can replicate your production site or any aspect of it, by taking a backup of something from your production site and restoring it to your test site. Try out something in this test Moodle first. This way you will always be on top of changes before you make them. If something goes wrong with your test site, it is simple to reinstall.

For some circumstances, the Windows Xaampp installer may be a better choice for a Windows environment, and while it may not replicate specific server environmental problems, it is handy for a lot of other things. As an alternative, in either a Linux or Windows environment, if you need something specific, once your site is working, back it up and then restore it under a different folder in the web root. As long as no-one knows it is there, and there are no public links to it, then you are the only one who may access it. Of course, you can always make sure that no-one but you can enter the test site. You may not want to do that on one server - due to hosting constraints, so you may chose to create a separate installation on a different computer, which does make it easier to wreck your test site then restore it quickly.

Top

Why am I just not getting how Permissions and Roles work?

A new site administrator's understanding of permissions and Roles is usually based on their networking environment knowledge. In short: we log in, we are given a set of permission based on that log in and these permissions determine what we can do in a single context. This "linear" explanation is based on what we see, not what really happens, of course.

In Moodle, permissions are also known as "capabilities" and they reside with the Role and can be dependent upon the users location/activity in Moodle. The log-in ID does not carry any traditional network permissions with it, but an initial Role. So stop worrying about trying to learn about permissions, concentrate on the Role and how that works. Once you have a solid grasp of each Role, then you can worry about setting permissions.

Roles are context based. The best advice is DO NOT assign any roles from the Front Page. If you assign a Role in the Front Page, that Role is assigned to every part of the site. A best practice is to only assign Roles within the context of a Course or a Category.

What different roles can apply to users as they log in and move around inside the Moodle?

Only one of many roles (a set of permissions) can be given to a users at log in. As the user moves to different pages, they can specifically or generically (if they belong to a group of users) be assigned new roles for that just that area, or context. Here are some concepts that might help.

Before anyone logs in to the Moodle, sitting at the log in page, or public front page, depending how you have set your Moodle up, they should have the role of "Guest". It is possible to change this but be careful.

In Moodle, when anyone with a user name and password logs into the Moodle, they become an "Authenticated User". How they are authenticated is different from their Role. At this point the contextual nature of Roles kicks in and determines permissions for every user, everywhere a User goes in the site a context is applied.

For reasons explained below, you may want your Users to become "Students" while in the Front Page. (Be careful here, read on below before assigning roles.)

When they click to go to a Category page, they revert to an "Authenticated User". Once there, their User Name is scanned and their permissions are calculated and if they have permissions, they can have sufficient rights to be a "Teacher" or a "Course Creator" or even an "Administrator", but for most people it will probably remain at Authenticated User.

When they click to go to a Course, they may have the rights to be an "Administrator", a "Course Creator", a "Teacher" or a "Student" in that Course.

This does not mean they have any of those rights in any other Category or Course. The Role assigned in one context may not apply in any other context.

How can I be sure I am assigning Roles correctly?

Assigning Roles should be based purely on the page or activity (the context) and the role you want that person(s) to play.

The first question is "what do I want this person to be able to do?" For most people using the Moodle, the obvious Role will be that of Student. Others will need to be Course Creators or Teachers. Some Teachers will be Course Creators. Really, the first question should be "what do I want this person to be able to do HERE?"

Essentially, if you get it wrong, then your courses can be wrecked. The basic rules are simple, "Do not assign a role in the Front Page." and "Assign roles in the context of the course or Category."

Be aware, if you create an Administrator role in a Category, that will apply across all sub-Categories and Courses in that Category. It will not apply to ANY other Category, sub-Categories or Courses. If someone is assigned the Role of "Teacher" at a Category level, that Role will apply in ALL sub-Categories and Courses in that Category.

Top

I changed some Roles and things have gone terribly wrong, I cannot log in as Administrator

Chances are you have changed your Administrator Role, happens all the time and is easily fixed - if you have kept backups of your database. This problem is often caused by changing the default role for all users. Sometimes Administrators include themselves as part of the Role change - thus the problem. Open phpMyAdmin, and if you do not have it installed then do so, but if you are on a network use the full version, not the Moodle plugin - for your own security. Open the database and go to mdl_user table. Check for your own id and make sure you know your own id number. Go to the mdl_role_assignments table and look for YOUR USER ID. Be careful here, your user id number is not the same as the id number in this table, it should be showing in the userid field. If it is there, and the fields "roleid" and "contextid" should both read 1. If not then edit the row to show those values.

If your id is not there then try these values starting from the "id" field on a line you know is no longer used or add a line into the table using the "Insert" page: id = (lastid + 1 - this may be an auto-incrementing field so be careful) 1, 1, (your userid number here) 0, 0, 0, (timevalue here, just copy the previous line's value), 0, (copy enrol value from previous line), 0. The entire line should read something like: 21, 1, 1, 352, 0, 0, 0, 1276947170, 0, manual, 0)

NOTE: This worked in a limited test on a Windows server and with XP, and should work if you write the SQL Insert statement correctly. The emphasis is on the "should", because this has not been tested, yet, on a large production server. This is why you need a backup of your database - in case this goes wrong. No guarantee here, sorry.

The only other, and admittedly faster, alternative is to delete the existing database and use your backup.

How do I set the maximum upload file size limit?

This is probably the most frequently asked question, and the answer is not that straightforward. The changes that need be made are the same in all versions of Moodle, just in different OS' 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:

 Server level
 Moodle site level
 Course level
 Activity level

Perhaps the best place to find this information is at File upload size There is a full explanation for a number of different OSs but there are a few missing.

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.

The previous answer is OK if you control the server, but I am hosted, what can I do to override limitations set by my Host?

Before doing this, consult with your host, they may have very different ideas about what your Moodle should be permitted - try not to tread on their toes - they may get annoyed at you breaching your user conditions. In an Apache server, you can create a file called .htaccess which can allow you to override some of the limitations set by PHP on your Moodle. Be aware that this file only applies to your Moodle, and nothing else. Your host will often place a .htaccess file into your root folder which will usually read something like:

 deny from all
 AllowOverride None

These are security related, so there is no need to delete them or otherwise edit them. To overwrite set values in the hosts php.ini file, you may want to use:

 php_value upload_max_filesize 512M
 php_value post_max_size 512M 

To overwrite boolean or logical settings use:

 php_flag register_globals off

or

 php_flag register_globals 0

Something similar can be done in IIS, but it is a lot more complex.

Thanks Muano

We have an older version of Moodle, but as a new Administrator, I want to upgrade to the latest version, but how?

Practice first before Upgrading a production site! There are risks in upgrading any software package. Also, as a new administrator, you may not completely understand what has been installed on your production Moodle site. A combination of upgrading a version 1.6 site to 1.9 that has 6 Contributed code modules added to it can be a complicated process. Upgrading from Moodle 1.9.x to Moodle 2.0 may be a little more problematic, there are a large number of database changes, as well as a number of changes to backup files that may cause some heartburn for people.

The quickest way would be to backup your current database, and see "What is the best way of updating my Moodle?". Remember though, do the next new administrator a favor and document your process and all changes you make.

One issue will be problems in the database. Some tables may have incrementally changed so restoring may become a lot more difficult than it should be. It may be less difficult in the long run to create a new site, then back up each course from the old site and restore each course to the new site. Or if you have a knowledge of SQL, you may be able to create your own SQL queries to rewrite the older tables and store the data in a format the new database can accept.

Top

What is the best way of updating my Moodle?

There is no "best way" as such, there are a number of different methods. Perhaps the simplest way is to recognise that you can utilize the "connectionless" nature of Moodle. (Simple as in this should work anywhere, but you may want to check out other methods as well.)

Moodle comes in three parts

  1. The Moodle database - managed by one of four DBMS like MySQL, Postgres, MSSQL or Oracle.
  2. The moodledata folder - which holds uploaded files
  3. The Moodle code folder.

When updating your Moodle, first things first, backup everything in each of these folders - just in case.

If you are not sure how to do this, look at the Backup and Restore FAQ before doing anything.

Download and install the new version of Moodle to a folder that will not overwrite your existing Moodle, giving the database another name. Check that it works. You may want to think about putting it onto a different drive, or different computer even.

Copy the config.php file of your older installation, to a place it will not be overwritten during the update. Copy the code base of the new installation into the folder of your older production site, returning the copied older Moodle's config.php file.

Things that can go wrong:

  • You unzip the new installation and when installing it overwrites your existing moodledata folder. Copy back your earlier version, overwriting the newer.
  • You overwrite the existing database. Restore your backup.

Suggested by Tim Hunt.

How to diagnose a Hacked Moodle Site?

This item is not designed to frighten anyone about Moodle security, just sometimes a hacker can be a little better than our protective systems. Like any popular web based program, Moodle is in a constant game of "catch-up" with latest hacker techniques. Please check the Security page for more tips and procedures.

First thing to do is to check the config.php file in your Moodle folder. This controls the basic settings. Check for anything that is written between these two lines:

<?php /// Moodle Configuration File
 
unset($CFG);

If something is there delete it. Once it is deleted, check the file permissions and make sure that the file is owned by the administrator and is set for read only.

There are other ways Moodle has been hacked, but usually, the files targeted are the config.php and index.php. Unfortunately, sometimes all the .php files are attacked. Upgrading Moodle, backing up everything, checking permissions and folder locations are some of the things you can do to either reduce the risk or recover quickly. With a large installed base of users and an active community, most hacks are discovered and reported quickly, and solutions found.

For more information, go to Hacked site recovery page. This offers more detailed information.

How do I set Moodle & Moodledata folder permissions in the server environment.

You should already have gone through the Installing Moodle guide and this should have provided you with some information. However, due to the manner in which Moodle has been created, the documentation tends to concentrate on the LAMP configuration.

The other question is how can I set permissions in IIS.

This discussion in the Using Moodle Forum about this topic could be really valuable for IIS users.

Help! My site broke - How do I fix it?

Moodle was made to be broken - seriously. Quite often these statements are made:

My site has suddenly broken, only the header will display on any page except for user login.
As soon as anyone is logged in, only the header shows.
The site was working perfectly but not now.

Or variations on that theme.

Why these things happen is usually you have done something or changed something or someone else has done it and the site falls over. You can spend hours trying to fix it, but in most cases it is just better to dump it and start again, a lot less time consuming.

  1. Completely delete your entire Moodle, everything must go.
  2. Reinstall Moodle using exactly the same settings you started with.
  3. Overwrite the database from your Site backup.

Alternatively, you can do a Site restore from your Site backup.

This is why you must backup regularly. The bigger the database, the more frequent the backups required.

TIP: Keep two Moodles, one public and one private. Do things to the private Moodle and test them out. If it works then you can employ the same change in your public Moodle. If it doesn't then you have not damaged anything. It is much easier to deliberately break and repair or re-install your small private Moodle than to try and do it to a public Moodle.

Another reason a site is broken is because it has been hacked, which is another issue.

I am having trouble with blocks, I can't see them, what do I do?

The Blocks FAQ will provide many answers here and what follows may not necessarily be the right answer. Log into your Moodle as normal and then type this:

http://www.mysitename.org/]admin/blocks.php

into the address bar. This will take you directly to the blocks page and you will be able to reset any hidden block.

I have a valid web address, but as I install, I am getting an error message telling me I do not.

Chances are that it is the config.php file that is pointing in the wrong direction. If you can use a text editor that can save in a UTF-8 format, open the config.php file and it may read something like:

 $CFG->wwwroot   = 'localhost';
 $CFG->dirroot   = 'var/www/Moodle/moodle';
 $CFG->dataroot  = 'var/www/Moodle/moodledata';
 

when it should look something like:

   $CFG->wwwroot = 'http://yourwebsiteURL';
   $CFG->dirroot = '/home/yourAccountName/public_html';
   $CFG->dataroot = '/home/yourAccountName/moodledata';
   

If you are being hosted then the provider may allow you access to something like CPanel in a Linux environment.

This will also repair the error message:

 The 'Data Directory' you specified could not be found or created. 
 Either correct the path or create that directory manually.

In a Windows environment it may look something like:

   $CFG->wwwroot = 'http://yourwebsiteURL';
   $CFG->dirroot   = 'C:\Moodle\server\moodle';
   $CFG->dataroot  = 'C:\Moodle\server/moodledata';

I can not login and get the error message "Unfortunately, cookies are currently not enabled in your browser"

With all these kinds of errors the first thing to do is to check the config.php file. Make sure that the file is pointing to the right places. It should look something like:

  $CFG->wwwroot = 'http://yourwebsiteURL';
  $CFG->dirroot = '/home/yourAccountName/public_html';
  $CFG->dataroot = '/home/yourAccountName/moodledata';
  

Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script http://yourserver/moodle/lib/session-test.php.

If your server is on shared hosting check that you have sufficient disk space quota. An insufficient quota will prevent new sessions being created and nobody will be able to login.

Carefully check the permissions in your 'moodledata' area. The web server needs to be able to write to the 'sessions' subdirectory.

Finally, check the bottom of the config.php file. Make sure there is nothing after the ?>, this means no characters, no spaces, no carriage returns. If the ?> is on line 26 and the debug error says config.php line 28, you have extra lines.

Top

I have just taken over a Moodle and now can't log in to it as Admin and others get the message "Your session has timed out. Please login again.".

You should already know the version of Moodle you are using, (if you are not sure then go to Notifications and in the bottom left corner of the centre block you will see the Version + (build number)).

If you are using v1.6, you may want to consider dropping the site entirely. Reinstalling a newer version should solve the essential problem. v1.6 experimented with cookieless sessions which work by appending a session id to either every url or to hidden form fields in html pages. This allowed php to track every session and record it. The problem is that that data is stored in the moodledata folder, and that takes up space which eventually takes up so much room the server will object and deny people access. To immediately solve this problem enter the /moodledata/sessions folder and delete all the "session" files.

If this is the problem, then you may be getting messages from your ISP telling you that you are now over quota, so you need to reduce the amount of filespace that your Moodle is occupying.

If you are already using a later version of Moodle, then you should be communicating with your ISP to see what the problem may be. Alternatively, you may be able to access the log files, in which case you may be able to query each element of the Moodle.

It is also recommended that you constantly update your Moodle site. You can start considering this option using CVS files.

Top

All students are enrolling in every course

Your site is probably assigning a student role initially to all new users. You might want to change this setting. This is another example of the contextual nature of Roles and what is discussed here is in the context of the entire site.

First check to see who is assigned the student role at the site level. Go to the site administration block > users > permissions > assign system roles - there should be nobody in the student role. Move users you do not want to have student role (be able to enroll in all courses in the entire site), out of this role into the Potential user column.

To change the default user role, in the site Administration > Users > Permissions > User Policies, look for "Default role for all users". Make sure the default user is "Authenticated user" and not "Student".

Confused about why this is logical? We have been checking the default user setting for the 'entire Moodle site. In MoodleSpeak, the site context always applies until another context specifically changes the role. Remember, students take courses. Some sites want all new users to be able to be automatically enrolled in all site courses. So from the first moment that users logs into these sites, the site role default is that of student. Other Moodle sites want to be more selective. Thus they might assign the default site role as "authenticated user". This will allow each course to determine the new role (probably a student role) when the user tries to enter it.

In correcting the student issue, you may have created another problem - your Site news forum has disappeared. See below.

Top

My site news forum disappeared from the front page for students

The site news forum disappeared from the Front Page after a successful log in for your students. You have forced all logged in users to be subscribed via the forum settings. Check to see if some or all of your users are no longer "students" or teachers in the Context of the Front Page.

Go to Site Administration block > Front Page > Front Page settings> Default frontpage role. Change to Student. Remember this is a change to a different area of Moodle than that described above. This change occurs specifically in the context of the front page, and is not a site wide change.

This affects a number of things. Please note that the default front page role is like a role in a course and it does not apply to other courses. Ths is different to the assigned roles in the front page.

I just migrated my Moodle to a server and now no-one can see it. What happened?

Usually the issue is a simple one and can be fixed with your text editor and a special program:

  1. Open your text editor and navigate to your config.php file in the Moodle root.
  2. Look for the line $CFG->wwwroot = 'http://localhost/';
  3. Change the "localhost" to your server IP address, e.g.$CFG->wwwroot = 'http://10.45.78.165/';
  4. Save and exit your file editor
  5. Run the ./admin/replace.php because your image links will still point to localhost
    1. So put http://localhost/ in the first box (your old address)
    2. Put http://10.45.78.165/ in the second box (your new address)
    3. After you are sure the above is exactly correct, click on "Yes, do it now".

This should now work. What it should also do is to update all your internal links, courses, images and everything to reflect the IP address.

The same process is used when you have installed to your own server and want to make it available to your Users, but if you have no courses, then you do not have to run the replace.php file.

See also