500 error with new install

500 error with new install

by James Newson -
Number of replies: 2

  • Server Operating System name (version also if possible):  Centos 7 vm
  • PHP version: 7.1.14
  • Database server type and version: MariaDB 10.2.14
  • Moodle version: 3.4
  • Moodle install type? (New/Upgrade): New 
  • Moodle config.php attached (please remove passwords): Yes

I'm in the process of setting up a new moodle install but I'm getting a 500 error when I attempt to access from a remote machines browser.

I've run the following the commands to try to ensure the permissions are correct

sudo chown -R root:root /var/www/html/moodle

sudo chown -R apache:apache /var/moodledata

sudo chmod -R 755 /var/moodledata 

sudo systemctl restart httpd.service


I'm at a loss as to where to look to troubleshoot further.

Any pointers would be gratefully received.

Thanks




Average of ratings: -
In reply to James Newson

Re: 500 error with new install

by Ken Task -
Picture of Particularly helpful Moodlers

CentOS typically has SELinux installed and running in enforcing mode.

What does sestatus say?

All browsers must be able to at least 'read' the moodle code directory and config.php.  So files in moodle code could be owned by root and group, but if permissions on those directories/files do NOT allow 'others' to at least read ... no access is granted.

Have rewrite turned on?   Appears any access to server is being redirected to it's root ... meaning access to /moodle/ where code resides gets re-directed to /.

Check the apache error logs which are typically located in /var/log/httpd/

'spirit of sharing', Ken



In reply to Ken Task

Re: 500 error with new install

by James Newson -

Thanks for the pointers Ken

/sbin/restorecon -R /var/www/ helped and gave me this error; 

cache/Unable to load the cache configuration file

which I was able to fix with a reboot