I have a moodle 4.0 mounted on a Ubuntu 22.04 mv and the SSL certificates I have put them in the Fortigate. Now the web loads both in http and https but when I load it in https it looks weird, like without the styles and formats. Do you know what it can be?
I have tried to change from http to https in the CFG www root line of the config.ph but when I put https it breaks and I can't access neither by http nor by https...
I attach the errors detected by the browser developer mode:
Thank you,
Suggestions:
4.0 of moodle is old and no longer supported. Upgrade site to at least 4.1.highest which is a long term support version.
Purge caches - either from GUI Admin or command line - changing url in config.php file applies to new hits only. Moodle caches just about everything.
Not familiar with Fortigate but it is a WAF ... web application firewall ... right? What happens of you disable that to see if it's the culprit?
Fortigate - is that a typo?
'SoS', Ken
First of all thank you very much for your prompt reply,
I have pending to upgrade the version but first I wanted to switch from http to https.
The thing is that right now, since I installed SSL, moodle is accessible by http and by https. By http it looks fine but by https it looks like without styles.
Could you tell me how to purge more in depth the caches? The issue of changing in config.php from http to https causes moodle to break and neither access by http nor by https.
As for the Fortigate is a physical firewall, I can not disable it, it is where I install the SSL, there I define if it goes by http or https. But the engineering team has confirmed to me that the certificates on that firewall are installed correctly. In fact that's why moodle loads over HTTPS but without styles.
I appreciate any more suggestions.
I have pending to upgrade the version but first I wanted to switch from http to https.
The thing is that right now, since I installed SSL, moodle is accessible by http and by https. By http it looks fine but by https it looks like without styles.
Could you tell me how to purge more in depth the caches? The issue of changing in config.php from http to https causes moodle to break and neither access by http nor by https.
As for the Fortigate is a physical firewall, I can not disable it, it is where I install the SSL, there I define if it goes by http or https. But the engineering team has confirmed to me that the certificates on that firewall are installed correctly. In fact that's why moodle loads over HTTPS but without styles.
I appreciate any more suggestions.
I have seen your answer in another similar thread: https://moodle.org/mod/forum/discuss.php?d=330362
I have followed your mysqldump steps but when loading the web it says:
"Error database connection failed.... Overloaded or not working correctly...”.
I understand it must be because of what you mention about re-edit the HTML block, but I don't understand what you mean by that.
Would you mind telling me what to do in this part?
"One catch... if there were internal links in an html block they may not have been fixed with find and replace. For some reason, the html of the html blocks is not in raw html, so search and replace couldn't find them to change them. Easy fix ... just go back to edit."
I am grateful for any information
I have followed your mysqldump steps but when loading the web it says:
"Error database connection failed.... Overloaded or not working correctly...”.
I understand it must be because of what you mention about re-edit the HTML block, but I don't understand what you mean by that.
Would you mind telling me what to do in this part?
"One catch... if there were internal links in an html block they may not have been fixed with find and replace. For some reason, the html of the html blocks is not in raw html, so search and replace couldn't find them to change them. Easy fix ... just go back to edit."
I am grateful for any information
The question is whether this is a Moodle problem or a Fortigate problem. As far as Moodle is concerned, if your Moodle site will be https://example.com, then that is what you put in $CFG->wwwroot. Worth testing that short-circuiting Fortigate. Especially since Moodle server and the browser both don't like a back-and-forth between HTTP and HTTPS. They cache these things and get confused.
And the "mixed" error is a tell-tale sign. Every time you change $CFG->wwwroot you need to Search and replace the URL in the database.
Once you're certain that Moodle works as expected then you can bring Fortigate in to the picture. Unlikely that there are many here who knows the product. This is the first time I saw it.
Once you're certain that Moodle works as expected then you can bring Fortigate in to the picture. Unlikely that there are many here who knows the product. This is the first time I saw it.
First of all thank you very much for your prompt reply,
The thing is that right now, since I installed SSL, moodle is accessible by http and by https. By http it looks fine but by https it looks like without styles.
We think it is Moodle because of caches or styles. As for the Fortigate is a physical firewall, I can not disable it, it is where I install the SSL, there I define if it goes by http or https. But the engineering team has confirmed me that the certificates in that firewall are installed correctly. In fact that's why moodle loads by HTTPS but without styles.
The issue of changing in config.php from http to https makes moodle break and access neither by http nor by https.
I don't know how to do that to search and replace the URL in the database because when I change the config.php from http to https it breaks and becomes unaccessible. Would you mind telling me how to do the search and replace?
I appreciate any more suggestions.
The thing is that right now, since I installed SSL, moodle is accessible by http and by https. By http it looks fine but by https it looks like without styles.
We think it is Moodle because of caches or styles. As for the Fortigate is a physical firewall, I can not disable it, it is where I install the SSL, there I define if it goes by http or https. But the engineering team has confirmed me that the certificates in that firewall are installed correctly. In fact that's why moodle loads by HTTPS but without styles.
The issue of changing in config.php from http to https makes moodle break and access neither by http nor by https.
I don't know how to do that to search and replace the URL in the database because when I change the config.php from http to https it breaks and becomes unaccessible. Would you mind telling me how to do the search and replace?
I appreciate any more suggestions.
My idea was the separation: is it Moodle or the network (firewall counts as network)? If you can't do that, what you are seeing in the browser is the combined effect of both. So, you have more combinations to test.
Your comment "the certificates in that firewall are installed correctly" makes me think that you (and the engineering team) are off-loading the SSL to the firewall. Then Moodle delivers HTTP ($CFG->wwwroot) only and the firewall translates it in to HTTPS - and back. That is theory. I don't have such a configuration. If I had to debug, I will look in to the network traffic - tcpdump, etc. I know for a fact that the back and forth between HTTP and HTTPS confuses browsers, session variables, and server (Moodle) caches. I would get ready for a painful debugging process. Hope the engineering team will actively participate. Show this conversation to the team.
Your comment "the certificates in that firewall are installed correctly" makes me think that you (and the engineering team) are off-loading the SSL to the firewall. Then Moodle delivers HTTP ($CFG->wwwroot) only and the firewall translates it in to HTTPS - and back. That is theory. I don't have such a configuration. If I had to debug, I will look in to the network traffic - tcpdump, etc. I know for a fact that the back and forth between HTTP and HTTPS confuses browsers, session variables, and server (Moodle) caches. I would get ready for a painful debugging process. Hope the engineering team will actively participate. Show this conversation to the team.