Moodle Help (Again!)
I posted about this before (a few months ago) but wasn't too clear in what I wanted to do.
Basically, we have a domain which is hosted by company X and they provide management tools through the form of CPanel.
A sub-domain, moodle.tanfieldschool.co.uk, is forwarded (setup using CPanel) to 220.127.116.11 - the IP used to access Moodle externally. Obviously Moodle is setup with the BASE DOMAIN NAME as 18.104.22.168 - our external IP.
Now internally, when somebody browses to moodle.tanfieldschool.co.uk they are sent out to the server hosting the domain, which then forwards them to 22.214.171.124 - basically they access Moodle through our external interface.
This is not a real problem, apart from the obvious reduction in speed because the users are going out and then back in through our internet, instead of just accessing it on the LAN.
As I said, we can deal with this, but the big problem is when our net goes down, we lose Moodle - this shouldn't be the case as the box is hosted internally.
I think it could be solved by adding an entry in DNS for moodle.tanfieldschool.co.uk, and changing the BASE DOMAIN NAME for Moodle to moodle.tanfieldschool.co.uk instead of 126.96.36.199, but this would then break the external forwarding domain, not allowing external access.
Sorry if I'm not being clear - having a hard time trying to put what I mean into words.
OK, I've had a thought.
Let's say my internal IP for the Moodle server is I, and the external interface on our firewall (the one that points to our internal IP) is X.
I have an A Host record in our DNS entries (locally) that links the domain name to I. This works great internally, but to hook it up to work outside of school I need to somehow link the domain name (which is held with a hosting company) to our external IP X, in a similar way (DNS I hope) as I did with the internal I.
Is this possible? I've contacted the support team that host my domain name, and they say it will cause RECURSIVE DNS - is this true, and if so how should I go about working this?
The way we do it for our school website is by spoofing our domain internally. ie. we have a root zone for our domain in our DNS server, and the various A host records point to the internal IP address of the web server (or, for example, our mail subdomain points to easymail). This way, outside users are dealing with the DNS server that directs them to the public IP and internal users use the internal DNS server to point to internal servers.
It is seemless to users.
I think (as far as I can understand) that's what I'm trying to do. I asked the company to set up this in their DNS entries and they said it would cause recursive DNS?!
Originally Posted by localzuk
I'd do it localzuk's way.
Leave moodle.tanfieldschool.co.uk pointing to 188.8.131.52 on the cpanel dns.
Knock up a zone on your internal DNS and point moodle.tanfieldschool.co.uk to the internal ip 184.108.40.206.
I'd then check that the webserver vhost/servername is set to expect requests on moodle.tanfieldschool.co.uk which will be irrelevant of the IP used internally or externally.
*Be aware though if you have anythingelse.tanfieldschool.co.uk you'll need to add them to this zone or they may fail*
DNS works by recursion so I don't get what they mean?
Originally Posted by Hightower
They've sorted it now, and it works fine - on a slightly different note though:
I changed the www_root value in config to show the new value, but our images are still trying to load from the old address and therefore not loading at all.
I think these are kept in the MySQL db - is there anyway to quickly go through the database and change any references to old_address into the new_address value?
Was this the wwwroot in moodle's config.php?
Is it all images? (even the moodle ones)
Originally Posted by kmount
Yes - the wwwroot used to be 220.127.116.11, but since making these latest changes it is now moodle . tanfieldschool . co . uk
It's not the Moodle images or anything to do with the theme - just the images in forum items or news items etc.
Ah, er, I'll have a quick nose through sql, hang on.
This is exactly how we set things up here. Use proper resolvable hostnames for everything; configure the external record & IP appropriately, and give the internal IP to people on the LAN.
It's possible, have a nose here.
That was exactly what I was looking for! Thanks Kim!
My Moodle setup is complete (until the next time hehe)