Hi,
our network has two network trees (novell), one for students (10.5.*) and one for staff(10.6.*). I want our moodle installation to be accessible from both sides of the tree (and also from outside the college).
at the moment i've got this in config.php:
$CFG->wwwroot = '10.6.*';
With this only those on the staff network(tree) can see moodle. I've seen how to amend config.php so that moodle can be accessed from
and internal and an external address though I can't suss out how to
code this so that both internal addresses can access moodle.
i'm on a windows 2003 server, running apache2.
In reply to sam butler
Re: accessing one moodle install from two separate local domains
by Jonathan Moore -
Sam what IP or IP addresses have you assigned to the moodle server?
Also is there any routing between the two internal subnets or are they completely seperate and if so do you have multiple network cards in the server each setting one of the two internal subnets?
The same sample code that illistrates how to do the internal/external ip swap in php should work in this situation too, it is based on pulling the server ip address from apache. This is the ip address that the server was called as. The trick though in this scenario is that the server needs to be accessible via an all three ips. One for each internal subnet and one public IP.
If you need more assistance followup with a few more details on how your network topology is setup and I a may be able to give you some more specific answers.
Also is there any routing between the two internal subnets or are they completely seperate and if so do you have multiple network cards in the server each setting one of the two internal subnets?
The same sample code that illistrates how to do the internal/external ip swap in php should work in this situation too, it is based on pulling the server ip address from apache. This is the ip address that the server was called as. The trick though in this scenario is that the server needs to be accessible via an all three ips. One for each internal subnet and one public IP.
If you need more assistance followup with a few more details on how your network topology is setup and I a may be able to give you some more specific answers.
In reply to Jonathan Moore
Re: accessing one moodle install from two separate local domains
by sam butler -
Hi Jonathan,
here's what i got from our network engineer:
Sam what IP or IP addresses have you assigned to the moodle server?
VLAN1 10.2.255.110 VLAN2 10.3.255.110
Also is there any routing between the two internal subnets or are they completely seperate and if so do you have multiple network cards in the server each setting one of the two internal subnets?
Subnets are seperate, routing would be via firewall if allowed, which we dont want to do otherwise upload/download traffic will also be routed and load the firewall.
The same sample code that illistrates how to do the internal/external ip swap in php should work in this situation too, it is based on pulling the server ip address from apache. This is the ip address that the server was called as. The trick though in this scenario is that the server needs to be accessible via an all three ips. One for each internal subnet and one public IP.
i've subsequently tried the following:
if ($_SERVER['HTTP_HOST'] == '10.2.255.110') {
$CFG->wwwroot = 'http://10.3.255.110:80/';
} else {
$CFG->wwwroot = 'http://202.***.*.***:80/';
}
I've also tried it without the slash after the port number of the two ip address and only the 10.3. address resolves.
If you need more assistance followup with a few more details on how your network topology is setup and I a may be able to give you some more specific answers.
regarding mervyn's post not sure what you mean by the yourdirectory part:
$CFG->wwwroot = 'http://'.$_SERVER['HTTP_HOST'].'/yourdirectory'
do you mean put the full path of the moodle folder in there ie D:program files\apache group\apache2....... as my moodle folder resides in htdocs.
I've set up a vritualHost for moodle with 10.3.255.110:80 as the address and also have listen set up for both 10.3 and 10.2 addresses in my apache conf file.
cheers guys!
here's what i got from our network engineer:
Sam what IP or IP addresses have you assigned to the moodle server?
VLAN1 10.2.255.110 VLAN2 10.3.255.110
Also is there any routing between the two internal subnets or are they completely seperate and if so do you have multiple network cards in the server each setting one of the two internal subnets?
Subnets are seperate, routing would be via firewall if allowed, which we dont want to do otherwise upload/download traffic will also be routed and load the firewall.
The same sample code that illistrates how to do the internal/external ip swap in php should work in this situation too, it is based on pulling the server ip address from apache. This is the ip address that the server was called as. The trick though in this scenario is that the server needs to be accessible via an all three ips. One for each internal subnet and one public IP.
i've subsequently tried the following:
if ($_SERVER['HTTP_HOST'] == '10.2.255.110') {
$CFG->wwwroot = 'http://10.3.255.110:80/';
} else {
$CFG->wwwroot = 'http://202.***.*.***:80/';
}
I've also tried it without the slash after the port number of the two ip address and only the 10.3. address resolves.
If you need more assistance followup with a few more details on how your network topology is setup and I a may be able to give you some more specific answers.
regarding mervyn's post not sure what you mean by the yourdirectory part:
$CFG->wwwroot = 'http://'.$_SERVER['HTTP_HOST'].'/yourdirectory'
do you mean put the full path of the moodle folder in there ie D:program files\apache group\apache2....... as my moodle folder resides in htdocs.
I've set up a vritualHost for moodle with 10.3.255.110:80 as the address and also have listen set up for both 10.3 and 10.2 addresses in my apache conf file.
cheers guys!
In reply to sam butler
Re: accessing one moodle install from two separate local domains
by M Moodley -
In reply to M Moodley
Re: accessing one moodle install from two separate local domains
by sam butler -
just taking the opportunity to 'bump' this back up as I still haven't resolved the issue.
again the problem is that I have two separate internal network 'trees' (10.4.255.78 and 10.5.255.78) and one install of moodle on the 10.4.255.78 address. I need to access moodle from both of these trees, as well as externally (external ip address resolves OK). the problem lies with the 10.5.255.78 address as it does not resolve at all.
cheers!
sam
again the problem is that I have two separate internal network 'trees' (10.4.255.78 and 10.5.255.78) and one install of moodle on the 10.4.255.78 address. I need to access moodle from both of these trees, as well as externally (external ip address resolves OK). the problem lies with the 10.5.255.78 address as it does not resolve at all.
cheers!
sam
In reply to sam butler
Re: accessing one moodle install from two separate local domains
by Iñaki Arenaza -
You are using different IPs and network numbers in each message, so choose the real ones and stick to them, please. Otherwise, we'll be having a hard time coming up with a solution 
First question: how many network cards does this server have? Where are they attached? Same network? Same segment? Differente segmentes? Same VLAN? Different VLANS? How many different IPs does it have? Which one is used for which card in whic segment/VLAN?
Before we know the connection topology, sorting out this issue is really difficult.
Once we know this, we'll concentrate on routing/firewalling, and lastly on Apache/Moodle issues. This way we can be sure all the underlying infrastructure is in place and operating correctly.
Saludos. Iñaki.
First question: how many network cards does this server have? Where are they attached? Same network? Same segment? Differente segmentes? Same VLAN? Different VLANS? How many different IPs does it have? Which one is used for which card in whic segment/VLAN?
Before we know the connection topology, sorting out this issue is really difficult.
Once we know this, we'll concentrate on routing/firewalling, and lastly on Apache/Moodle issues. This way we can be sure all the underlying infrastructure is in place and operating correctly.
Saludos. Iñaki.
In reply to Iñaki Arenaza
Re: accessing one moodle install from two separate local domains
by sam butler -
Hi Inaki,
here's the answers so far:
First question: how many network cards does this server have? Where are they attached? Two - both attached to server farm router.
here's the answers so far:
First question: how many network cards does this server have? Where are they attached? Two - both attached to server farm router.
Same network? No - separate VLAN, hence the request for
multi homed interfaces.
Same segment? VLAN's have their own segment. One
10.2.0.0 and one 10.3.0.0.
Different segments? Yes.
Same VLAN? No
Different VLANS? Yes - One
10.2.0.0 and one 10.3.0.0.
How many different IP's does it have? Two, one for each
VLAN.
Which one is used for which card in which segment/VLAN? Dosn't really matter, they can be swapped easily.
In reply to sam butler
Re: accessing one moodle install from two separate local domains
by Iñaki Arenaza -
Ok, so now you have to different IPs attached to your Moodle server and you don't want to route traffic through your firewall to access it. In other words, you want your users from VLAN 10.2.0.0 to access your Moodle server using 10.2.0.x and your 10.3.0.0 VLAN users to access it using 10.3.0.x. In addition to that, you want to access you Moodle site from the internet using a public IP (let's say it's x.y.z.w).
I'm afraid the only answer to this is using a DNS server which supports 'views', i.e., a DNS server that responds with a different IP for the same name taking into account who is asking the question (i.e. the client IP).
You can't use IPs in your $wwwroot variable in config.php file because Moodle uses that value to build lots of URLs using that value. So some URLs will be accesibles (the ones with the IP in the same VLAN of the client) and some won't (the ones with the IP which is in the other VLAN or the internet).
You have to use a DNS name in your $wwwroot variable, and you need a DNS server with views, or a differente DNS server for each VLAN.
I thinks Microsoft's DNS server doesn't have 'views', so you'll have to user BIND (www.isc.org/bind) on Unix/Linux if you can't afford to use several DNS servers.
Of course, things are much easier if you can route your moodle traffic across your firewall.
Saludos. Iñaki.
I'm afraid the only answer to this is using a DNS server which supports 'views', i.e., a DNS server that responds with a different IP for the same name taking into account who is asking the question (i.e. the client IP).
You can't use IPs in your $wwwroot variable in config.php file because Moodle uses that value to build lots of URLs using that value. So some URLs will be accesibles (the ones with the IP in the same VLAN of the client) and some won't (the ones with the IP which is in the other VLAN or the internet).
You have to use a DNS name in your $wwwroot variable, and you need a DNS server with views, or a differente DNS server for each VLAN.
I thinks Microsoft's DNS server doesn't have 'views', so you'll have to user BIND (www.isc.org/bind) on Unix/Linux if you can't afford to use several DNS servers.
Of course, things are much easier if you can route your moodle traffic across your firewall.
Saludos. Iñaki.
In reply to Iñaki Arenaza
Re: accessing one moodle install from two separate local domains
by sam butler -
thanks very much for your swift response Inaki...!
we are just about to decomission one of our servers and the plan is to use that as our second DNS server.
would you be able to tell me what my config.php would look like:
$CFG->wwwroot = ?
thanks again
sam
we are just about to decomission one of our servers and the plan is to use that as our second DNS server.
would you be able to tell me what my config.php would look like:
$CFG->wwwroot = ?
thanks again
sam
In reply to sam butler
Re: accessing one moodle install from two separate local domains
by Steve Power -
Sam
I have several different names for the one site and following a suggestion by someone else in these discussion groups I set the following
$CFG->wwwroot = 'http://'.$_SERVER['HTTP_HOST'];
This is much simpler and more eleganmt than the multi line nested if statements I was using previously. Hope it helps you.
Regards
Steve
In reply to Steve Power
Re: accessing one moodle install from two separate local domains
by sam butler -
Hi Steve,
I've tried that and when I try to access moodle from the 10.2.0.0 side of the network I get directed to the index page of the document root of my webserver (D:/Program Files/Apache Group/Apache2/htdocs/website) and not the moodle directory . Ive set up the httpd.conf file like so:
Listen 10.3.0.1:80 #address of my default website (document root)
Listen 10.3.0.0:80 #address where the moodle resides on 1 side of the network
Listen 10.2.0.0:80 #the other side of the network that needs to access moodle internally
DocumentRoot "D:/Program Files/Apache Group/Apache2/htdocs/website"
<VirtualHost 10.3.0.0:80>
DocumentRoot "D:/Program Files/Apache Group/Apache2/htdocs/moodle/"
ServerName www.moodle.riverview.nsw.edu.au
ErrorLog logs/moodle.riverview.nsw.edu.au-error_log
CustomLog logs/moodle.riverview.nsw.edu.au-access_log common
</VirtualHost>
any obvious errors here......?
thanks
I've tried that and when I try to access moodle from the 10.2.0.0 side of the network I get directed to the index page of the document root of my webserver (D:/Program Files/Apache Group/Apache2/htdocs/website) and not the moodle directory . Ive set up the httpd.conf file like so:
Listen 10.3.0.1:80 #address of my default website (document root)
Listen 10.3.0.0:80 #address where the moodle resides on 1 side of the network
Listen 10.2.0.0:80 #the other side of the network that needs to access moodle internally
DocumentRoot "D:/Program Files/Apache Group/Apache2/htdocs/website"
<VirtualHost 10.3.0.0:80>
DocumentRoot "D:/Program Files/Apache Group/Apache2/htdocs/moodle/"
ServerName www.moodle.riverview.nsw.edu.au
ErrorLog logs/moodle.riverview.nsw.edu.au-error_log
CustomLog logs/moodle.riverview.nsw.edu.au-access_log common
</VirtualHost>
any obvious errors here......?
thanks
In reply to sam butler
Re: accessing one moodle install from two separate local domains
by Heather P -
Can't you just set up a second Virtual Host - this time for the internal IP address. From your description it looks like your internal is just following the rules and going to the default web page for apache, if you specify a second virtual host I think it should go where you want it. I'm no expert and don't even pretend to be so I could be well off the mark with that idea - but our current system has multiple virtual hosts all going to different Moodle sites all on the one server.
When we had a different VLE (Learnwise) we had two network cards (and IIS not apache) and assigned the same host header (equivalent of Virtual host from what I gather) to two different IPs and that worked so that we could have one URL link on the college website that worked whether you were inside the college or out.
When we had a different VLE (Learnwise) we had two network cards (and IIS not apache) and assigned the same host header (equivalent of Virtual host from what I gather) to two different IPs and that worked so that we could have one URL link on the college website that worked whether you were inside the college or out.
In reply to sam butler
This forum post has been removed
The content of this forum post has been removed and can no longer be accessed.