Unable to connect to Moodle on local LAN

Unable to connect to Moodle on local LAN

Joe See發表於
Number of replies: 10

I currently have Moodle 4.1 installed on a new barebone copy of Windows Server 2022. I am not able to connect to Moodle on any other system on my network other than the device Moodle is running. If I open Chrome/Edge and point to my local ip (in this case 10.0.1.31) OR 127.0.0.1 OR "localhost" on the Moodle installed system, it opens straight away. If I try to open 10.0.1.31 from any other system, it resolves to "localhost" and then immediately fails.  

I previously had IIS running to confirm I've opened the ports correctly to the Internet, and I'm good with this for testing purposes, so I know I have port forwarding set up correctly. However, there should be no port forwarding needed in my router within my local network. 

To confirm, IIS is not currently installed. Apache opens and runs as it should on the device it was installed on, but I'm unable to hit it from another system on my network. I can ping the Moodle system from any other device, and doing a remote port scan indicates port 80 is open. I've also confirmed I've gone in and added an Inbound exception to port 80 in the firewall for TCP.

Any idea what I could look at? Thank you so much for your help in advance!


-Joe



評比平均分數: -
In reply to Joe See

Re: Unable to connect to Moodle on local LAN

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Probably you have $CFG->wwwroot="http://localhost"; in your config.php. See whether $CFG->wwwroot="http://10.0.1.31"; makes everybody happy.
In reply to Visvanath Ratnaweera

Re: Unable to connect to Moodle on local LAN

Joe See發表於
Thank you very much for your response! I've made the change in the config.php, stopped, then restarted moodle, and still no go. Reading more into this, I find that this may also need to include /moodle after that IP.

By setting the config.php file to $CFG->wwwroot="http://10.0.1.31/moodle, I'm now able to pull something up when calling up that internal IP, however this is what I see:

Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404
10.0.1.31
Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/7.4.28

This is a fully stock install with no changes to directories. What do I have set incorrectly?
In reply to Joe See

Re: Unable to connect to Moodle on local LAN

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Hi

So $CFG->wwwroot was only a part of the problem. I don't know the other part. I hope somebody familiar with Windows will come to help.

What you could waiting for a reaction is to put a test.html file in to the Moodle directory (where config.php is) and call http://10.0.1.31/moodle/test.html. If the browser doesn't render the test.html file, the problem is definitely not with Moodle.

In reply to Visvanath Ratnaweera

Re: Unable to connect to Moodle on local LAN

Joe See發表於
OK, so that actually works. I created an index.html in notepad, stuck it in the moodle directory and called up 10.0.1.31/index.html and it works. This sounds like it's less of an Apache problem and more of a Moodle configuration?
In reply to Joe See

Re: Unable to connect to Moodle on local LAN

Ken Task發表於
Particularly helpful Moodlers的相片

Your test.html and url to it was http://ip/test.html and that worked.

IF your test index.html was in the same directory as moodle code - you see a config.php file + a version.php file + an index.php file ....  that indicates that apache document root is set to c:\whatever\moodle\

Depending upon how you finished with web install ... localhost?  Then to get internal links moodle builds from the wwwroot variable in config.php one has to run search and replace.

'SoS', Ken

 

In reply to Joe See

Re: Unable to connect to Moodle on local LAN

Ken Task發表於
Particularly helpful Moodlers的相片

Am not a windows person either but ...

where did you acquire?  From here:

https://download.moodle.org/windows/

Reason asked ... you mentioned 'start moodle' ... the above comes with a little application that one has to launch and it has a menu of related ... Apache/MySQL/ apps as well as a 'Start' button.

That download is built using XAMPP

https://www.apachefriends.org/

The app launches apache on localhost port 8080 me thinks.

So config.php has to have localhost:8080/moodle/

Folks do change that in order to get moodle seen on the local lan - which is not recommended by the makers of XAMPP.

If not that, then describe how you installed all the parts ... apache, mysql, and php as well as acquired moodle code.

Also ... and this might be easier ... to get what you want on a Windows machine ... although WSL is really a virtualized (subsystem in Windows terms) ubuntu Linux.

https://docs.moodle.org/311/en/Installation_guide_for_Windows_using_WSL_(Windows_Subsystem_for_Linux)

Advantages in doing so ... moodle docs/faqs etc. authors normally provide info for Ubuntu.   When/IF you decide to get a true server most likely to be Linux, makes site backup and restore to that 'true server' much easier, + yada + yada! 微笑

My 2 cents!

'SoS', Ken


In reply to Ken Task

Re: Unable to connect to Moodle on local LAN

Joe See發表於
Ken, I really appreciate you taking the time to send your response! I'm really liking the Moodle's community to help assist!

So I think you're on to something. Yes, I downloaded directly from the link you sent. Databases are not my thing and when I began trying to download all the prerequisites for getting MySQL up and running, I ran into a ton of issues and stopped there. Then I went to download the "Windows" prepackaged version you showed above, and yes, it installs with two buttons, a start and stop Moodle.

So right now I'm really just trying to get it installed so I can demo to the powers that be here at my office that Moodle may be the way to go. All I'd like to do is get it up and running to provide an extremely short course showing the concept, so I can be given the approval to utilize Moodle. At that time, I would get with our IT department and have them install it in a Linux environment. But for the time being, I have to prove the concept before I get the OK, so I have a standalone decommissioned Windows Server 2022 system I've been given access to, to get this example set up.

My current setup right now is a very clean O/S install, with the Moodle app (Windows version) installed. The only thing I've modified in any way within the Moodle directory is the one line in the config.php you're mentioning. I've completely disabled Windows Firewall for the time being just to remove that from the picture, but seems to make no difference in my efforts. I'm fairly competent in IIS and Firewall settings, however I think this Moodle web configuration is a bit over my head.

In IIS, I have one "root" directory, and I put files that need to be available on the web there (i.e. index.html and all supporting files). I'm not understanding how changing the port in the config.php file would make any difference, since you can point to the correct port in the URL on the remote system your trying to connect to Moodle. If XAMPP has a different root directory I'd need to point to, does that share the same config.php file?
In reply to Joe See

Re: Unable to connect to Moodle on local LAN

Ken Task發表於
Particularly helpful Moodlers的相片

So really what we are talking about here has something to do with your 'professional pride'? ("I'm fairly competent in IIS and Firewall settings") - that's ok, I get it! 微笑

From my past experience ... working with K12/Corp/Independent IT ... the following:
"At that time, I would get with our IT department and have them install it in a Linux environment"
was promised, but turned out to be yet another layer of support ... and one that is
truly 'the horse' in 'cart [moodle] before the horse'!

Understand it's a demo - proof of concept - approval - then go forth ... but
I wonder if one should begin with the end in mind.  Yes, you might get some
true Windows people in here to help and get it up and running.

TIP OF A VERY DEEP ICEBURG, my friend! 微笑

Apache isn't native to Windows.  MySQL/MariaDB isn't native to Windows.  PHP (and drivers for) isn't native to Windows.   Hmmmm ....
Something deeper but important - cron - again not native to Windows.

Depending upon how long this 'proof of concept' is going to be available to your internal testers ... or your 'dog and pony show', you might not discover that which lies under the hood of a moodle server until later ... like the day the Moodle announced to your entity ... hmmm ... 'max_allowed_connections' + other tweaks - is lurking and very well could rear ugly head the day of launch! :|

My advice ... ask your IT department to wipe out the OS on the server you have and
install Ubuntu LTS (highest version).  Then, after getting the AMP stack installed, install moodle using git (that is also something not native to Windows).

Even if your IT has only the time to get a barebones Ubuntu LTS up for ya with only SSH access - you could then learn how to 'build a box' .... including git install of Moodle core code!

If that server is setup correctly, it might actually become your production server!!!

OR - you would wait around here and hopefully a Windows expert will assist ... all I can do is guess ... and that's not something I like to do!

My 2 'sense' - nope, spelled it right! 微笑

'SoS', Ken


評比平均分數:Useful (1)
In reply to Joe See

Re: Unable to connect to Moodle on local LAN

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Why not Moodle Cloud? The smallest package offers a free trial of 45 days.