IP v URL problem - Moodle 3.3.+

IP v URL problem - Moodle 3.3.+

by Dave Emsley -
Number of replies: 4

I have set up a Moodle server using its IP address.   Moodle is in the default folder /var/www/html/moodle.   Works fine.

I've set the A record of the subdomain:   learn.subdomain.com to point to the IP address.  I've changed config.php so that $CFG->wwwroot   = 'http://learn.subdomain.com/moodle';... doesn't work. 
(edit - could it be the DNS hasn't propagated properly yet?)


All I get is the screen below with no folder content.

Where have I gone wrong please?

Cheers

Dave



Average of ratings: -
In reply to Dave Emsley

Re: IP v URL problem - Moodle 3.3.+

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

What was the URL (wwwroot) of the Moodle site when you used the IP address? Did it have /moodle on the end as well?

In reply to Dave Emsley

Re: IP v URL problem - Moodle 3.3.+

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

If you are already directing the ip address to the moodle folder, then you do not need to list the moodle folder in your dns name.  Also, when you do get this right, you will need to run the replace tool on the database to update all references to the old wwwroot to the new one.

In reply to Dave Emsley

Re: IP v URL problem - Moodle 3.3.+

by Matt T -

I'm thinking maybe check your Apache configuration files and make sure the ServerName directive is set to "learn.subdomain.com" and the document root is /var/www/html 

If you want to avoid dns caching issues change your computers host file as that propagates instantly. Also, FYI for future, drop the domains TTL to 5 seconds before making changes in the future


In reply to Matt T

Re: IP v URL problem - Moodle 3.3.+

by Dave Emsley -
Thanks everyone for suggestions.  Basically hadn't given it time to propagate.