Put the system files in a directory with no public access
Example
DocumentRoot is set to /var/www/site/public_html/
So just put the system files in any other directory that is not public. Example /var/www/site/app/
So within that directory would look something like this
/var/www/site/app/core/
/var/www/site/app/libs/
/var/www/site/app/vendor/
In the /var/www/site/public_html/
directory, obviously you have index.php.
In the index.php file simply include the system files by doing the directory indentation.
Example: include __DIR__.'/../app/Core/Core.php';
.
Log files can be moved to another location
Instead of /var/www/site/app/logs
, I suggest /var/www/site/logs/
.
One reason is that when you need to back up the app
folder, you do not have to worry about skipping log files or other unnecessary log files.