2 moodle instances on the same VPS

2 moodle instances on the same VPS

by James Puppy -
Number of replies: 8

I have installed moodle 3.8 on a VPS.

I am planning to create one more installation on the same vps with moodle 3.10.

Should I take extra care of something? is there a possibility of a conflict?

Of course I will have separate moodledata folders

Average of ratings: -
In reply to James Puppy

Re: 2 moodle instances on the same VPS

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I have three Moodles on my VPS. Make the names of your moodle, moodle database, and moodledata folders be different. Develop some consistency in name these three items.

I am not sure how to create separate caches for each installation. I have my "production" moodle and two experimental Moodles, so I haven't been too concerned about the caches.
Average of ratings: Useful (2)
In reply to Rick Jerz

Re: 2 moodle instances on the same VPS

by Usman Asar -
Picture of Plugin developers Picture of Testers
Rick, when you say caches, are you referring to memcache etc or moodle's own cache folders?
In reply to Usman Asar

Re: 2 moodle instances on the same VPS

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Good question, Usman. I use Opcache. I believe that my VPS does the caching for Opcache.

My guess is that Moodle's own cache folders are in their own moodledata folders, right?
In reply to Rick Jerz

Re: 2 moodle instances on the same VPS

by Usman Asar -
Picture of Plugin developers Picture of Testers
absolutely yes, PHP has to do with application server handled by your hardware so OpCache will be ONE for anything making use of it, be it wordpress, moodle or anything on same server, making changes in OpCache for one application (e.g. moodle) will reflect for every other application, like default value for memory allocation is 256MB where a larger moodle site requires say 512MB or 1GB or memory allocation, wordpress will be allocated same amount of memory for using OpCache, but if you are running multiple instances of moodle then the value of memory allocation MUST be increased to cater the needs of all moodle instances.

Unless, you can setup PHP individually for every application, which I am not aware possible in Linux, but in Windows server environment, yes.
In reply to Usman Asar

Re: 2 moodle instances on the same VPS

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Thanks for your confirmation, Usman. This makes sense.
In reply to James Puppy

Re: 2 moodle instances on the same VPS

by Usman Asar -
Picture of Plugin developers Picture of Testers
James, you can have AS MANY moodle instances as your resources allow,  In addition to Rick's suggestion, moodle defaults its database name with prefix mdl, you can change that too, although even with same prefix wont effect, but will make it easier for you in case you're using query language in future to address tables.
In reply to Usman Asar

Re: 2 moodle instances on the same VPS

by James Puppy -
Thank you guys.
I have just finished the installation with no problems. Both instances work fine so far.
In fact only the first installation will be used frequently. The latest installation will be used very rarely, so there is no question with server's resources.
In reply to James Puppy

Re: 2 moodle instances on the same VPS

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Great news, James. Yes, your first Moodle can be called your "production" Moodle. Your second (and even third/fourth) can be called "experimental." If you desire (and your VPS has space) you can even make your second Moodle mirror your first. Then, before updating your production Moodle, update your experimental Moodle to make sure everything is fine, then update your production Moodle last.

I don't do this myself. Instead, I have MAMP Moodles for experimentation. I did install Moodle 3.11 and Moodle 4.0 on my server, anticipating change. Doing so let me discover that I needed to install sodium on my VPS.
Average of ratings: Useful (1)