Moodle https error
Hey everyone. I'm hoping that others have had this problem too, and that this post will help them solve it.
I know, some people hate moodle, but I have a small army of teachers that love it. >>face palm<<
After updating to server 5.0.4 on my testing machine, my moodle server stopped working.
I searched around on the internet for a bit but didn't look too far into it, but now I'm pretty much ready to upgrade to the newest version of server. All seems to be well with the testing machine! I hunted around for the issue of this reverse proxy problem. OS X Server 5.0.4 appears to play with the ports when you run a secure website. When trying to log into my moodle server, I get an error that says something like. For security reasons only https connections are allowed, sorry.
Even though there's a nice little lock showing that indeed it is a securely connected ...connection.
Wiretap to the rescue! Moodle appears to be detecting that server is doing some proxy magic on port 34543.
I'm hoping that this post helps others as it took me a long time with the google machine to find the solution. In your moodle config.php file, located in the root directory of your moodle site, you need to have moodle see that there's an sslproxy thing happening. Do this by adding the following line exactly,
$CFG->sslproxy=true;
This completely solved my moodle issues! The error vanished and I can access my moodle site again.
Here's a copy of my config file (minus my server addresses). It includes the sslproxy=true; line.
Enjoy, and I hope google finds this and directs it to others with similar issues!
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = '192.168.0.3';
$CFG->dbname = 'moodle';
$CFG->dbuser = '*****';
$CFG->dbpass = '*****';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => '',
'dbsocket' => '',
);
$CFG->wwwroot = 'https://server.example.com/moodle';
$CFG->dataroot = '/Volumes/UDATA/moodledata';
$CFG->admin = 'admin';
$CFG->sslproxy = true;
$CFG->directorypermissions = 0755;
require_once(dirname(__FILE__) . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!