Sunday 15 May 2011

Moodle live over a network

As part of a project for work I'm investigating Moodle and it's use within a school as a learning platform. It's been a massive learning curve for me as I have no knowledge at all of using Moodle and there have been several problems I've experienced that have been worthy of blogging, but this one was both complicated and mind-numbingly simple at the same time!

I had Moodle set up with some basic pages, had logins based on Microsoft Active Directory, and was ready to let my colleagues have a go on my test site. However whenever I tried to load the site on another PC I kept getting an error:

Incorrect access detected, this server may be accessed only through “http://localhost/moodle” address, sorry.
Please notify server administrator.
.”



I wasn't sure if this was a Moodle error or an Apache error. I figured that it must be a setting in one of the config files but do you think I could find it or any information online as to where to find it. After much searching I found a website called Utterly IT566 whose author had encountered the same error when using Moodle. The solution was so obvious I couldn't believe that I hadn't worked it out for myself: 


In the Moodle main config file there is a line that goes something like this:


$CFG->wwwroot = ‘http://localhost/moodle’;


It turns out that when you setup Moodle it automatically defines the localhost as your webserver. All you have to do is change the URL to that of your server name or website name, and then it works perfectly. Simple when you know how really! 


If you want to read the full article then go here.

5 comments:

  1. Thank you. You saved me a bunch of time.

    ReplyDelete
  2. Yeah, me too - thank you for this post!

    ReplyDelete
  3. Exactly what I needed to resolve the same error I encountered. Thank you for the post!

    ReplyDelete
  4. I wish it was that simple for me- That did not resolve the issue

    ReplyDelete