Moodle appearance crashes after adding Let's Encrypt

Moodle appearance crashes after adding Let's Encrypt

by Javier Tejera -
Number of replies: 10

Hello,

I have added Let's Encrypt to a Moodle 3.9 instance using Ubuntu 20.04. Now the Moodle site is properly secured, but the format is crashing as per below. Before adding Let's Encrypt, the appearance (Boost theme) was fine.


Average of ratings: -
In reply to Javier Tejera

Re: Moodle appearance crashes after adding Let's Encrypt

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

Possibly $CFG->wwwroot is still HTTP (not HTTPS) in config.php? So when the page tries to load content using this prefix the browser is blocking non-secure requests for an HTTPS page.

If you're still having trouble use the browser's tools (for example: Network Monitor in Firefox) to see what's not being loaded as this may help determine the reason.

In reply to Leon Stringer

Re: Moodle appearance crashes after adding Let's Encrypt

by Javier Tejera -
Thanks Leon, all working fine now. I can't believe that I have managed to install Moodle using an Ubuntu server as I always did it by using one-click installers.

Now I will work on the cron job.
In reply to Javier Tejera

Re: Moodle appearance crashes after adding Let's Encrypt

by Matt T -
For what it's worth, I made a guide for a full installation of Moodle 3.9 on Ubuntu 20.04.

Probably a bit late now, but if you used PostgreSQL, it contains a backup script which may be helpful.

https://docs.google.com/document/d/1xxjNO6pR6kC6BFjfffRo9iYwK_Zfqk1JFLobvLR-Vtk/view
In reply to Matt T

Re: Moodle appearance crashes after adding Let's Encrypt

by Javier Tejera -
Hey Matt, super useful, thanks. I will create a new Digital Ocean's droplet and follow your guide as I am still practising how all this thing works to make sure I know the whole process.
In reply to Javier Tejera

Re: Moodle appearance crashes after adding Let's Encrypt

by Matt T -
Just be aware, my guide is 'opinionated' in the sense it tells you to use a certain web server and database (nginx and PostgreSQL respectively). Other guides might focus more on Apache and MySQL/MariaDB.
In reply to Matt T

Re: Moodle appearance crashes after adding Let's Encrypt

by Javier Tejera -
Yes, I see, thanks though. I have tried only using MySQL but also seen that MariaDB is more recommended than MySQL.

I am still in the very early stages of Ubuntu learning, but I am panicking a little bit as I am managing a Moodle (Siteground) that has been tested with 100 students in one project, but now we want to scale it up to all projects which sum around 10k students, that's why I want a more proper server, but I am a bit scared as I think I am punching above my weight.
In reply to Javier Tejera

Re: Moodle appearance crashes after adding Let's Encrypt

by Matt T -
The number of concurrent users is the bigger issue - 10,000 people hitting the site at once will require a fairly decent configuration. Even 1% of that user base logging in at one time is 100 concurrent users.

Probably a good idea to consider, at this point, that Moodle is kind of hard to scale up, particularly the database. If you're intending to scale up and are dealing with a greenfields (new) configuration, decisions like 'which database server should I use' shouldn't be made lightly. They should be made with some thought about the future. You may want to get a Moodle partner on board with your build.
In reply to Matt T

Re: Moodle appearance crashes after adding Let's Encrypt

by Javier Tejera -

Regarding the number of users, that's something we can manage as it is highly unlikely they will access at once and we will spread participants in different weeks/months.

Moodle partner sounds good, but this is a small charity working with rural teachers in Peru and Bolivia and currently there is no funding for it. The idea is evidencing that this works and hopefully some money will come in from donors, so we need to build it in-house.

At the moment, as we just tested it with a small number of participants, I think it is a good time to change to Digital Ocean and forget Siteground before proceeding with a bigger number of users. I believe scaling up in Digital Ocean is cheaper than Siteground, but obviously requires some technical knowledge. So I just want to set up a "reasonably robust" Moodle platform and transfer the courses of the Siteground's one before starting to onboard users in the Digital Ocean's one.

Yes, it is is a greenfields configuration - do you have any advice on the database?

Thanks so much!



Average of ratings: Useful (1)
In reply to Javier Tejera

Re: Moodle appearance crashes after adding Let's Encrypt

by Matt T -
I don't really have a suggestion to offer. Personally, I use PostgreSQL. I can't really explain why, at least, not in a succinct way. I think it just narrows down to personal preference.

MySQL has a significantly higher market share. That's something to consider. There's probably more people on the web who can provide assistance. There's probably more consultants out there who are familiar with it, but from what you're saying, it seems consultants are out of the picture.

Regardless of your choice, configuring a database cluster yourself is not for the faint of heart. Really, you'd probably need a support contract with a vendor, or at least an expert database administrator at hand.

Database clustering might be the most complex aspect of the scaling process, but there's other considerations too. If you need to run multiple web servers, you must be able to share the cache and the moodledata directory between them all. Cache you can use something like redis or memcached. Sharing the moodledata directory can be a bit tricky too - requiring something like NFS or Gluster. Also, the exact same codebase (/var/www/moodle) must be deployed to all web servers. 

Perhaps all unnecessary if you don't end up having a high number of concurrent users! But these are the sort of considerations that go into scaling up Moodle.
Average of ratings: Useful (1)
In reply to Matt T

Re: Moodle appearance crashes after adding Let's Encrypt

by Javier Tejera -
That's great, thanks for the advice. Definitely, we will need an expert as this can be quite big and a total disaster if not handle well.