Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 47014

Re: multiple IP addresses for moodle site config file problem

$
0
0
by Ken Task.  

Ok one other ... have I done this?   No, but then again, am not in your situation either! 

Qualifications for this idea ... used to run core services for 30+ school districts ... core DNS/EMail Spam/AV gateways/EMail services and boundary firewall ... entities would have web/moodle servers either internal to their network or hosted at the core for the WAN.

All of it on Linux ... which cost $0 for software and just my time/expertise in setting up/getting it to work and then maintaining.   Ok, now that we know how crazy I was ... and still am .... here's the idea ...

Circuit A -> Moodle Server A -> this server has moodle code and the DB and the data directory
config.php has http://site/ as per FQDN for the Circuit A provider DNS.  DB is localhost.  Data directory is /var/www/moodledata

Circuit B -> Moodle Server B -> this has a different private IP but same FQDN (the name ... not the IP).    The code on Moodle Server B comes from rsync from Moodle A Sesrver - same exact version and addons.

External DNS upstream has one record for your zone ... that of the Moodle server by it's allocated by that ISP IP addresses.  Moodle Server B uses the 10. address of the DB on Moodle A.  Moodle Server B also uses a mount point which maps to the moodledata directory on Server A.

Firewall ...
Circuit A comes in as say 205.x.x.x and it gets directed to 10.10.10.10 (private IP for Moodle Server A).

Circuit B comes in as say 65.x.x.x and it get's directed to 10.10.10.9 for Moodle Server B.

Internal DNS has two A records by private IP and point to the SAME FQDN .. one for Moodle Server A (10.10.10.10).  one for Moodle Server B (10.10.10.9).  Forwarders in internal DNS should point to resolvers that are NOT authoritative for your schools domain.   Windows machines should probably NOT be using Root hints.

Here's the 'trick' ....
Moodle A is the primary for DB and for moodledata.
So in config.php of Moodle A server: DB = localhost data directory = /var/www/moodledata.

Moodle B server has an rsync of the code directory and the only thing different is the config.php file.   In that config file, the DB server is the private IP address of Moodle Server A and the /var/www/moodledata is really a mount point for /var/www/moodledata on Server A.

In Server B the only differeces is the DB server ... host is the DB of Moodle A by it's private IP address.
And /var/www/moodledata is a symlink for /mnt/moodledata which is an NFS mount to moodledata on Server A.

Server A & B have the same FQDN - no need to change.

Server B will be slower due to remote DB and remote moodledata but there are somethings one an do on Moodle B to speed up moodledata access.

Moodle Server B doesn't have to be as powerful as Moodle Server A.   B is apache only but using DB on Server A and using filedir of moodledata via NFS on Server A.

That's confusing as all get out ... isn't it!

Wouldn't recommend to anyone that they do this, but in your case, it might be the ONLY way you can ... without having to change config's/DNS'/Firewalls/routers, etc..   We do what we must in "lower" education.

'spirit of thinkering', Ken


Viewing all articles
Browse latest Browse all 47014

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>