Secure PHP Configuration Settings for Moodle

Re: Secure PHP Configuration Settings for Moodle

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers

Ok, now we begin to learn how to fish as opposed to being fed fish! ;)

First, one needs to be cautious about what one might read in any forum ... and from any blog, etc.  And I include myself there.   Why?  I might be wrong cause I don't know your entire setup - network, other things running on server, work-arounds you might have figured out, etc..   So having said that, we begin 'advanced apache server config 301' (so to speak - a self-taught course).

I'll take one as an example:

LoadModule userdir_module modules/mod_userdir.so

If one googles for the above and checks out the official Apache docs on that mod one would see/discover it's used only when server admin is setting up user directories to be served by apache.   Those are directories like: /home/customerid/public_html/   There is reference to user directories in the main config file for apache.   On CentOS/RH family boxen that is normally commented out by default.

So: IF don't plan to setup user space in your apache?   Not configured in the main config file for apache?

Then comment out mod_userdir.so

IF, later, you find a need to do a user space config, just reverse the process for disabling, restart apache and then you can use 'user space'.

After doing all that ... check out Moodle ... everything you can think of that might relate ...  checks out OK?  OK, then done (or now).   Find any error ... check apache error logs for clues.   Think I'd have an ssh shell opened and watching realtime apache error logs when checking out stuff:

tail -f /var/log/httpd/error_log (on a typically configured RH family server)

Notice that you might be restarting apache often for a while so don't do this during prime time usage of your Moodle.

'spirit of sharing', Ken