Placing Config file outside for security reasons

Placing Config file outside for security reasons

by Mohan V -
Number of replies: 3

Hi guys

For security reasons I would like to place the the Config  file outside the HTDOCS folder .

I tested it on testing server and it seems to work. but I am not sure whether it will have any side effects.

I created a file called db.php with all the info from config.php  and  placed it out side htdocs (e.g. C:/ program files / apache software  foundation /apache 2.2 /private

Then I edited the file Config .php with the path to the file created above and place it inside moodle folder

<?php  /// Moodle Configuration File

 require_once 'c:\Program Files\Apache Software Foundation\Apache2.2\private\db.php';

?>

Please can someone suggest me a correct way of pacing Config file outside the public folder

Thank you in advance

Mo

 

 

 htdocs/moodle/config.php

 

Average of ratings: -
In reply to Mohan V

Re: Placing Config file outside for security reasons

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What security reasons? Seems like a strange thing to do. Just make sure you have sensible database username and password that are only used for the Moodle site.
In reply to Howard Miller

Re: Placing Config file outside for security reasons

by Mohan V -

Hi Howard

Thanks for your help.

Please refer to the image for the permissions that I have set for the database user ABC.  Please can you tell me if the permissions that I have set for the user is correct.

This user account ABC is  different from the root user (root user has all the permissions).

many thanks

Attachment data.jpg