DNS

DNS

by faiz abdelhafid -
Number of replies: 14

Dear Moodlers

I was looking to change the platform address into a string URL instead of the default IP address. When we did that we noticed that the address does not work when we include the subfolder e.g. moodle.pass.ps/moodle. The Network Administrator told me this is has to be solved in the Moodle configuration file and the OS cannot redirected a URL containing a subfolder (/moodle).

Did anyone faced the same problem ?


Thanks

Average of ratings: -
In reply to faiz abdelhafid

Re: DNS

by Usman Asar -
Picture of Plugin developers Picture of Testers

go into moodle directory, open config.php

find the line:

$CFG->wwwroot   = 'http://192.myip.whatever';

change this  into your domain now with sub folder e.g

$CFG->wwwroot   = 'http://mymoodle.com/moodle';

also, if you have already uploaed courses prior to URL change, you have to use URL replace tool

go to www.mymoodle/moodle/admin/tool/replace/index.php

else links will not work in your moodle.
In reply to faiz abdelhafid

Re: DNS

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

The Network Administrator does not know what they are talking about as the web server can be told to serve Moodle in a URL sub folder with 'Alias': https://httpd.apache.org/docs/2.4/urlmapping.html#outside - thus DNS to the machine then configure the web server (an OS change - not Moodle) with Alias then change Moodle config.php as Usman instructs.

In reply to Gareth J Barnard

Re: DNS

by faiz abdelhafid -

Thank you all for your answers

I did change the IP address located into the Moodle configuration file, but there is two issues here :

1- address moodle.pass.edu/moodle is only accessible from the LAN.

2- We could not get rid of the "/moodle"


I am clueless mixed

Regards,

In reply to faiz abdelhafid

Re: DNS

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I thought you wanted the ip address to say /moodle.  That is how everyone answered.  If you want to lose the /moodle, you need to do the following:

Adjust your apache default host file to point to the /moodle folder.

Change your config.php to just moodle.pass.edu.  

Have the network guy adjust the dns to point moodle.pass.edu to your moodle server without the /slash moodle (this is probably already done)

For outside access, then your server needs to have external ip with dns set up.  Talk to your network admin about that.

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: DNS

by faiz abdelhafid -

Thanks Emma

I guess I was unlucky to expose my problem but you did get it.

In fact if it was an Apache server I would not ask but the problem here is that I am using IIS, and i am practically new to this.

(I am not sure if there is a config file like in Apache for windows server)


In reply to faiz abdelhafid

Re: DNS

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

There is a way to do that - Usman should be able to tell you how.

In reply to Emma Richardson

Re: DNS

by faiz abdelhafid -

I guess I need to be more precise so i can get the adequate help blush

I was looking to change our real IP address to an URL.

I changed the address pointing to the site inside the configuration file.

The Technical guy changed the IP to an URL address on the DNS.

He gave the platform two addresses, one internally and one external.

I have two problems here:

1- Moodle is not accessible from outside (Web).

2- We tried to get rid of the (/moodle) from the URL but the DNS configuration points only towards an IP address.


In reply to faiz abdelhafid

Re: DNS

by Usman Asar -
Picture of Plugin developers Picture of Testers
Faiz, I remember telling you the exact location for configuration files for IIS, it seems you never came back to that post of yours, but anyway, as I understand you want combination of sub domain and a sub folder, correct me  If I am wrong.

If you want sub domain, then use "Site Bindings", in addition to add to your DNS records about sub domain, and within that sub domain you can specify sub folder as well, which will open your moodle.mysite.com/moodle
which IIS is that you're  using?

In reply to Usman Asar

Re: DNS

by faiz abdelhafid -

Dear Usman

I did check and found them but i did not find what I was looking for (changing the port and the address like in Apache).


In reply to faiz abdelhafid

Re: DNS

by Usman Asar -
Picture of Plugin developers Picture of Testers
Faiz, there is no need for getting into the configuration files when you can do everything from IIS management panel.
As mentioned, it will be site bindings that you'll be using, but how did you manage to set up your initial domain?
are you incharge of setting up IIS as well? or just moodle?
how are you currently accessing your site locally? through URL or IP?
and you haven't mentioned your IIS version?

In reply to Usman Asar

Re: DNS

by faiz abdelhafid -

Dear Usman

I am in charge of Moodle Server only which is running Windows Server 2008 R2 as OS, but I am not in charge of the main gateway connected to the internet.

Our moodle is pointed to a real IP address, but when the Network admin connected the server to their domain, they used a local IP address.

My IIS version is 7.

When i use the IP directly it works perfectly, but when i change that to URL it's not accessible from internet (Network admin added already configured the DNS to use the URL instead of the real IP).

In reply to faiz abdelhafid

Re: DNS

by Usman Asar -
Picture of Plugin developers Picture of Testers

OK understood, it will be IIS 7.5 with R2, and unless your gateway is capable of loopback, you will not be able to access your site using domain on same  network, try using some other internet and see if it still shows issues, or if your router/gateway has loopback capability, then this is work of your network admin to allow loops for you can then access domain names on same network, else it will only be opened by IP.

In reply to Usman Asar

Re: DNS

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, here is how I did it once with Moodle 1.9:

Moodle can only be accessed via a single URL, so:

  • External DNS entry points to the external IP of server via the Firewall etc.
  • Internal DNS entry points to the internal IP of the server.
  • Both DNS entries have the same URL - 'a' record?
  • Configure Moodle to use the URL specified in the DNS.
  • Configure web server to associate URL with file path of where Moodle is installed, even if its a sub-folder.

But if only one DNS entry that is broadcast on the web, then use that and hopefully internal switches will be smart enough to re-route packets back internally when accessed internally.

In reply to Gareth J Barnard

Re: DNS

by Ken Task -
Picture of Particularly helpful Moodlers

Been my experience that boundary firewalls shouldn't be allowed nor configured to allow loop back ... could lead to attacks from internal machines that would ID as coming from the boundary firewall IP address.

The only way to resolve this issue, me thinks, has already been suggested ...

Outside DNS: mymoodle.domain has external IP address

Inside DNS: mymoodle.domain has internal IP address

Moodle uses FQDN ... mymoodle.domain in it's config ... then it's satisfied as to how it's accessed.

My 2 cents, of course.

'spirit of sharing', Ken