Config uses local ip address behind NAT so I cant access from WWW
I dont think its a problem with my NAT or DNS etc as I can access a test.php from the WWW
I noticed that in config.php I have the line
$CFG->wwwroot = 'http://192.168.1.254/moodle';
I'm guessing I need to change this to something like
$CFG->wwwroot = 'http://my.domian.com/moodle';
However just editing this on its own this doesn't fix things, I'm guessing I need to rerun some script to action it?
Any help appreciated
Wayne
I made it accesable iinside the FW and outside.
Comment out $CFG->wwwroot = 'http://192.168.1.254/moodle';
Add:
if($ipstr == '10.')
{
$CFG->wwwroot = 'http://10.1.1.75/moodle;
}
else
{
$CFG->wwwroot = 'http://[firewall IP address]/moodle';
}
Simple and works well!
$ipstr = getenv('REMOTE_ADDR');
$ips = substr($ipstr, 0, 3);
if (ips == '10.')
{
$CFG->wwwroot = 'http://[trusted IP]/moodle';
}
else
{
$CFG->wwwroot = 'http://[firewall IP]/moodle';
}
This really works...
Hi Mark,
I did it and it still didn't work....
Any other ideas...
Jeannie
I tried and didn´t work
Do you´ll know other news tips???
Regards.
You need to set up a domain name that is mapped to from outside (www) and internal network with DNS. Then in config.php change $CFG->wwwroot = 'http://192.168.1.254/moodle' to $CFG->wwwroot='http://yourdomainname.com/moodle.
After doing this, you need to restart apache. Then you will need to run replace.php on your database to update all the references there.
On a side note, to make this work best, you should direct apache to your moodle folder by default, then you will not need the /moodle at the end of your domain name.
^^ This.
This sort of thing isn't ideal either way (use proper hosting, or find a server with a 'real' IP address) but it's preferable to use a split DNS over the config.php 'fiddle'.
Both have slight security issues unfortunately.