+ Post New Thread
Page 1 of 3 123 LastLast
Results 1 to 15 of 39
Virtual Learning Platforms Thread, Moodle two IP Addresses (LAN & Internet) in Technical; I am using Moodle locally hosted on Intranet Students can access it without any problem. Its a normal server with ...
  1. #1

    Join Date
    Jan 2011
    Posts
    67
    Thank Post
    34
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Moodle two IP Addresses (LAN & Internet)

    I am using Moodle locally hosted on Intranet
    Students can access it without any problem. Its a normal server with one NIC.

    We have a setup of Local Active Directory, DNS & DHCP etc.

    Currently the setup is that the IP address of the Moodle is mapped with ISP and LAN users are accessing it via that external IP address.

    It means that even local users on LAN use the External IP address to access it, which is a bit slow.

    I read a lot on forums and everyone is suggesting to forward local machines via DNS to point at the external address.

    How can i do it?
    I want to have the settings of external IP address in Moodle Config file meanwhile i want the intranet users to access the server on LAN with excellent speed.

    Can anyone tell me in steps how to do it via DNS?

    thanks

  2. #2


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,691
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    Hi,

    Welcome to Edugeek.

    The domain you access Moodle on:

    1) Is it the same address internally & externally?
    2) Do you have a 'zone' for this domain on your internal DNS so that internal queries use internal hostnames for email servers etc?

    Does your moodle server have an internal IP that your ISP nat an external one to or does it bind directly to an external IP?

    Your answers to the above will help identify the best way to do it.

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,957
    Thank Post
    886
    Thanked 1,700 Times in 1,477 Posts
    Blog Entries
    12
    Rep Power
    448
    Are you connecting via Ip address for example http://10.10.10.10 ?

  4. #4

    Join Date
    Jan 2011
    Posts
    67
    Thank Post
    34
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    thanks for ur reply kmount & FN-GM
    1) Is it the same address internally & externally?
    No the actual IP address of server on Lan is 10.14.*.* but i access it via external ip 212.*.*.* even on Lan i use this IP

    2) Do you have a 'zone' for this domain on your internal DNS so that internal queries use internal hostnames for email servers etc?
    We do have a DNS but i didnt define anything on it as yet

    Does your moodle server have an internal IP that your ISP nat an external one to or does it bind directly to an external IP?
    I have internal IP and my ISP NAT or connects it via IR

    ON my DNS i have following things
    Forward Lookup Zones
    Reverse Lookup Zones
    Last edited by karan_jhr; 11th January 2011 at 05:04 AM.

  5. #5


    Join Date
    Feb 2007
    Location
    Northamptonshire
    Posts
    4,691
    Thank Post
    352
    Thanked 796 Times in 715 Posts
    Rep Power
    347
    What is inside Forward Lookup Zones?

    Assuming your Moodle is accessed at vle.domain.com from both inside/outside do you have domain.com in your forward lookup zones?

  6. #6
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42
    Why do you use the external ip when on the LAN?

  7. #7

    m25man's Avatar
    Join Date
    Oct 2005
    Location
    Romford, Essex
    Posts
    1,626
    Thank Post
    49
    Thanked 460 Times in 336 Posts
    Rep Power
    140
    You have an internal server called myserver.mydomain.internal but you reach it from the Internet using a public IP or FQDN eg. moodle.myschool.com
    Using a single NIC you must be using a NAT router and port redirection/forwarding.

    This situation is called "Split DNS"

    Google for this and follow the hundreds of guides on how to set this up...

  8. #8

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,176
    Thank Post
    284
    Thanked 773 Times in 583 Posts
    Rep Power
    335
    I presume as well as your internal DNS server you have external DNS provided by some external DNS provider. If thats the case you just create a record on your internal DNS server pointing to your internal IP 10.14.*.* and on your external dns provider you leave it as the external IP 212.*.*.*

  9. #9

    Join Date
    Jan 2011
    Posts
    67
    Thank Post
    34
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    okay it worked
    thanks
    Now i am able to access it locally via 10.14.*.*
    External Address is 212.*.*
    In Config.php i have defined local IP 10.14.*.* and its working perfectly fine
    BUT
    When i am browsing via Internet
    It loads the page BUT without CSS???

  10. #10

    sonofsanta's Avatar
    Join Date
    Dec 2009
    Location
    Lincolnshire, UK
    Posts
    4,954
    Thank Post
    862
    Thanked 1,444 Times in 991 Posts
    Blog Entries
    47
    Rep Power
    617
    Quote Originally Posted by karan_jhr View Post
    okay it worked
    thanks
    Now i am able to access it locally via 10.14.*.*
    External Address is 212.*.*
    In Config.php i have defined local IP 10.14.*.* and its working perfectly fine
    BUT
    When i am browsing via Internet
    It loads the page BUT without CSS???
    Check the address that is referenced for the CSS - is it using absolute addressing e.g. moodle.domain.sch.uk/styles.css or is it relative e.g. just /theme/styles.css?

    Just View Source and do a find for .css and you should get your answer.

  11. #11

    Join Date
    Jan 2011
    Posts
    67
    Thank Post
    34
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I cannot see any CSS settings in my config file
    please help me in changing it

    Code:
    <?php  /// Moodle Configuration File 
    
    unset($CFG);
    
    $CFG->dbtype    = 'mysql';
    $CFG->dbhost    = 'localhost';
    $CFG->dbname    = 'moodle';
    $CFG->dbuser    = 'root';
    $CFG->dbpass    = '***********';
    $CFG->dbpersist =  false;
    $CFG->prefix    = 'mdl_';
    $CFG->wwwroot   = 'http://10.14.*.*/moodle';
    $CFG->dirroot   = 'C:/Inetpub/wwwroot/moodle';
    $CFG->dataroot  = 'C:/Inetpub/moodledata';
    $CFG->admin     = 'admin';
    
    $CFG->directorypermissions = 00777;  // try 02777 on a server in Safe Mode
    
    $CFG->passwordsaltmain = '>+@ #0CMXq?>_Pz@e^+].H],';
    
    require_once("$CFG->dirroot/lib/setup.php");
    // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
    // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
    ?>

  12. #12

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    karan_jhr: Don't configure the Moodle setting (wwwroot) to the IP address - this will only work for internet or internal - not both. But do configure it for the hostname (e.g. http://www.myschool.com/moodle).

    If you've followed the instructions and advice above, everything should then work.

    On your LAN, your DNS server should be configured for www.myschool.com to resolve to 10.14.*.*. So when your LAN clients try to access Moodle, your internal DNS server will respond with 10.14.*.* and it will be fine. On the Internet, people will receive 212.*.*.* as the address, and it will be fine.

  13. #13

    Join Date
    Jan 2011
    Posts
    67
    Thank Post
    34
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    thanks webman
    i have changed the settings in config.php
    and renamed wwwroot to the actual address (e.g. http://www.myschool.com/moodle)
    its loading fine on LAN
    still on internet loading but without CSS??
    Last edited by karan_jhr; 11th January 2011 at 10:09 AM.

  14. #14

    sonofsanta's Avatar
    Join Date
    Dec 2009
    Location
    Lincolnshire, UK
    Posts
    4,954
    Thank Post
    862
    Thanked 1,444 Times in 991 Posts
    Blog Entries
    47
    Rep Power
    617
    Quote Originally Posted by karan_jhr View Post
    I cannot see any CSS settings in my config file
    please help me in changing it
    Nothing that in-depth - just load your VLE in IE, Firefox etc., go to the View menu and choose to View Source. This will show you HTML code that constitutes the web page - and in there you should see where the page is trying to get the CSS from. If you've changed the wwwroot in your config as above it will probably be looking at 10.14.*.*/moodle/themes/styles.css (or similar), which obviously then won't work for people accessing externally. Change the wwwroot to your domain, as webman says, and then everyone should be able to get to it.

    In short: do what webman said and it should fix the CSS error.

  15. #15

    Join Date
    Jan 2011
    Posts
    67
    Thank Post
    34
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Did exactly as webman said
    Local address 10.14.*.* on LAN and Config File
    Working good
    Via Internet Loads but without CSS

SHARE:
+ Post New Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. Stumped with this one...internet connection problem over LAN
    By Little-Miss in forum Internet Related/Filtering/Firewall
    Replies: 11
    Last Post: 19th May 2010, 04:07 PM
  2. Remote Access to LAN PCs over Internet
    By Asif in forum Network and Classroom Management
    Replies: 15
    Last Post: 5th September 2009, 08:56 PM
  3. Running out of (private) addresses on College LAN
    By Bruce123 in forum Wireless Networks
    Replies: 20
    Last Post: 26th May 2009, 10:33 AM
  4. !!HELP!! Static IP & LAN Issue
    By Kamran7860 in forum Windows 7
    Replies: 8
    Last Post: 11th May 2009, 08:24 PM
  5. Blocked addresses to internet?
    By jmair in forum Windows
    Replies: 4
    Last Post: 21st August 2008, 08:22 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •