internal vs external server address

internal vs external server address

napisao/la John Knox -
Broj odgovora: 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??

 

 

Odgovor na John Knox

Re: internal vs external server address

napisao/la 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.

Odgovor na David Durr

Re: internal vs external server address

napisao/la Martin Dougiamas -
Slika Core developers Slika Documentation writers Slika Moodle HQ Slika Particularly helpful Moodlers Slika Plugin developers Slika Testers
You can also run two Moodle installations that share the same database. osmijeh

http://moodle.org/mod/forum/discuss.php?d=777&parent=3340
Odgovor na Martin Dougiamas

Re: internal vs external server address

napisao/la 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 
Odgovor na shane luffman

Re: internal vs external server address

napisao/la 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
Odgovor na Frederic Triquet

Re: internal vs external server address

napisao/la W Page -
Hi Frederic!


Thanks in advance for your reply.

WP1
Odgovor na W Page

Re: internal vs external server address

napisao/la 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.
Odgovor na Frederic Triquet

Re: internal vs external server address

napisao/la 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