Localhost works Remote FQDN does not (Moodle 3.6.3)

Localhost works Remote FQDN does not (Moodle 3.6.3)

by Michael Guizzetti -
Number of replies: 4

I just finished installing Moodle 3.6.3, on my iis server I am able to go to http://localhost or http://moodle and get to the starting page.  When I try to go to http://moodle on a remote computer it will not load the page.  I checked DNS and it resolves to the correct IP, I checked the firewall on the IIS server and it's not blocking port 80, I added http://moodle to the iis bindings.  It's feeling like a Moodle/php setting but I'm not sure where to look.  Any ideas?

Average of ratings: -
In reply to Michael Guizzetti

Re: Localhost works Remote FQDN does not (Moodle 3.6.3)

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Check the IIS logs to see if the request is being received. These are in C:\inetpub\logs\LogFiles\W3SVC? (where ? is the IIS site number). For my test site, here's Firefox requesting the site home page ("GET /") and getting a "200" (i.e. OK) response:

2019-05-09 14:41:02 10.0.2.15 GET / - 80 - 10.0.2.15 Mozilla/5.0+(Windows+NT+10.0;+WOW64;+rv:66.0)+Gecko/20100101+Firefox/66.0 - 200 0 0 9765

The client and server IP addresses are the same (10.0.2.15) because the browser is on the same server as IIS. If the request isn't listed then it's a server or networking issue, not a Moodle issue.

You could try telnetting from the client to the IIS server to confirm this can connect on port 80, e.g.

C:\>telnet moodle 80

(You may need to install the standard Telnet client). If this fails then something is blocking the connection.

Your browser may be using a proxy server so it may be the proxy that is unable to resolve the name or connect to port 80.

In reply to Leon Stringer

Re: Localhost works Remote FQDN does not (Moodle 3.6.3)

by Michael Guizzetti -

I get the following log showing my Moodle server 10.14.100.133 and my client 10.150.1.142.  The client error is "ERR_CONNECTION_REFUSED"


#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken

2019-05-09 15:46:21 10.14.100.133 GET / - 80 - 10.150.1.142 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/74.0.3729.131+Safari/537.36 - 303 0 0 1255


Telnet works, I get a blank black screen with a blinking prompt

In reply to Michael Guizzetti

Re: Localhost works Remote FQDN does not (Moodle 3.6.3)

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Great, so port 80 is open to the IIS server and IIS is responding. It's responding with a redirect (303) but Chrome shows an error.

Is your site HTTP or HTTPS? I'm wondering if it's HTTPS but with a self-signed certificate that Chrome doesn't like.

Can you confirm what the site URL is? E.g. what does the $CFG->wwwroot line say in config.php (in the Moodle source code folder on the IIS server)? It's the http or https bit that's relevant.

And when you access http://moodle from the IIS server itself, i.e. where it works, does IIS log a 200 or 303 response?

You could also try a different browser and see if that gives you a different message.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Localhost works Remote FQDN does not (Moodle 3.6.3)

by Michael Guizzetti -

ARg  it was http://localhost  I changed it to http://moodle and its now working.  tongueout