Puplic_html for two moodle instance on the same host

Puplic_html for two moodle instance on the same host

by Nguyen Minh Triet -
Number of replies: 8

Hello every one,

I have just installed my Moodle (for example http://mysite.com). 

Then i installed another one (for example http://mysite.com/sandboxmoodle) for testing.

And in my puplic_html (cpanel file manager) have all the structures and files just the same:


 
-public_html
 -admin
 -analytics
 -auth
 -availability
(etc)
The question is, when i modify (for example theme mod), which moodle will affected? (or both?)

Thank you so much,

Average of ratings: -
In reply to Nguyen Minh Triet

Re: Puplic_html for two moodle instance on the same host

by Nguyen Minh Triet -
I can see in puplic_html there is a folder "sandboxmoodle".
In reply to Nguyen Minh Triet

Re: Puplic_html for two moodle instance on the same host

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
So if I get this right, you have a live moodle site installed and the code sits in your public html folder. Within that site, you have another test moodle site with the code for that site sitting in the sandboxmoodle folder. So any changes that you make to the files in the public html folder will affect the main site and any changes you make to the files in your sandbox folder will affect your test site.
As for the theme question, those changes should have been made in a new folder called the name of your new theme in the theme folder in your public html folder. After creating the theme, did you install it, apply it and then clear caches?
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Puplic_html for two moodle instance on the same host

by Nguyen Minh Triet -
Thank you.
You are absolutely right!
.
For the second question. I modified current boost theme to make a custom menu with logged-in user enrolled courses list.
But it doesn't work!
My moodle is 3.11 and i did it with both renderers.php (created myself) and core_renderer.php (theme/boost/classes/output) in the boost theme folder.

It's very kind of you answering my question. I tried searching for it but no result.

Bests,
In reply to Nguyen Minh Triet

Re: Puplic_html for two moodle instance on the same host

by Ken Task -
Picture of Particularly helpful Moodlers

One probably needs to disclose what they are doing cause one should not have to modify core code files.  Custom Menus should work as documented - those get entered into tables of DB for that site and are constant for that site ... moodle uses config.php variable wwwroot to build internal url's to site.

Developing your own theme should be done in your sandbox server first ... and tested before applying that theme to your production site.

If, in cPanel, you have a terminal icon, learn to use command line a little for there some handy tools that one can use from command line only.

Example from Terminal:

cd /path/to/moodlecode/admin/cli/

Then execute:

php cfg.php |grep custommenu

One item returned from query to DB:

custommenuitems    Server Home|https://myhost.mytld.org/

On my 3.11.highest site I have a custom menu link to return to the home page (static HTML) of the site (Server Home).

Again ... my 2 cents.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Nguyen Minh Triet

Re: Puplic_html for two moodle instance on the same host

by Ken Task -
Picture of Particularly helpful Moodlers

Can see future issues with a moodle installed inside another moodle code base.  Each moodle has it's own code directory, DB, and moodledata directory.

1. backups - making an archive of contents of public_html will include both sites/code directories if not careful.   So if one had to do a full site restore from a backup, one would have to be careful not to also restore the code base of the moodle (sandbox) contained therein.

2. updates and upgrades to the code that sits at public_html ... special considerations to keep 'sandbox' code in place.  Plus confusion in first step of updating or upgrading ... copying out/keeping the original config.php file + any addons being copied back into new code base acquired from the updated or upgraded code.

Read Moodle docs on how to upgrade:

https://docs.moodle.org/311/en/Upgrading

and how to create site backups:

https://docs.moodle.org/311/en/Site_backup

If you've not gone to far in developing the initial moodle, consider the following:

@ root of public_html, a static index.html page that has links to production site: now in a subdirectory called whatever you like and to the 'sandbox' directory ... your development/test instance.

Why?   In today's internet, everything is scanned by those that might try to do harm to your sites.   While providers should have WAP firewalls to help protect, one can avoid such scans ... most bots really don't know the organization of your site ... they point to your top level domain ... ie, whatever is in public_html ... they won't get much to attack with a static index.html page.

My 2 cents, of course! smile

'SoS', Ken

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

Re: Puplic_html for two moodle instance on the same host

by Nguyen Minh Triet -
Thank you for your advice about static index.html. That's new for me and may the best practice for me too.
It's very kind of you answering my question!
Thank you and best regards,