Skip to content

Instantly share code, notes, and snippets.

@int128
Created January 17, 2013 00:54
Show Gist options
  • Save int128/4552544 to your computer and use it in GitHub Desktop.
Save int128/4552544 to your computer and use it in GitHub Desktop.
Apache configuration for Git backend
#!/bin/sh
export GIT_PROJECT_ROOT=/home/git/repositories
export GIT_HTTP_EXPORT_ALL=1
exec /usr/libexec/git-core/git-http-backend
<VirtualHost *:443>
SSLEngine on
ServerName git.hidetake.org
SuexecUserGroup git git
DocumentRoot /var/www/git
<Location />
Authname "git"
Include "/etc/httpd/conf.d/my.conf.auth"
Require user someone
</Location>
# Enable gitweb.
<Directory /var/www/git>
Require all granted
Options +ExecCGI
AddHandler cgi-script cgi
DirectoryIndex gitweb.cgi
</Directory>
# Enable git-http-backend.
RewriteEngine on
RewriteRule ^/.*\.git/.*$ %{DOCUMENT_ROOT}/git-http-backend-wrapper.cgi%{REQUEST_URI}
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment