Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on How to protect the git respository for a public_html folder on a Linux server?
Parent
How to protect the git respository for a public_html folder on a Linux server?
+2
−0
On a Linux server, if you leave the .git folder unprotected in the public_html folder, its possible that someone could download the folder and then gain access to your files.
There are two ways I have seen of preventing this,
- Move it up one level and then in the .gitignore ignore all folders except the public_html.
- Deny access in the .htaccess.
Is there a better way of protecting the .git folder?
Post
+4
−0
The best practice here is, Don't deploy your .git
folder to your web server. Then there's nothing to protect.
0 comment threads