config.php file

config.php file

by Sagefarc Sagefarc -
Number of replies: 3

I installed moodle and I can access Moodle login page from the internet via http://MyPublicIP/moodle.

I recently bought a domain and now I can accessed the login page via http://MyDomain.com/moodle.

Now, I would like to access the login page without entering moodle - I would like to use http://MyDomain.com. Based on Moodle documentation, I need to edit config.php as follow: 

cd /var/www/html/moodle sudo vim config.php

Under $CFG->wwwroot change to http://ip.address.of.server instead of http://ip.address.of.server/moodle


I made the change and I am still unable to access the page via http://MyDomain.com -- I only get the Ubuntu page. How can I fix this?

Average of ratings: -
In reply to Sagefarc Sagefarc

Re: config.php file

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

You need to change the DocumentRoot directory of your server to point directly to your Moodle installation rather than its parent directory where it points now. Currently you still need the /moodle on the end of the URL. Just changing it in config.php isn't enough. 

In reply to Sagefarc Sagefarc

Re: config.php file

by Ken Task -
Picture of Particularly helpful Moodlers

+1 to what Howard has already posted ... but , there's nothing like getting to know (in more detail) your 'choice of poison' ... Ubuntu ...

Official docs:

https://help.ubuntu.com/lts/serverguide/httpd.html

You'll be better off in the long run and can solve many apache related problems on your own! ;)

'spirit  of sharing', Ken