summaryrefslogtreecommitdiff
path: root/t/lib-httpd/apache.conf
blob: 3a03e8263db7e1c632bf0552ec94ae6834de4bf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
ServerName dummy
PidFile httpd.pid
DocumentRoot www
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog access.log common
ErrorLog error.log
<IfModule !mod_log_config.c>
	LoadModule log_config_module modules/mod_log_config.so
</IfModule>
<IfModule !mod_alias.c>
	LoadModule alias_module modules/mod_alias.so
</IfModule>
<IfModule !mod_cgi.c>
	LoadModule cgi_module modules/mod_cgi.so
</IfModule>
<IfModule !mod_env.c>
	LoadModule env_module modules/mod_env.so
</IfModule>
<IfModule !mod_rewrite.c>
	LoadModule rewrite_module modules/mod_rewrite.so
</IFModule>
<IfModule !mod_version.c>
	LoadModule version_module modules/mod_version.so
</IfModule>
<IfModule !mod_headers.c>
	LoadModule headers_module modules/mod_headers.so
</IfModule>

<IfVersion < 2.4>
LockFile accept.lock
</IfVersion>

<IfVersion < 2.1>
<IfModule !mod_auth.c>
	LoadModule auth_module modules/mod_auth.so
</IfModule>
</IfVersion>

<IfVersion >= 2.1>
<IfModule !mod_auth_basic.c>
	LoadModule auth_basic_module modules/mod_auth_basic.so
</IfModule>
<IfModule !mod_authn_file.c>
	LoadModule authn_file_module modules/mod_authn_file.so
</IfModule>
<IfModule !mod_authz_user.c>
	LoadModule authz_user_module modules/mod_authz_user.so
</IfModule>
<IfModule !mod_authz_host.c>
	LoadModule authz_host_module modules/mod_authz_host.so
</IfModule>
</IfVersion>

<IfVersion >= 2.4>
<IfModule !mod_authn_core.c>
	LoadModule authn_core_module modules/mod_authn_core.so
</IfModule>
<IfModule !mod_authz_core.c>
	LoadModule authz_core_module modules/mod_authz_core.so
</IfModule>
<IfModule !mod_access_compat.c>
	LoadModule access_compat_module modules/mod_access_compat.so
</IfModule>
<IfModule !mod_mpm_prefork.c>
	LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
</IfModule>
</IfVersion>

PassEnv GIT_VALGRIND
PassEnv GIT_VALGRIND_OPTIONS

Alias /dumb/ www/
Alias /auth/dumb/ www/auth/dumb/

<LocationMatch /smart/>
	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
	SetEnv GIT_HTTP_EXPORT_ALL
</LocationMatch>
<LocationMatch /smart_noexport/>
	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
</LocationMatch>
<LocationMatch /smart_custom_env/>
	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
	SetEnv GIT_HTTP_EXPORT_ALL
	SetEnv GIT_COMMITTER_NAME "Custom User"
	SetEnv GIT_COMMITTER_EMAIL custom@example.com
</LocationMatch>
<LocationMatch /smart_namespace/>
	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
	SetEnv GIT_HTTP_EXPORT_ALL
	SetEnv GIT_NAMESPACE ns
</LocationMatch>
<LocationMatch /smart_cookies/>
	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
	SetEnv GIT_HTTP_EXPORT_ALL
	Header set Set-Cookie name=value
</LocationMatch>
ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
ScriptAlias /broken_smart/ broken-smart-http.sh/
<Directory ${GIT_EXEC_PATH}>
	Options FollowSymlinks
</Directory>
<Files broken-smart-http.sh>
	Options ExecCGI
</Files>
<Files ${GIT_EXEC_PATH}/git-http-backend>
	Options ExecCGI
</Files>

RewriteEngine on
RewriteRule ^/smart-redir-perm/(.*)$ /smart/$1 [R=301]
RewriteRule ^/smart-redir-temp/(.*)$ /smart/$1 [R=302]
RewriteRule ^/smart-redir-auth/(.*)$ /auth/smart/$1 [R=301]
RewriteRule ^/smart-redir-limited/(.*)/info/refs$ /smart/$1/info/refs [R=301]

<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so

SSLCertificateFile httpd.pem
SSLCertificateKeyFile httpd.pem
SSLRandomSeed startup file:/dev/urandom 512
SSLRandomSeed connect file:/dev/urandom 512
SSLSessionCache none
SSLMutex file:ssl_mutex
SSLEngine On
</IfDefine>

<Location /auth/>
	AuthType Basic
	AuthName "git-auth"
	AuthUserFile passwd
	Require valid-user
</Location>

<LocationMatch "^/auth-push/.*/git-receive-pack$">
	AuthType Basic
	AuthName "git-auth"
	AuthUserFile passwd
	Require valid-user
</LocationMatch>

<LocationMatch "^/auth-fetch/.*/git-upload-pack$">
	AuthType Basic
	AuthName "git-auth"
	AuthUserFile passwd
	Require valid-user
</LocationMatch>

RewriteCond %{QUERY_STRING} service=git-receive-pack [OR]
RewriteCond %{REQUEST_URI} /git-receive-pack$
RewriteRule ^/half-auth-complete/ - [E=AUTHREQUIRED:yes]

<Location /half-auth-complete/>
  Order Deny,Allow
  Deny from env=AUTHREQUIRED

  AuthType Basic
  AuthName "Git Access"
  AuthUserFile passwd
  Require valid-user
  Satisfy Any
</Location>

<IfDefine DAV>
	LoadModule dav_module modules/mod_dav.so
	LoadModule dav_fs_module modules/mod_dav_fs.so

	DAVLockDB DAVLock
	<Location /dumb/>
		Dav on
	</Location>
	<Location /auth/dumb>
		Dav on
	</Location>
</IfDefine>

<IfDefine SVN>
	LoadModule dav_svn_module modules/mod_dav_svn.so

	<Location /svn>
		DAV svn
		SVNPath svnrepo
	</Location>
</IfDefine>