Moodle "Connection Refused"

Moodle "Connection Refused"

by TJ Cook -
Number of replies: 5

Hello, I am new to Moodle. I successfully installed and setup Moodle and it was running flawlessly. Over the weekend, I went to access moodle and received an "connection refused" message on my browser. Any ideas why this would have happened? No firewall settings were changed and no moodle settings were changed.

Average of ratings: -
In reply to TJ Cook

Re: Moodle "Connection Refused"

by Ken Task -
Picture of Particularly helpful Moodlers
What does "Connection Refused" look like?    An apache 403 (access denied) error?  or a Moodle error screen ... typically a yellow background with a message in a box?

Where/how is it hosted?   On a true server on the net or is it a localhost install?

Windows?  Mac?  Linux?   Hosting provider?   Who?   Don't have to give URL you are using but ...

If it's a localhost install, those packages required one to start services (had button or command to start apache/mysql) so you could then access with browser.

'spirit of sharing', Ken

In reply to Ken Task

Re: Moodle "Connection Refused"

by TJ Cook -

It is hosted locally on a server in the building. In all browsers, I receive either a "page not found" saying either "(IPAddress) refused to connect" or "(IPAddress) took too long to respond. Like I said, it was working fine last week and suddenly stopped. 


Hosted on a Windows server. URL is crvfctraining.com

In reply to TJ Cook

Re: Moodle "Connection Refused"

by Ken Task -
Picture of Particularly helpful Moodlers
Networking comes before application ... so if the networking (which includes not only IP addresses, but DNS, and services (web) as they are setup on a server, as well as firewalls in front of a server, etc.) isn't setup/configured correctly, or if there was a change to networking/config, then no Moodle access.

Port 80 (the normal web port) is not open to folks outside your building ... and evidently maybe also inside your building now.   However, it appears the port for https is opened to all so one would need to use https:// to connect to it and not http://

But there's a problem with that ... a curl test connecting to 443 (the 'normal' https port on a web server) tells us the certificate is not to be trusted.   Exact quote while using FireFox:

"[yoururlgiven] uses an invalid security certificate. The certificate is not trusted because it is self-signed. The certificate is only valid for 192.168.x.x The certificate expired on January 3, 2010 at 5:07 PM. The current time is April 23, 2016 at 8:22 PM. Error code: SEC_ERROR_UNKNOWN_ISSUER"

So it looks like it's a web server configuration issue related to the certificate for the server.

If server is to be accessed both inside and outside your private LAN/WAN, it must have a fully qualified domain name in both internal DNS (inside your building) and external DNS (for internet).
In the config.php file for the Moodle, it must use the FQDN ... and not an IP address.  And the URL in the config.php file must use https://FQDN/

Check with your Server Admin as well as your Network people to resolve.   Nothing more anyone in these forums can do.

'spirit of sharing', Ken

In reply to Ken Task

Re: Moodle "Connection Refused"

by TJ Cook -

I found the issue. Moodle stops running when the user on the server logs out and does not run in the background. Thanks for your help!

In reply to TJ Cook

Re: Moodle "Connection Refused"

by Ken Task -
Picture of Particularly helpful Moodlers

Great!   Glad to hear it and glad to help.

Ahhh Soooo .... apache/IIS not set to run as a service then.   Yep, that would cause some strange behavior then.  Still though, check into cert stuff IF you plan to allow access from the outside/others.

'spirit of sharing', Ken