Trying to access Moodle, just redirects to "local host"

Trying to access Moodle, just redirects to "local host"

by Paul Ross -
Number of replies: 6

When I try and access Moodle, it redirects to my localhost, then displays PHP information.

I just installed for the first time, I am using IIS and Windows Server 2012.


How do I configure it to display the moodle page when I type in the IP address or domain instead of PHP info?

Average of ratings: -
In reply to Paul Ross

Re: Trying to access Moodle, just redirects to "local host"

by Paul Ross -

Moodle version 3.3.2

IIS Version 8.5

In reply to Paul Ross

Re: Trying to access Moodle, just redirects to "local host"

by Paul Ross -

I'm replying to bump this post, I could really use some help if someone could offer it.

Thanks guys!

In reply to Paul Ross

Re: Trying to access Moodle, just redirects to "local host"

by Dave Balch -
Hi Paul,

Have you set $CFG->wwwroot to your IP or domain?
This page might be helpful: https://docs.moodle.org/33/en/Configuration_file

HTH,
Dave.
In reply to Dave Balch

Re: Trying to access Moodle, just redirects to "local host"

by Paul Ross -

I think so.


<?php  // Moodle configuration file


unset($CFG);

global $CFG;

$CFG = new stdClass();


$CFG->dbtype    = 'mariadb';

$CFG->dblibrary = 'native';

$CFG->dbhost    = 'localhost';

$CFG->dbname    = 'moodle';

$CFG->dbuser    = 'username';

$CFG->dbpass    = 'password';

$CFG->prefix    = 'mdl_';

$CFG->dboptions = array (

  'dbpersist' => 0,

  'dbport' => '',

  'dbsocket' => '',

  'dbcollation' => 'utf8_general_ci',

);


//$CFG->wwwroot   = 'http://localhost/moodle';

//Changed by Paul

$CFG->wwwroot   = 'http://moodle.server.edu';


$CFG->dataroot  = 'C:\\inetpub\\moodledata';

$CFG->admin     = 'admin';


$CFG->directorypermissions = 0777;


require_once(__DIR__ . '/lib/setup.php');


// There is no php closing tag in this file,

// it is intentional because it prevents trailing whitespace problems!


In reply to Paul Ross

Re: Trying to access Moodle, just redirects to "local host"

by Dave Balch -

In that case, I guess it would be a problem in your IIS setup, where it doesn't know to use that Moodle install for that domain.

In reply to Dave Balch

Re: Trying to access Moodle, just redirects to "local host"

by Paul Ross -

You were right.

I went into IIS Manager (for IIS 8.5),

Sites > right clicked on the website and chose "Manage Website" > "Advanced Settings".

From there, I changed the physical path to point to c:\inetpub\wwwroot\moodle

That did the trick!


Thanks for your help Dave!


solved