File: httpd.conf.example

package info (click to toggle)
gforge 4.5.14-22etch13
  • links: PTS
  • area: main
  • in suites: etch
  • size: 13,004 kB
  • ctags: 11,918
  • sloc: php: 36,047; sql: 29,050; sh: 10,538; perl: 6,496; xml: 3,810; makefile: 341; python: 263; ansic: 256
file content (329 lines) | stat: -rw-r--r-- 9,234 bytes parent folder | download | duplicates (2)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
Listen 80
<Files .htaccess>
  order allow,deny
  deny from all
</Files>

<IfModule mod_ssl.c>
  Listen 443
</IfModule>

NameVirtualHost 10.GF.OR.GE:80
NameVirtualHost 10.GF.OR.GE:443
# This is magic for virtual hosting!
UseCanonicalName Off

<Directory ~ "/CVS/">
  ## block web access to CVS directories.
  deny from all
</Directory>
#
# Main host
#
<Directory /path/to/gforge/www>
  Options Indexes FollowSymlinks
  AllowOverride All
  order allow,deny
  allow from all
  php_admin_value include_path "/path/to/gforge/etc/custom:/etc/gforge:/path/to/gforge:/path/to/gforge/www/include:."
  php_admin_value default_charset "UTF-8"
  php_flag register_globals "On"
  ###
  ### safe PHP settings
  ##
  # report E_ALL errors
  php_admin_value error_reporting 2047

  # don't echo error to user
  php_admin_value display_errors 0

  # do log the errors in ErrorLog! why even ask?
  php_admin_value log_errors 1

  # don't report to syslog! apparently you can't undef error_log to force it to go to
  # apache's error_log. So make sure error_log isn't defined in php.ini (/etc/php4/apache/php.ini)
  ##php_admin_value error_log ''
</Directory>
# HTTP
<VirtualHost 10.GF.OR.GE:80>
	ServerName gforge.company.com
	ServerAlias www.gforge.company.com
	ServerAdmin webmaster@gforge.company.com
	DocumentRoot /path/to/gforge/www
	# Apache 1.3
	#User www-gforge
	#Group www-gforge
	# Apache 2 apache2-mpm-perchild
	#AssignUserID www-gforge www-gforge
	# Apache 2 but this is not the same
	#<IfModule mod_suexec.c>
	#	SuexecUserGroup www-gforge www-gforge
	#</IfModule>
	Alias /images/ /path/to/gforge/www/images/
	DirectoryIndex index.html index.php
	<IfModule mod_userdir.c>
		UserDir disabled
	</IfModule>

	php_admin_value default_charset "UTF-8"

	<Directory /path/to/gforge/www>
		Include   /etc/httpd.secrets
	</Directory>

	ScriptAliasMatch ^/plugins/([^/]*)/cgi-bin/(.*) /usr/lib/gforge/plugins/$1/cgi-bin/$2

	# Projects and Users script
	<Location /projects>
		ForceType application/x-httpd-php
	</Location>
	<Location /users>
		ForceType application/x-httpd-php
	</Location>

	# 404 Error document
	ErrorDocument 404 /404.php
	LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
	CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge

	# GForge without the DNS delegation
	# Project home pages are in a virtual /www/<group> location
#	AliasMatch ^/www/([^/]*)/(.*) /home/groups/$1/htdocs/$2
#	ScriptAliasMatch ^/([^/]*)/cgi-bin/(.*) /home/groups/$1/cgi-bin/$2
#	<Directory /home/groups>
#		Options Indexes FollowSymlinks
#		AllowOverride All
#		order allow,deny
#		allow from all
#	</Directory>

	# Ensure that we don't try to use SSL on SSL Servers
	<IfModule apache_ssl.c>
		SSLDisable
	</IfModule>
</VirtualHost>

# HTTPS
<VirtualHost 10.GF.OR.GE:443>
	ServerName gforge.company.com
	ServerAlias www.gforge.company.com
	ServerAdmin webmaster@gforge.company.com
	# Apache 1.3
	#User www-gforge
	#Group www-gforge
	# Apache 2 apache2-mpm-perchild
	#AssignUserID www-gforge www-gforge
	# Apache 2
	<IfModule mod_suexec.c>
		SuexecUserGroup www-gforge www-gforge
	</IfModule>
	DocumentRoot /path/to/gforge/www
	Alias /images/ /path/to/gforge/www/images/
	DirectoryIndex index.html index.php
	<IfModule mod_userdir.c>
		UserDir disabled
	</IfModule>

	php_admin_value default_charset "UTF-8"

	<Directory /path/to/gforge/www>
		Include   /etc/httpd.secrets
	</Directory>

	ScriptAliasMatch ^/plugins/([^/]*)/cgi-bin/(.*) /usr/lib/gforge/plugins/$1/cgi-bin/$2

	# Projects and Users script
	<Location /projects>
		ForceType application/x-httpd-php
	</Location>
	<Location /users>
		ForceType application/x-httpd-php
	</Location>

	# 404 Error document
	ErrorDocument 404 /404.php
	LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
	CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge

	<IfModule mod_ssl.c>
		SSLEngine on
		SSLCertificateFile /etc/apache/ssl.crt/server.crt
		SSLCertificateKeyFile /etc/apache/ssl.key/server.key
		<Files ~ "\.(cgi|shtml)$">
			SSLOptions +StdEnvVars
		</Files>
		<Directory "/usr/lib/cgi-bin">
			SSLOptions +StdEnvVars
		</Directory>
		SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
	</IfModule>

	<IfModule apache_ssl.c>
		SSLEnable
		SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
	</IfModule>
</VirtualHost>

#
# SCM host
#
<Directory /path/to/gforge/scm>
  Options Indexes FollowSymlinks
  AllowOverride All
  order allow,deny
  allow from all
  php_admin_value include_path "/path/to/gforge/etc/custom:/etc/gforge:/path/to/gforge:/path/to/gforge/www/include:."
  php_admin_value default_charset "UTF-8"
</Directory>

# SCM HTTP vhost
<VirtualHost 10.GF.OR.GE:80>
  ServerName cvs.gforge.company.com
  DocumentRoot /path/to/gforge/scm
  Alias /images/ /path/to/gforge/www/images/
  LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
  CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge
  # Ensure that we don't try to use SSL on SSL Servers
  <IfModule apache_ssl.c>
    SSLDisable
  </IfModule>
</VirtualHost>

# SCM HTTP SSL vhost
<VirtualHost 10.GF.OR.GE:443>
  ServerName cvs.gforge.company.com
  DocumentRoot /path/to/gforge/scm
  LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
  CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge

  <IfModule mod_ssl.c>
    SSLEngine on
    SSLCertificateFile /etc/apache/ssl.crt/server.crt
    SSLCertificateKeyFile /etc/apache/ssl.key/server.key
    <Files ~ "\.(cgi|shtml)$">
      SSLOptions +StdEnvVars
    </Files>
    <Directory "/usr/lib/cgi-bin">
      SSLOptions +StdEnvVars
    </Directory>
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
  </IfModule>

  <IfModule apache_ssl.c>
    SSLEnable
  </IfModule>

</VirtualHost>

#
# Download host
#
<VirtualHost 10.GF.OR.GE:80>
  ServerName download.gforge.company.com
  DocumentRoot /path/to/var/lib/gforge/download
  LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
  CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge
  # Ensure that we don't try to use SSL on SSL Servers
  <IfModule apache_ssl.c>
    SSLDisable
  </IfModule>
</VirtualHost>

#
# List host
#
# HTTP
<VirtualHost 10.GF.OR.GE:80>
  ServerName lists.gforge.company.com
  AddHandler cgi-script .cgi

  ScriptAlias /mailman/ /var/lib/mailman/cgi-bin/

  Alias /pipermail /var/lib/mailman/archives/public
  <Directory /var/lib/mailman/archives/public>
    AllowOverride Options
    Options FollowSymLinks
  </Directory>

  Alias /images/mailman /usr/share/images/mailman
  <Location /images/mailman>
    order allow,deny
    allow from all
  </Location>

  RedirectMatch permanent ^/$ http://lists.gforge.company.com/mailman/listinfo
  LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
  CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge
  # Ensure that we don't try to use SSL on SSL Servers
  <IfModule apache_ssl.c>
    SSLDisable
  </IfModule>
</VirtualHost>

# HTTPS
<VirtualHost 10.GF.OR.GE:443>
  ServerName lists.gforge.company.com
  AddHandler cgi-script .cgi

  <IfModule mod_ssl.c>
    SSLEngine on
    SSLCertificateFile /etc/apache/ssl.crt/server.crt
    SSLCertificateKeyFile /etc/apache/ssl.key/server.key
    <Files ~ "\.(cgi|shtml)$">
      SSLOptions +StdEnvVars
    </Files>
    <Directory "/usr/lib/cgi-bin">
      SSLOptions +StdEnvVars
    </Directory>
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
  </IfModule>

  <IfModule apache_ssl.c>
    SSLEnable
  </IfModule>

  ScriptAlias /mailman/ /var/lib/mailman/cgi-bin/

  Alias /pipermail /var/lib/mailman/archives/public
  <Directory /var/lib/mailman/archives/public>
    AllowOverride Options
    Options FollowSymLinks
  </Directory>

  Alias /images/mailman /usr/share/images/mailman
  <Location /images/mailman>
    order allow,deny
    allow from all
  </Location>

  RedirectMatch permanent ^/$ https://lists.gforge.company.com/mailman/listinfo
  LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
  CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge
</VirtualHost>

#
# * hosts
#
<VirtualHost 10.GF.OR.GE:80>
	ServerName gforge.company.com
	ServerAlias *.gforge.company.com
	VirtualDocumentRoot /home/groups/%1/htdocs
        VirtualScriptAlias /home/groups/%1/cgi-bin
	DirectoryIndex index.html index.php
	php_admin_value default_charset "UTF-8"
	php_admin_value include_path "/path/to/gforge/etc/custom:/etc/gforge:/path/to/gforge:/path/to/gforge/www/include:."
	Alias /themes-gforge/ /usr/share/gforge/www/themes/
        <Directory /home/groups>
               Options Indexes FollowSymlinks
               AllowOverride All
               order allow,deny
               allow from all
       </Directory>
  LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" gforge
  CustomLog "|/usr/bin/cronolog /path/to/var/log/gforge/%Y/%m/%d/gforge.log" gforge
  # Ensure that we don't try to use SSL on SSL Servers
  <IfModule apache_ssl.c>
    SSLDisable
  </IfModule>
</VirtualHost>