installing moodle on an external server

installing moodle on an external server

by anne-marijke gerretsen -
Number of replies: 12

We have been using Moodle for our internal training for a little while after installing it on our intranet. We're very happy with it, now that we have figured it out wink.

For some of our training programs we need to provide access via the internet, instead of our intranet. Our internet is hosted on an external server. Is it possible to install Moodle on an external server? If so, any tips on how to go about it?

Thanks from down-under cool

Average of ratings: -
In reply to anne-marijke gerretsen

Re: installing moodle on an external server

by Christian Beitzel -

Hi Anne-Marijke,

I am doing thaty exact thing at the moment with our moodle... moving from intranet to extranet (internet + intranet access). Trouble is moodle wants to work from only one IP address.. either inter or intranet, but not both. As a result internal users now have to use the internet connection to access the "internal" moodle which is slowed down by the power of the internet access (1.5 Mb down and 256K up). and it realy slows to a grinding halt.

explanation in detail below.

I have been developing a moodle installation at Erindale College in the ACT. It has been 
running fine as an "intranet" - ie within the student LAN on a private IP address network.
 We recently installed a broadband connection and I set a redirection on the ADSL 
modem/switch/router to allow internet connections to see moodle on the intranet web server. 
 I also adjusted the config.php file to set wwwroot to the static IP address of the ADSL 
connection (originally it had the private IP address of the intranet web server. 

Now this is the problem. How do I maintain the nice fast access to moodle on the intranet - as now it slows to a grinding halt with 20-40 students accessing it at the same time - and they have to type in the "external" address for moodle rather than the old internal address. 

In reply to Christian Beitzel

Re: installing moodle on an external server

by Charles Libby -

Would it be possible to set up a second Moodle on a second machine for the public side, but point it to the Internal server as the Database Server?  This way you have two apache (or what ever the web server) servers which will not get confused.

                                       /------- Internet Web Server

Database Server-------/

                                       \----- Intranet Web Server

The Intranet web server could be both Database Server and Intranet Web server.  You just have to set the internet server to look at the remote database.  something like

moodle@databaseserver

You will have to set it up  on the database server to allow the access from another computer other than the local host, but that should be fairly easy.  I am hoping to be able to formalize that kind of setup in the near future, I just need a couple of machines to do it on so I can work through it and write the procedure.

In reply to Charles Libby

Re: installing moodle on an external server

by Huib van Wees -
Well, this should work but...

Don't forget the moodle data directory.
I suggest you use a NFS mount for the moodle data directory (on the databse server for instance).
Or keep it in sync with a two way rsync on the webservers (or any other sync tool).

Regards,

Huib
In reply to Huib van Wees

Re: installing moodle on an external server

by Charles Libby -

The question arises if the two groups will see each other.  If the courses are separate then the data directory could be on each machine, if the two need to see each other then the NFS would work.

In reply to Christian Beitzel

Re: installing moodle on an external server

by Fermí Cueva -

Hello Christian,

The web site location in config.php file must be adjusted like this:

$CFG->wwwroot   = "http://".$_SERVER["HTTP_HOST"]."/moodle";

Then Moodle will be accessible from local and remote calls both.

Fermin Cueva

(disculpa mi inglés que es bastante pobre)

Average of ratings: Useful (1)
In reply to Fermí Cueva

Re: installing moodle on an external server

by john attwood -

What goes where ? Do you paste this exact code or is .$_Server the private address of the moodle server and http_host the external address of the router ? I'm not sure what to make of this.

192.168.1.3 private address of my moodle server

68.185.192.181 external address of my router  what goes where ?

Thank you.

In reply to john attwood

Re: installing moodle on an external server

by Fermí Cueva -

There is exatly the code you must to write.

Then, if you call from localhost it will go to root server and if you call from external it will go equally to rootserver.

You must write this code in config.php.

bye

In reply to john attwood

Re: installing moodle on an external server

by shane luffman -
hi, im doing the same thing, would it be possible if you could show me exactly what code you modified to get the internal and external ip addresses working with moodle,  
In reply to shane luffman

Re: installing moodle on an external server

by Bob Boufford -

Shane (and others),

Before trying to modify Moodle, check with your network administrator to see if your router or firewall can be configured to allow access to your Moodle server from the Internet. My Moodle server is sitting on my home network, i.e. "intranet" with a private IP address. My D-Link 614+ router allows me to configure at "virtual web server" that points my Moodle server address. To get to my Moodle server from the Internet, I just enter the address of my router. No need to hassle with external and internal address configuration.

Cheers,

Bob

In reply to Fermí Cueva

Re: installing moodle on an external server

by Anil Karwankar -

hello

my internal ip is 192.168.5.195

my external ip is 210.212.183.116

$CFG->wwwroot   = http://".$_SERVER["HTTP_HOST"]./a>";

what will be configuration in $CFG->wwwroot = http://".$192.168.5.195["210.212.183.116]."

please let me know thanks in advance

In reply to Anil Karwankar

Re: installing moodle on an external server

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Anil

You have grabbed an old discussion.

Any way, the idea behind the line
$CFG->wwwroot = http://".$_SERVER["HTTP_HOST"].";

is that .$_SERVER["HTTP_HOST"] will be replaced by the HTTP_HOST variable _at each HTTP request_.

If you call http://a.b.c.d, then wwwroot will be http://a.b.c.d; if you call http://some.dns.name then wwwroot is http://some.dns.name, etc.

I'm not sure whether I'm answering the right quesion ;-(

In reply to Christian Beitzel

Re: installing moodle on an external server

by Rob Delissen -

I host moodle on an e-smit 5.6 server, placed in an ipcop dmz

dnsname: lesnet.minkema.nl

internal dns points to the dmz, which is routed internally.

external dns points to the public ip of ipcop.

so local trafic is routed internally. I did this to make sure moodle is working even when internet goes down...