• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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