Don’t serve .git folder on Apache2

Add this to /etc/apache2/apache2.conf:

# do not serve .git folders by default
<DirectoryMatch "^/.*/\.git/">
    Require all denied

( Apache 2.4 – Ubuntu 18.04.1 LTS )

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.