1 # This is example configuration of a virtualhost running Girocco, as set up
2 # at repo.or.cz; unfortunately, completely independent from Girocco::Config.
3 # It is not essential for Girocco to use a special virtualhost, however.
7 ServerAlias www.repo.or.cz
8 ServerAdmin admin@repo.or.cz
10 ErrorLog /var/log/apache2/repo-error.log
11 CustomLog /var/log/apache2/repo-access.log combined
13 AddHandler cgi-script .cgi
15 DocumentRoot /home/repo/WWW
16 <Directory /home/repo/WWW>
17 Options Indexes FollowSymLinks MultiViews ExecCGI
21 DirectoryIndex gitweb.cgi
25 ScriptAlias /w /home/repo/WWW/gitweb.cgi
26 ScriptAlias /h /home/repo/WWW/html.cgi
29 Options FollowSymLinks
36 <Directory /home/repo/repomgr/bin>
41 <Files git-http-backend-verify>
47 SetEnv GIT_PROJECT_ROOT /srv/git
48 SetEnv GIT_HTTP_EXPORT_ALL 1
50 # By default non-smart HTTP fetch access will be allowed, however
51 # by defining SmartHTTPOnly (or changing the sense of the IfDefine tests)
52 # non-smart HTTP requests can be denied directly by the web server
54 <IfDefine !SmartHTTPOnly>
55 # These accelerate non-smart HTTP access to loose objects and packs
56 AliasMatch ^/r/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /srv/git/$1
57 AliasMatch ^/r/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/git/$1
60 <IfDefine SmartHTTPOnly>
61 # Disable non-smart HTTP access
63 RewriteCond %{REQUEST_METHOD} !^POST$
64 RewriteRule ^/r/.*(?<!/info/refs)$ - [F]
65 RewriteCond %{QUERY_STRING} !(^|&)service=git-(upload|receive)-pack(&|$)
66 RewriteRule ^/r/.*/info/refs$ - [F]
69 # SetEnv GIT_HTTP_BACKEND_BIN to override Config.pm $git_http_backend_bin
70 ScriptAlias /r/ /home/repo/repomgr/bin/git-http-backend-verify/
75 # This comments out the following so this file can be used as-is
76 <IfDefine DummyThatIsNotDefined>
79 # This is example configuration of an https virtualhost running Girocco, as set
80 # up at repo.or.cz; unfortunately, completely independent from Girocco::Config.
81 # It is not essential for Girocco to use a special virtualhost, however.
82 # The Config.pm $httpspushurl variable needs to be defined to properly enable
86 # These certificate files will all be automatically generated, but the
87 # paths here may need to be corrected to match the paths
88 # (especially $certsdir) from Config.pm
90 SSLCertificateFile /home/repo/certs/girocco_www_crt.pem
91 SSLCertificateKeyFile /home/repo/certs/girocco_www_key.pem
92 SSLCertificateChainFile /home/repo/certs/girocco_www_chain.pem
93 # when using a paid www server cert, only the above three lines should
94 # be changed. Changing any of the below two lines (other than updating
95 # the paths to match $certsdir) will likely break https client auth
96 SSLCACertificateFile /home/repo/certs/girocco_root_crt.pem
97 SSLCADNRequestFile /home/repo/certs/girocco_client_crt.pem
100 SSLOptions +FakeBasicAuth +StrictRequire
106 # This configuration allows fetching over https without a certificate
107 # while always requiring a certificate for pushing over https
109 SSLVerifyClient optional
110 RewriteCond %{QUERY_STRING} (^|&)service=git-receive-pack(&|$)
111 RewriteRule ^/r/.*/info/refs$ - [env=client_auth_required:1]
112 RewriteRule ^/r/.*/git-receive-pack$ - [env=client_auth_required:1]
113 RewriteCond %{ENV:client_auth_required} 1
114 RewriteCond %{SSL:SSL_CLIENT_VERIFY} !^SUCCESS$
115 RewriteRule .* %{REQUEST_URI} [R=401]
118 Deny from env=client_auth_required
119 SSLOptions +FakeBasicAuth
120 AuthName "Git Client Authentication"
122 AuthBasicProvider anon
130 # ALL the entire contents from the <VirtualHost *:80> section at
131 # the top of this file must be copied here.
133 # To avoid this duplication, the contents of the <VirtualHost *:80>
134 # section above can be moved to a separate file and then included
135 # both here and in the <VirtualHost *:80> section using an Include
136 # directive. Be careful not to place the new include file in one of the
137 # directories the standard apache configuration blindly includes all