access moodle via http://hostname rather than http://hostname/moodle

access moodle via http://hostname rather than http://hostname/moodle

by Dennis Masuku -
Number of replies: 2

Access moodle via http://hostname rather than http://hostname/moodle

I want the users when there type http://hostname- to be taken to the login page- rather than to be taken to Bitnami application and then click Access Bitnami Moodle Stack.

Your assistance will be greatly appreciated

 

 

Average of ratings: -
In reply to Dennis Masuku

Re: access moodle via http://hostname rather than http://hostname/moodle

by Ken Task -
Picture of Particularly helpful Moodlers

Two options ... of the two the latter might be easier ...

Option 1:

if you already have content/courses in the Moodle: edit the config.php file of the moodle code folder and change the URL to Moodle.  

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

to

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

Move all files folders (including the hidden 'dot' files) out of the moodle folder up one level so those are now at document root for apache server.  That's found in the apache2.conf or httpd.conf file for apache.

When you move files, double check the ownerships and permissions on them before an after moving them.

Then access the site as admin level user.   Go to http://site/admin/tool/replace/ via URL in browser.

Search for http://site/moodle/ and replace with http://site/  Include the http:// in front and the trailing '/'.

Option 2:

change the document root for apache in bitnami from

example: /var/www/html/ to /var/www/html/moodle/  Restart apache service.   Done.

Check links to files and images to see if they display.  If they do not, edit them and look at the path ... if you see /moodle/ remove that reference and save.

'spirit of sharing', Ken