Access to Moodle

Access to Moodle

by Александр Бедов -
Number of replies: 8
I am a Moodle admin. When blocking an IP address (by copying it and pasting it into the window for placing such addresses 
and then saving this operation), my access was blocked, even for the admin I can’t enter the portal. 
How to get out of this situation.
Thank you

Average of ratings: -
In reply to Александр Бедов

Re: Access to Moodle

by Ken Task -
Picture of Particularly helpful Moodlers
Add the following line to your config.php file:

$CFG->blockedip='';

Don't need to restart services, just attempt access.   When successful, go to the same area where you blocked IP's and remove them in the form - and attempt to save.
You might have to comment out that line by putting // in front of it before your Moodle will save to the DB.

'SoS', Ken





Average of ratings: Useful (1)
In reply to Ken Task

Re: Access to Moodle

by Александр Бедов -
Unfortunately it didn't help. Did I enter the same config.php?
F:\MoodleWindowsInstaller-latest-310\server\moodle\

and what does   http://109.236.211.240/#linkusers  say?
In reply to Александр Бедов

Re: Access to Moodle

by Ken Task -
Picture of Particularly helpful Moodlers
That looks to be the right config.php file.   But I don't see the line I suggested you enter into that file?

Besides that, the IP address you show am asuming is the server but port 80 and 443 (the web ports) are not open to the outside Internet.   Just checked with nmap for that IP and it returns:
Nmap scan report for 211-240.interkonekt.ru (109.236.211.240)
Host is up (0.17s latency).

PORT    STATE  SERVICE
80/tcp  closed http
443/tcp closed https

So the firewall for the server or boundary firewall/router has to allow port 80 and 443 traffic to that IP.

'SoS', Ken


In reply to Ken Task

Re: Access to Moodle

by Александр Бедов -
if you don't mind, I opened ports both 80 and 443... but the situation has not changed.
The Internet itself exists, i.e. access to sites, mail .. and everything else is there ... It's just that Moodle itself does not open. can somewhere in its configurations ports are blocked??? Then where? Thank you.
In reply to Александр Бедов

Re: Access to Moodle

by Ken Task -
Picture of Particularly helpful Moodlers
Confirm that ports are open now.

Did you add the line to config.php as I suggested?

I can get to the site by IP ... using http:// I see a text notice:
"This site is not available currently."
Using https:// however shows site is using a self-signed certificate.   FireFox shows a broken lock with a notice:

"Warning: Potential Security Risk Ahead

Firefox detected a potential security threat and did not continue to 109.236.211.240. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.
"

Don't think I'll test further for ya there!

But more questions ... did you setup a fully qualified domain name for the IP address in DNS you control?
Why are you not running https?   One can use a free cert (LetsEncrypt) or purchase a commercial cert.
If you don't there will be some things that don't work well (if at all) with Moodle plugins site.

Is this an Apache server or an IIS server?

Since your platform is Windows (I don't do Windoze) you will have to find answers to your questions by some other resource.
However I can see
Server: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.11
X-Powered-By: PHP/7.3.11

And you say everything else is there ... are you running something else on the server other than a Moodle?

This past Tuesday was the infamous 'patch Tuesday' - got anything that patched and now this issue appears?

'SoS', Ken

In reply to Ken Task

Re: Access to Moodle

by Александр Бедов -
Still haven't solved the problem yet. There was a backup, though a year ago, it deployed. But the loss since September of the month of newly created and edited courses. Is it possible to get it out of the old portal. it is still available separately.
One more question, may I?
In reply to Александр Бедов

Re: Access to Moodle

by Ken Task -
Picture of Particularly helpful Moodlers
In config.php add the following $CFG-> lines:

$CFG->allowbeforeblock='0'; 

This is a comment.   Do not add.  Above is a Zero - not a CAP letter O

$CFG->allowedip='';
$CFG->blockedip='';

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Access to Moodle

by Александр Бедов -

I express my deep gratitude to you for your attention and help in solving the problem. Your last post worked! All the best and prosperity to you!!!