Windows server: page goes to 127.0.0.1 after login

Windows server: page goes to 127.0.0.1 after login

by phil robinson -
Number of replies: 19
Hello, we are new to Moodle. The server install went well, but after attempting to login from a workstation it goes to 127.0.0.1. We changed 127.0.0.1 in our config.php file inside the moodle directory to resolve the first problem of not being able to access the Moodle page from a workstation. We can now access the initial login page, but not sure why, after entering the login information, the site goes back to 127.0.0.1. Any help would be appreciated. Thanks.
Average of ratings: -
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Nigel Irwin -

Phil

127.0.0.1 is a TCP loop back test IP that all machines have. If you want other machines on the network to access your moodle server you will need to place the IP addrfess of your seerver in config.php. You can find the IP address of your server by running ipconfig from a command prompt on your server

In reply to Nigel Irwin

Re: Windows server: page goes to 127.0.0.1 after login

by phil robinson -
Nigel,

Thanks for the response. We already went into the config.php and replaced that address with our server address. However, after attempting to login everything defaults back to http://127.0.0.1.
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Mark Tuck -

Have you restarted the web server (iis,apache)

In reply to Mark Tuck

Re: Windows server: page goes to 127.0.0.1 after login

by phil robinson -
Mark,

Thanks for the response. Just for good measure I restarted the server and still no luck. The config.php is inside the moodle directory, correct ?
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by phil robinson -
from the webpage http://xx.xx.xx.xx (our server IP address) the page is accessible. There are 2 spaces to enter the username and password. If I hover the mouse over the "login" link it points to http://127.0.0.1/login/index.php
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
How have you set up your server and which Moodle package did you install?
In reply to Jon Witts

Re: Windows server: page goes to 127.0.0.1 after login

by phil robinson -
Jon,

I installed the "MoodleWindowsInstaller-latest" for the last package. Its a Windows 2003 server and I basically just did the 'click' and 'next' installation. Thanks.
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Ah! And there in lies your problem!

I would not recommend the WindowsCompleteInstaller for a server; you will get far better performance if you configure each element manually (Web server, PHP and Database) than use this installer version.

Anyway that said; the reason why your change to config.php does not appear to taking effect will be the same reason why people do not see changes to their themes taking effect in this installer version of Moodle.

Please see this doc article for the workaround: Themes_FAQ#How_can_I_see_theme_changes_when_using_the_Windows_Complete_Installer_package

Jon
In reply to Jon Witts

Re: Windows server: page goes to 127.0.0.1 after login

by phil robinson -
Jon,

Thanks for the suggestion. I did as instructed per your link, but no difference was made. Also, I thought it said the WindowsCompleteInstaller "but it is not recommended that it be used as a production site" ? Fortunately, we have no data on this server and can uninstall then reinstall if necessary.
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Noveck Gowandan -
Check your $CFG->wwwroot setting in config.php

ensure that it is not set to 'http://localhost'; or
'http://127.0.0.1'

instead, set it to either the server's name (as in DNS) or IP.

eg.

$CFG->wwwroot = 'http://192.168.x.x'; (will work internally only)
or


$CFG->wwwroot = 'http://yourdomain.com';
In reply to Noveck Gowandan

Re: Windows server: page goes to 127.0.0.1 after login

by phil robinson -
Noveck,

This is a blip of what is in the file

$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'root';
$CFG->dbpass = 'xxxxxxxxxxx';
$CFG->ddpersist = false;
$CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://192.168.x.x';
$CFG->dirroot = 'DrLetter:\Moodle\server\moodle
$CFG->dataroot = 'DrLetter:\Moodle\server\moodle/data


The problem still exists. We have restarted the server, but not sure where the problem resides. Thanks.
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Noveck Gowandan -
In your httpd.conf (not sure where this would reside - not a windows moodle user)

look for the ServerName configuration, ensure that it is set to the server IP defined in config.php
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Luis de Vasconcelos -

It looks like your $CFG->dataroot path is wrong. The forward slash between the moodle and data folders should be a back slash.

It should be:
$CFG->dataroot = 'DrLetter:\Moodle\server\moodle\data
not:
$CFG->dataroot = 'DrLetter:\Moodle\server\moodle/data

But having your dataroot folder in your Moodle installation path is a security risk. It makes your dataroot folder directly accessible via the web and opens you up to attack.

http://docs.moodle.org/en/Creating_Moodle_site_data_directory
http://docs.moodle.org/en/Creating_Moodle_site_data_directory/Data_directory

In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Nigel Irwin -

I'm wondering if it could be the settings in the server. I set mine as follows in httpd.conf

ServerName moodle.rewards-trc.co.uk:80

you could substitute the IP address fro the server if you are only having internal access

In reply to Nigel Irwin

Re: Windows server: page goes to 127.0.0.1 after login

by phil robinson -
Nigel, from the first page, if you hover your mouse over the "login" link what address does it show ? Ours shows http://127.0.0.1/login/index.php
In reply to phil robinson

Re: Windows server: page goes to 127.0.0.1 after login

by Edwin Acuna -
Hi Phil,

I'm having the same problem, after editing the config.php, it seems that the new settings is not taking effect. I'm also using the windows package of moodle.

So far, I have no luck....

Thanks
Edwin

In reply to phil robinson

回复: page goes to 127.0.0.1 after login

by Jie Liang -

You can try to delete the folder [tmp] under {installDir}/server, and restart XAMPP.

good luck!