Created
February 18, 2016 04:19
-
-
Save zestime/250bc083bcefbfec54de to your computer and use it in GitHub Desktop.
Apache configuration for Git server - Smart HTTP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SetEnv GIT_PROJECT_ROOT /opt/git | |
SetEnv GIT_HTTP_EXPORT_ALL | |
ScriptAlias /git/ /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-http-backend/ | |
RewriteEngine On | |
RewriteCond %{QUERY_STRING} service=git-receive-pack [OR] | |
RewriteCond %{REQUEST_URI} /git-receive-pack$ | |
RewriteRule ^/git/ - [E=AUTHREQUIRED] | |
<Files "git-http-backend"> | |
AuthType Basic | |
AuthName "Git Access" | |
AuthUserFile /opt/git/.htpasswd | |
Require valid-user | |
Order deny,allow | |
Deny from env=AUTHREQUIRED | |
Satisfy any | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment