• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

How to prevent apache from serving the .git directory?

xxx

Basic Pleskian
Hello together.
I'm running Plesk 12.5 Update 10 on a Ubuntu 14 machine. We startet to offer all users to use git as version control system. It works finde.
But, I can access directly into directories and files that start with a full stop - so also into .git directories. I have to prevent apache from serving all files and directories which starts with a full stop. I will do it by a global configuration. But I have no idea which file I have to modify so each existing and new webhosting gets the rule.
Can somebody point me to the right file, please?
Thanks a lot in advance!
 
Hi xxx,
what about adding something like...

Plesk > Subscriptions > domain.tld > Apache & nginx Settings > Additional directives for HTTP & in HTTPS

Code:
<Files .git>
     Require all denied
</Files>

And

Code:
<Directory "/var/www/vhosts/domain.tld/httpdocs/.git">
     Require all denied
</Directory>

Hope it helps
Regards

Lloyd
 
Thank you, Lloyd.
But, as I wrote, I look for a solution for ALL files and directories which starts with a full stop. And, a solution for ALL hostings. Without individual settings for each domain. And settings, wich are also set for upcomming hostings.
Do you have an idea how and where to set up the rules for this topic?
Thanks!
 
Back
Top