internal vs external server address

internal vs external server address

wót John Knox -
Anzahl Antworten: 8

Ok, I'm not sure if this is a moodle question or something else.  My web server is sitting behind a NAT firewall so I have a different address internally (10.10.0.xxx) than I do externally (64.83.157.xxx).  I have been testing my web server from within my network and everything is working great.  I decided to log in from home, and when I try to log in etc. you guessed it, moodle tries to access the IP address that is an internal address. 

Assigning a public address is not an option.  Anyone else doing thins and have a work around??

 

 

Als Antwort auf John Knox

Re: internal vs external server address

wót David Durr -

John,

Good timing--I spent the weekend figuring this out.

If your network administrator will create a NAT mapping to your internal address and open port 80 on that address, you can add your moodle server to your external dns server and change the moodle config file to use servername.externaldomainname.edu. 

You will still be able to access the server internally by pointing your browser at servername.externaldomainname.edu.

Fixed my problems.

Als Antwort auf David Durr

Re: internal vs external server address

wót Martin Dougiamas -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Moodle HQ Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von Testers
You can also run two Moodle installations that share the same database. lächelnd

http://moodle.org/mod/forum/discuss.php?d=777&parent=3340
Als Antwort auf Martin Dougiamas

Re: internal vs external server address

wót shane luffman -
hi, regarding internal and external access for moodle, i need to change the $_SERVER[HTTP_HOST] variable in the whole of moodle to an external ip address, is there a easy way to do this and what are the implications of doing so? thanks again shane 
Als Antwort auf shane luffman

Re: internal vs external server address

wót Frederic Triquet -
Hi,

I don't know if my answer will fit your needs but we did something
that looks like what you want : our firewall allows https connections
from outside, so depending on $_SERVER['SERVER_PORT'] we
choose the right wwwroot

if ($_SERVER['SERVER_PORT'] =='80') {
  $CFG->wwwroot = 'http://192.168.1.250';
} else {
  $CFG->wwwroot = 'https://gate.blabla.fr' ;
}

You can also check SERVER_ADDR or HTTP_HOST.

HTH
Fred
Als Antwort auf Frederic Triquet

Re: internal vs external server address

wót W Page -
Hi Frederic!


Thanks in advance for your reply.

WP1
Als Antwort auf W Page

Re: internal vs external server address

wót Frederic Triquet -
Hi,

oh yes... excuse me for giving too few explanations shy

  • yes, the code is placed in config.php,
  • and it replaces the line with "$CFG->wwwroot = ..." (about line 66)
  • and yes again
best regards

Fred.
Als Antwort auf Frederic Triquet

Re: internal vs external server address

wót W Page -
Hi Fred,

Thank you for taking the time to respond to my query.

I want to do something like this eventually, therefore, I am very interested in this topic.

WP1