internal vs external server address

internal vs external server address

de către John Knox-
Număr de răspunsuri: 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??

 

 

Media aprecierilor: -
Ca răspuns la John Knox

Re: internal vs external server address

de către 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.

Ca răspuns la David Durr

Re: internal vs external server address

de către Martin Dougiamas-
Fotografia lui Core developers Fotografia lui Documentation writers Fotografia lui Moodle HQ Fotografia lui Particularly helpful Moodlers Fotografia lui Plugin developers Fotografia lui Testers
You can also run two Moodle installations that share the same database. surâs

http://moodle.org/mod/forum/discuss.php?d=777&parent=3340
Ca răspuns la Martin Dougiamas

Re: internal vs external server address

de către 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 
Ca răspuns la shane luffman

Re: internal vs external server address

de către 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
Ca răspuns la Frederic Triquet

Re: internal vs external server address

de către W Page-
Hi Frederic!


Thanks in advance for your reply.

WP1
Ca răspuns la W Page

Re: internal vs external server address

de către 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.
Ca răspuns la Frederic Triquet

Re: internal vs external server address

de către 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