| 1 | ServerName dummy |
| 2 | PidFile httpd.pid |
| 3 | DocumentRoot www |
| 4 | LogFormat "%h %l %u %t \"%r\" %>s %b" common |
| 5 | CustomLog access.log common |
| 6 | ErrorLog error.log |
| 7 | Timeout 600 |
| 8 | <IfModule !mod_log_config.c> |
| 9 | LoadModule log_config_module modules/mod_log_config.so |
| 10 | </IfModule> |
| 11 | <IfModule !mod_alias.c> |
| 12 | LoadModule alias_module modules/mod_alias.so |
| 13 | </IfModule> |
| 14 | <IfModule !mod_cgi.c> |
| 15 | LoadModule cgi_module modules/mod_cgi.so |
| 16 | </IfModule> |
| 17 | <IfModule !mod_env.c> |
| 18 | LoadModule env_module modules/mod_env.so |
| 19 | </IfModule> |
| 20 | <IfModule !mod_rewrite.c> |
| 21 | LoadModule rewrite_module modules/mod_rewrite.so |
| 22 | </IFModule> |
| 23 | <IfModule !mod_version.c> |
| 24 | LoadModule version_module modules/mod_version.so |
| 25 | </IfModule> |
| 26 | <IfModule !mod_headers.c> |
| 27 | LoadModule headers_module modules/mod_headers.so |
| 28 | </IfModule> |
| 29 | <IfModule !mod_setenvif.c> |
| 30 | LoadModule setenvif_module modules/mod_setenvif.so |
| 31 | </IfModule> |
| 32 | |
| 33 | <IfDefine HTTP2> |
| 34 | LoadModule http2_module modules/mod_http2.so |
| 35 | Protocols h2 h2c |
| 36 | </IfDefine> |
| 37 | |
| 38 | <IfModule !mod_auth_basic.c> |
| 39 | LoadModule auth_basic_module modules/mod_auth_basic.so |
| 40 | </IfModule> |
| 41 | <IfModule !mod_authn_file.c> |
| 42 | LoadModule authn_file_module modules/mod_authn_file.so |
| 43 | </IfModule> |
| 44 | <IfModule !mod_authz_user.c> |
| 45 | LoadModule authz_user_module modules/mod_authz_user.so |
| 46 | </IfModule> |
| 47 | <IfModule !mod_authz_host.c> |
| 48 | LoadModule authz_host_module modules/mod_authz_host.so |
| 49 | </IfModule> |
| 50 | |
| 51 | <IfDefine PROXY> |
| 52 | <IfModule !mod_proxy.c> |
| 53 | LoadModule proxy_module modules/mod_proxy.so |
| 54 | </IfModule> |
| 55 | <IfModule !mod_proxy_http.c> |
| 56 | LoadModule proxy_http_module modules/mod_proxy_http.so |
| 57 | </IfModule> |
| 58 | ProxyRequests On |
| 59 | <Proxy "*"> |
| 60 | AuthType Basic |
| 61 | AuthName "proxy-auth" |
| 62 | AuthUserFile proxy-passwd |
| 63 | Require valid-user |
| 64 | </Proxy> |
| 65 | </IfDefine> |
| 66 | |
| 67 | <IfModule !mod_authn_core.c> |
| 68 | LoadModule authn_core_module modules/mod_authn_core.so |
| 69 | </IfModule> |
| 70 | <IfModule !mod_authz_core.c> |
| 71 | LoadModule authz_core_module modules/mod_authz_core.so |
| 72 | </IfModule> |
| 73 | <IfModule !mod_access_compat.c> |
| 74 | LoadModule access_compat_module modules/mod_access_compat.so |
| 75 | </IfModule> |
| 76 | <IfModule !mod_unixd.c> |
| 77 | LoadModule unixd_module modules/mod_unixd.so |
| 78 | </IfModule> |
| 79 | |
| 80 | <IfDefine HTTP2> |
| 81 | <IfModule !mod_mpm_event.c> |
| 82 | LoadModule mpm_event_module modules/mod_mpm_event.so |
| 83 | </IfModule> |
| 84 | </IfDefine> |
| 85 | <IfDefine !HTTP2> |
| 86 | <IfModule !mod_mpm_prefork.c> |
| 87 | LoadModule mpm_prefork_module modules/mod_mpm_prefork.so |
| 88 | </IfModule> |
| 89 | </IfDefine> |
| 90 | |
| 91 | PassEnv GIT_VALGRIND |
| 92 | PassEnv GIT_VALGRIND_OPTIONS |
| 93 | PassEnv GNUPGHOME |
| 94 | PassEnv ASAN_OPTIONS |
| 95 | PassEnv LSAN_OPTIONS |
| 96 | PassEnv UBSAN_OPTIONS |
| 97 | PassEnv GIT_TRACE |
| 98 | PassEnv GIT_CONFIG_NOSYSTEM |
| 99 | PassEnv GIT_TEST_SIDEBAND_ALL |
| 100 | PassEnv LANG |
| 101 | PassEnv LC_ALL |
| 102 | |
| 103 | Alias /dumb/ www/ |
| 104 | Alias /auth/dumb/ www/auth/dumb/ |
| 105 | |
| 106 | SetEnv PERL_PATH ${PERL_PATH} |
| 107 | |
| 108 | <LocationMatch /smart/> |
| 109 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 110 | SetEnv GIT_HTTP_EXPORT_ALL |
| 111 | </LocationMatch> |
| 112 | <LocationMatch /smart_noexport/> |
| 113 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 114 | </LocationMatch> |
| 115 | <LocationMatch /smart_custom_env/> |
| 116 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 117 | SetEnv GIT_HTTP_EXPORT_ALL |
| 118 | SetEnv GIT_COMMITTER_NAME "Custom User" |
| 119 | SetEnv GIT_COMMITTER_EMAIL custom@example.com |
| 120 | </LocationMatch> |
| 121 | <LocationMatch /smart_namespace/> |
| 122 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 123 | SetEnv GIT_HTTP_EXPORT_ALL |
| 124 | SetEnv GIT_NAMESPACE ns |
| 125 | </LocationMatch> |
| 126 | <LocationMatch /smart_cookies/> |
| 127 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 128 | SetEnv GIT_HTTP_EXPORT_ALL |
| 129 | Header set Set-Cookie name=value |
| 130 | </LocationMatch> |
| 131 | <LocationMatch /smart_headers/> |
| 132 | <RequireAll> |
| 133 | Require expr %{HTTP:x-magic-one} == 'abra' |
| 134 | Require expr %{HTTP:x-magic-two} == 'cadabra' |
| 135 | </RequireAll> |
| 136 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 137 | SetEnv GIT_HTTP_EXPORT_ALL |
| 138 | </LocationMatch> |
| 139 | <LocationMatch /one_time_script/> |
| 140 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 141 | SetEnv GIT_HTTP_EXPORT_ALL |
| 142 | </LocationMatch> |
| 143 | <LocationMatch /http_429/> |
| 144 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 145 | SetEnv GIT_HTTP_EXPORT_ALL |
| 146 | </LocationMatch> |
| 147 | <LocationMatch /smart_v0/> |
| 148 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 149 | SetEnv GIT_HTTP_EXPORT_ALL |
| 150 | SetEnv GIT_PROTOCOL |
| 151 | </LocationMatch> |
| 152 | <LocationMatch /custom_auth/> |
| 153 | SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} |
| 154 | SetEnv GIT_HTTP_EXPORT_ALL |
| 155 | <IfDefine USE_CGIPASSAUTH> |
| 156 | CGIPassAuth on |
| 157 | </IfDefine> |
| 158 | </LocationMatch> |
| 159 | ScriptAlias /smart/incomplete_length/git-upload-pack incomplete-length-upload-pack-v2-http.sh/ |
| 160 | ScriptAlias /smart/incomplete_body/git-upload-pack incomplete-body-upload-pack-v2-http.sh/ |
| 161 | ScriptAlias /smart/no_report/git-receive-pack error-no-report.sh/ |
| 162 | ScriptAliasMatch /error_git_upload_pack/(.*)/git-upload-pack error.sh/ |
| 163 | ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1 |
| 164 | ScriptAlias /broken_smart/ broken-smart-http.sh/ |
| 165 | ScriptAlias /error_smart/ error-smart-http.sh/ |
| 166 | ScriptAlias /error/ error.sh/ |
| 167 | ScriptAliasMatch /one_time_script/(.*) apply-one-time-script.sh/$1 |
| 168 | ScriptAliasMatch /http_429/(.*) http-429.sh/$1 |
| 169 | ScriptAliasMatch /custom_auth/(.*) nph-custom-auth.sh/$1 |
| 170 | <Directory ${GIT_EXEC_PATH}> |
| 171 | Options FollowSymlinks |
| 172 | </Directory> |
| 173 | <Files incomplete-length-upload-pack-v2-http.sh> |
| 174 | Options ExecCGI |
| 175 | </Files> |
| 176 | <Files incomplete-body-upload-pack-v2-http.sh> |
| 177 | Options ExecCGI |
| 178 | </Files> |
| 179 | <Files error-no-report.sh> |
| 180 | Options ExecCGI |
| 181 | </Files> |
| 182 | <Files broken-smart-http.sh> |
| 183 | Options ExecCGI |
| 184 | </Files> |
| 185 | <Files error-smart-http.sh> |
| 186 | Options ExecCGI |
| 187 | </Files> |
| 188 | <Files error.sh> |
| 189 | Options ExecCGI |
| 190 | </Files> |
| 191 | <Files apply-one-time-script.sh> |
| 192 | Options ExecCGI |
| 193 | </Files> |
| 194 | <Files http-429.sh> |
| 195 | Options ExecCGI |
| 196 | </Files> |
| 197 | <Files ${GIT_EXEC_PATH}/git-http-backend> |
| 198 | Options ExecCGI |
| 199 | </Files> |
| 200 | |
| 201 | RewriteEngine on |
| 202 | RewriteRule ^/dumb-redir/(.*)$ /dumb/$1 [R=301] |
| 203 | RewriteRule ^/smart-redir-perm/(.*)$ /smart/$1 [R=301] |
| 204 | RewriteRule ^/smart-redir-temp/(.*)$ /smart/$1 [R=302] |
| 205 | RewriteRule ^/smart-redir-auth/(.*)$ /auth/smart/$1 [R=301] |
| 206 | RewriteRule ^/smart-redir-limited/(.*)/info/refs$ /smart/$1/info/refs [R=301] |
| 207 | RewriteRule ^/ftp-redir/(.*)$ ftp://localhost:1000/$1 [R=302] |
| 208 | |
| 209 | RewriteRule ^/loop-redir/x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-(.*) /$1 [R=302] |
| 210 | RewriteRule ^/loop-redir/(.*)$ /loop-redir/x-$1 [R=302] |
| 211 | |
| 212 | # redir-to/502/x?y -> really-redir-to?path=502/x&qs=y which returns 502 |
| 213 | # redir-to/x?y -> really-redir-to?path=x&qs=y -> x?y |
| 214 | RewriteCond %{QUERY_STRING} ^(.*)$ |
| 215 | RewriteRule ^/redir-to/(.*)$ /really-redir-to?path=$1&qs=%1 [R=302] |
| 216 | RewriteCond %{QUERY_STRING} ^path=502/(.*)&qs=(.*)$ |
| 217 | RewriteRule ^/really-redir-to$ - [R=502,L] |
| 218 | RewriteCond %{QUERY_STRING} ^path=(.*)&qs=(.*)$ |
| 219 | RewriteRule ^/really-redir-to$ /%1?%2 [R=302] |
| 220 | |
| 221 | # The first rule issues a client-side redirect to something |
| 222 | # that _doesn't_ look like a git repo. The second rule is a |
| 223 | # server-side rewrite, so that it turns out the odd-looking |
| 224 | # thing _is_ a git repo. The "[PT]" tells Apache to match |
| 225 | # the usual ScriptAlias rules for /smart. |
| 226 | RewriteRule ^/insane-redir/(.*)$ /intern-redir/$1/foo [R=301] |
| 227 | RewriteRule ^/intern-redir/(.*)/foo$ /smart/$1 [PT] |
| 228 | |
| 229 | # Serve info/refs internally without redirecting, but |
| 230 | # issue a redirect for any object requests. |
| 231 | RewriteRule ^/redir-objects/(.*/info/refs)$ /dumb/$1 [PT] |
| 232 | RewriteRule ^/redir-objects/(.*/objects/.*)$ /dumb/$1 [R=301] |
| 233 | |
| 234 | <IfDefine SSL> |
| 235 | LoadModule ssl_module modules/mod_ssl.so |
| 236 | |
| 237 | SSLCertificateFile httpd.pem |
| 238 | SSLCertificateKeyFile httpd.pem |
| 239 | SSLRandomSeed startup file:/dev/urandom 512 |
| 240 | SSLRandomSeed connect file:/dev/urandom 512 |
| 241 | SSLSessionCache none |
| 242 | SSLEngine On |
| 243 | </IfDefine> |
| 244 | |
| 245 | <Location /auth/> |
| 246 | AuthType Basic |
| 247 | AuthName "git-auth" |
| 248 | AuthUserFile passwd |
| 249 | Require valid-user |
| 250 | |
| 251 | # return 403 for authenticated user: forbidden-user@host |
| 252 | RewriteCond "%{REMOTE_USER}" "^forbidden-user@host" |
| 253 | RewriteRule ^ - [F] |
| 254 | </Location> |
| 255 | |
| 256 | <LocationMatch "^/auth-push/.*/git-receive-pack$"> |
| 257 | AuthType Basic |
| 258 | AuthName "git-auth" |
| 259 | AuthUserFile passwd |
| 260 | Require valid-user |
| 261 | </LocationMatch> |
| 262 | |
| 263 | <LocationMatch "^/auth-fetch/.*/git-upload-pack$"> |
| 264 | AuthType Basic |
| 265 | AuthName "git-auth" |
| 266 | AuthUserFile passwd |
| 267 | Require valid-user |
| 268 | </LocationMatch> |
| 269 | |
| 270 | RewriteCond %{QUERY_STRING} service=git-receive-pack [OR] |
| 271 | RewriteCond %{REQUEST_URI} /git-receive-pack$ |
| 272 | RewriteRule ^/half-auth-complete/ - [E=AUTHREQUIRED:yes] |
| 273 | |
| 274 | <Location /half-auth-complete/> |
| 275 | Order Deny,Allow |
| 276 | Deny from env=AUTHREQUIRED |
| 277 | |
| 278 | AuthType Basic |
| 279 | AuthName "Git Access" |
| 280 | AuthUserFile passwd |
| 281 | Require valid-user |
| 282 | Satisfy Any |
| 283 | </Location> |
| 284 | |
| 285 | <IfDefine DAV> |
| 286 | LoadModule dav_module modules/mod_dav.so |
| 287 | LoadModule dav_fs_module modules/mod_dav_fs.so |
| 288 | |
| 289 | DAVLockDB DAVLock |
| 290 | <Location /dumb/> |
| 291 | Dav on |
| 292 | </Location> |
| 293 | <Location /auth/dumb> |
| 294 | Dav on |
| 295 | </Location> |
| 296 | </IfDefine> |
| 297 | |
| 298 | <IfDefine SVN> |
| 299 | LoadModule dav_svn_module modules/mod_dav_svn.so |
| 300 | |
| 301 | <Location /${LIB_HTTPD_SVN}> |
| 302 | DAV svn |
| 303 | SVNPath "${LIB_HTTPD_SVNPATH}" |
| 304 | </Location> |
| 305 | </IfDefine> |