How to use moodle locally

How to use moodle locally

by Kaique Games -
Number of replies: 9

How do I release moodle access locally?

I'm running the server on my pc, but when trying to access it from my cell phone using the PC's ip as url, a message appears that incorrect access was detected

and moodle redirects me to an http error page.

can anybody help me?

Complete error message: Incorrect access was detected. this server can only be accessed through the localhost address. please notify the admin


my print is in portuguese, but this is the error:


Attachment moodle.jpeg
Average of ratings: -
In reply to Kaique Games

Re: How to use moodle locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You have $CFG->wwwroot = 'http://localhost'; in your config.php. It should be $CFG->wwwroot = 'http://ip.address.of.pc';
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: How to use moodle locally

by Kaique Games -
where is this file? is it php.ini?
In reply to Kaique Games

Re: How to use moodle locally

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
How did you install Moodle? Could you post the link to the tutorial or the documentation you followed?
In reply to Visvanath Ratnaweera

Re: How to use moodle locally

by Kaique Games -

here
In reply to Kaique Games

Re: How to use moodle locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
When you access your Moodle from your computer, does it work?
In reply to Rick Jerz

Re: How to use moodle locally

by Kaique Games -
yes, but on other devices connected to the same network this print message appears
In reply to Kaique Games

Re: How to use moodle locally

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
In my experience, I have never known that a local install of Moodle would work from other devices. In general, the local install is meant for education and experience. However, one could develop a course on the local install, back it up, then restore it on your production Moodle.

Having said that, I am also not a network expert. So I have heard there might be ways to share a local install, but the other computers would have to be on the same local network. When I saw Visvanath mentioning to use the PC's IP address, I thought, "Hmmm, maybe that will work."

So I am out of ideas for you.

Oh, there is one more... Some folks have set up a local Moodle installation using MoodleBox. You might want to explore this.

And one more idea just came to mind. The problem might have something with access to the database. It might be that you have to do something about MySQL to let it know that people can access it remotely. This is just an idea. It would take a database expert to guide you.
In reply to Kaique Games

Re: How to use moodle locally

by Ken Task -
Picture of Particularly helpful Moodlers
The error screen is a Moodle error screen ... so, believe it or not, you are getting to that computer (and I am assuming you used a private IP address in the other computers browser).

Think it's saying that the package is mis-configured ... it installs automatically for http://localhost:8080 did it not?    localhost on any computer on the internet translates to IP 127.0.0.1 - the loopback IP. (itself)

To make this work from another computer, you have to use the IP address of the machine where moodle is installed.   Edit config.php in moodle code and change http://localhost:port to http://IPaddress:port.

Edit that file with NotePad.

Then try and access from another computer on your network by IP address.

Since I don't run Windows nor the package, there is also potential that  the web service you might have as an option to choose on startup ... nginx or apache. ... has also been configured to launch using localhost.   So when you launch, does it show the URL to access it?

Also, that IP address is not static ... more than likely your computers get their local lan IP address from a DHCP server and there is not only a lease on that IP but also a range of private IP's s that can be used.   Typical home networks are configured to use 192.168.0.x or 192.168.1.z.

Now if you are donig this at your office, might be a different story - different network.

'SoS', Ken


Average of ratings: Useful (1)