3.1.6.: Calling my moodlesite via IP-address doesn't work :Fatal error: $CFG->dataroot ..

Re: 3.1.6.: Calling my moodlesite via IP-address doesn't work :Fatal error: $CFG->dataroot ..

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

The dataroot setting is nothing to do with your redirect. Or it's highly unlikely. 

Usually that error is true.  I'm not sure why you are trying to set the sticky bit. I would chmod to 0777 - don't forget to set the permission for all the subdirectories recursively. 

In reply to Howard Miller

Re: 3.1.6.: Calling my moodlesite via IP-address doesn't work :Fatal error: $CFG->dataroot ..

by Monica Franz -
The permissions are set to default mode, which seems to be correct.

The problem seems to be the Rewritecond in the htaccess-file to set https for the Ip-address. It always changes to the http protocol, and that doesn't match the moodle config.

But using the https-protokoll with the Ip-address, opens my error document, but I want my moodle website to be opend using the Ip-address, so I can continue maintenance work with out other users 'messing' around.


In reply to Monica Franz

Re: 3.1.6.: Calling my moodlesite via IP-address doesn't work :Fatal error: $CFG->dataroot ..

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

I've thought about it but I can see no scenario where a rewrite condition would result in that 'cannot access moodledata' error being displayed. 

Moodle is getting executed in order for the error to be displayed. I tend to take these things on face value. If moodle says it cannot access that file area then it probably can't. Apache settings would be the last place I would look.

Other than that I have no idea... anybody else?

In reply to Howard Miller

Re: 3.1.6.: Calling my moodlesite via IP-address doesn't work :Fatal error: $CFG->dataroot ..

by Monica Franz -
I tried to fix this problem with Apache, but get the same fatal error as with htaccess!

The part of Apache SSL conf for the Documentroot call looks like this

<VirtualHost _default_:80>
 ServerName myservername
 Redirect / https://mymoodlewebsite.mydomain/

</VirtualHost>

NameVirtualHost *:443
...

<IfModule mod_ssl.c>
<VirtualHost *:443>
  ...
   
      ServerName myservername

RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^myipaddress
RewriteRule /index.php http://myerrordocument.mydomain
RewriteRule ^myipaddress  https:\/\/myipaddress

DocumentRoot /mymoodledirectory

....

I have no idea what I could do. I tried other conditions (HTTPS, REMOTE_ADDR,HTTP_HOST) as well, with the same result.

How do others use a maintenance page, so the admin can still do her maintenace work on the moodle site  at the same time?

Cheers,
Monica