File: setup

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 (525 lines) | stat: -rwxr-xr-x 14,539 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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
#! /bin/sh

usage() {
	echo "$0: [-interact] [-help] [-debug] [-confdir confdir] [-input conffile] [-output conffile] [-httpdconf gforgehttpdconf] [-httpdsecrets gforgehttpdsecrets] [-localinc gforgelocalinc] [-example|-fhs] [-clean] [-noapache] [-dovhost] [-home homepath] [-group grouppath] [-listen80|nolisten80] [-nossl]"
}

getval(){
	echo -n $1 \[$2\] ?
	read $1
}

computedefault(){
	echo "Calculating defaults"
	# This is used to make a default working gforge.conf
	DEFAULTsystem_name=MyGForge
	DEFAULTdomain_name=`hostname -f`
	DEFAULTserver_admin=webmaster@$DEFAULTdomain_name
	DEFAULTdb_host=`hostname -i`
	DEFAULTdb_port=5432
	DEFAULTdb_name=gforge
	DEFAULTdb_user=gforge
	DEFAULTdb_password=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
	DEFAULTip_address=`hostname -i`
	DEFAULTscm_host=scm.$DEFAULTdomain_name
	DEFAULTshell_host=shell.$DEFAULTdomain_name
	DEFAULTusers_host=users.$DEFAULTdomain_name
	DEFAULTlists_host=lists.$DEFAULTdomain_name
	# The following three have to be synced when domain_name changes
	# and docs_host is supposed not to be used
	#DEFAULTdocs_host=gfdocs.$DEFAULTdomain_name
	DEFAULTjabber_host=jabber.$DEFAULTdomain_name
	DEFAULTupload_host=upload.$DEFAULTdomain_name
	#
	DEFAULTdownload_host=download.$DEFAULTdomain_name
	# The following is upload host and dir for FRS
	DEFAULTftpuploadhost=upload.$DEFAULTdomain_name
	DEFAULTftpuploaddir=$GFGDIR/var/lib/gforge/chroot/ftproot
	#
	DEFAULTstatsadmin_groupid=2
	DEFAULTnewsadmin_groupid=3
	DEFAULTpeerrating_groupid=4
	DEFAULTtemplate_project=5
	DEFAULTadmin_login=admin
	DEFAULTadmin_password=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
	DEFAULTskill_list="Ada;C;C++;HTML;LISP;Perl;PHP;Python;SQL"
	DEFAULTdefault_trove_cat=18
	DEFAULTldap_host=localhost
	DEFAULTldap_base_dn="dc=`echo $DEFAULTdomain_name | sed 's/\./,dc=/g'`"
	DEFAULTldap_web_add_password=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
	DEFAULTsys_path_to_mailman=$(if test -d /usr/lib/mailman; then echo /usr/lib/mailman; else echo /var/mailman; fi)
	DEFAULTcgidir=$CGIDIR
	DEFAULTcronolog_path=$(findcronolog)
	DEFAULTsys_path_to_jpgraph=/usr/share/jpgraph/
	DEFAULTsys_path_to_scmweb=/usr/lib/gforge/bin/
	DEFAULTgforge_chroot=$CHROOT
	DEFAULTgforge_etc=$ETCDIR
	DEFAULTsys_custom_path=$ETCDIR/custom
	DEFAULTgroupdir=$GROUPPATH
	DEFAULThomedir=$HOMEPATH
	DEFAULTcvsdir=$CVSPATH
	DEFAULTsvndir=$SVNPATH
	# The place where file uploaded with http are stored for download
	DEFAULTuploaddir=$GFGDIR/var/lib/gforge/download/
	DEFAULTsys_urlroot=$SHAREDIR/www/
	DEFAULTsys_jabber_pass=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
	DEFAULTusr_share_gforge=$SHAREDIR
	DEFAULTusr_lib_gforge=$LIBDIR
	DEFAULTvar_lib_gforge=$GFGDIR/var/lib/gforge
	DEFAULTvar_log_gforge=$GFGDIR/var/log/gforge
	DEFAULTsys_show_source=0
	DEFAULTsys_force_login=0
	DEFAULTsys_session_key=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-32)
	DEFAULTsys_session_expire='60 * 60 * 24 * 7'
	DEFAULTsys_show_contact_info=1
	DEFAULTsys_themeroot=$SHAREDIR/www/themes/
	DEFAULTsys_theme=gforge
	DEFAULTsys_lang=English
	DEFAULTsys_default_timezone=GMT
	DEFAULTsys_default_country_code=US
	DEFAULTsys_account_manager_type=$SYSTEM
	DEFAULTsys_use_jabber=0
	DEFAULTsys_use_auth_ldap=1
	# Couldn't find where this is used, maybe some rest of ext auth
	#DEFAULTsys_ldap_auth_host=localhost
	DEFAULTsys_ldap_auth_port=389
	DEFAULTsys_ldap_auth_version=3
	DEFAULTsys_ldap_auth_dn="dc=`echo $DEFAULTdomain_name | sed 's/\./,dc=/g'`"
	DEFAULTsys_scm_tarballs_path=$GFGDIR/var/lib/gforge/scmtarballs
	DEFAULTsys_scm_snapshots_path=$GFGDIR/var/lib/gforge/scmsnapshots
	DEFAULTsys_use_scm=true
	DEFAULTsys_use_tracker=true
	DEFAULTsys_use_forum=true
	DEFAULTsys_use_pm=true
	DEFAULTsys_use_docman=true
	DEFAULTsys_use_news=true
	DEFAULTsys_use_mail=true
	DEFAULTsys_use_survey=true
	DEFAULTsys_use_frs=true
	DEFAULTsys_use_fti=false
	DEFAULTsys_use_ftp=true
	DEFAULTsys_use_trove=true
	DEFAULTsys_use_snippet=true
	DEFAULTsys_use_shell=true
	DEFAULTsys_use_ssl=false
	DEFAULTsys_use_people=true
	DEFAULTsys_use_ftpuploads=false
	DEFAULTsys_use_gateways=true
	DEFAULTsys_use_project_vhost=true
	DEFAULTsys_use_project_database=false
	DEFAULTsys_use_project_multimedia=false
	DEFAULTsys_project_reg_restricted=false
	DEFAULTsys_user_reg_restricted=false
	DEFAULTsys_localization_enable_caching=true
	DEFAULTsys_localization_cache_path=$GFGDIR/var/cache/gforge/
	DEFAULTsys_localization_enable_timestamp_checking=true
	DEFAULTsys_localinc=$ETCDIR/local.inc
	DEFAULTsys_jabber_pass=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
	DEFAULTsys_plugins_path=/usr/lib/gforge/plugins/
	DEFAULTsys_sslcrt=$(findcrt)
	DEFAULTsys_sslkey=$(findkey)
	DEFAULTnoreply_to_bitbucket=true
	DEFAULTsys_simple_dns=true
	DEFAULTsys_apache_user=$(findapacheowner)
	DEFAULTsys_apache_group=$(findapacheowner)
	DEFAULTsys_forum_return_domain=$DEFAULTdomain_name
	DEFAULTpam_db_user=gforge_pam
	DEFAULTpam_db_pw=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-8)
	#
	# TODO
	#usr_lib_gforge=$GFGDIR
	#vhost_name
	#docdir
}

findcrt(){
	if [ -f /etc/apache2/ssl/apache.pem ]
	then
		echo /etc/apache2/ssl/apache.pem
	else
		if [ -f /etc/apache/ssl.crt/server.crt ]
		then 
		 	echo /etc/apache/ssl.crt/server.crt
		fi
	fi
}
findkey(){
	if [ -f /etc/apache2/ssl/apache.pem ]
	then
		echo /etc/apache2/ssl/apache.pem
	else
		if [ -f /etc/apache/ssl.key/server.key ]
		then 
			echo /etc/apache/ssl.key/server.key
		fi
	fi
}

findcronolog(){
	if [ -x /usr/bin/cronolog ]
	then 
		echo /usr/bin/cronolog
	else
		if [ -x /usr/sbin/cronolog ]
		then
			echo /usr/sbin/cronolog
		else
			which cronolog
		fi
	fi
}
findapacheowner(){
	if grep 'Red Hat' /etc/issue > /dev/null; then
		echo apache
	elif grep SuSE /etc/issue > /dev/null; then
		echo apache
	elif grep Debian /etc/issue > /dev/null; then
		echo www-data
	else
		echo apache
	fi
}

writedefault(){
	# Here is the fun
	# This create a default conf file in $1 
	tmpfile=$1.$$computedefault
	echo "cat >$1<<-EOF" > $tmpfile
	cat $0 | grep "^	DEFAULT" | sed 's/	DEFAULT\(.[^=]*\)=.*/\1=\${\1:-\$DEFAULT\1}/' >> $tmpfile
	echo 'EOF' >> $tmpfile
	. $tmpfile
	rm -f $tmpfile
}

readdefault() {
	cat $1 | sed 's/\(.[^=]*\)=\(.*\)/DEFAULT\1="\2"/' |
		grep -v '^DEFAULTcronolog_path' > $1.$$readdefault
	. $1.$$readdefault

	if [ ! -z "$DEFAULTsys_sslcrt" -a ! -f "$DEFAULTsys_sslcrt" ]
	then
		unset DEFAULTsys_sslcrt
		DEFAULTsys_sslcrt=$(findcrt)
	else
		if [ -z "$DEFAULTsys_sslcrt" ]
		then
			DEFAULTsys_sslcrt=$(findcrt)
		fi
	fi
	if [ ! -z "$DEFAULTsys_sslkey" -a ! -f "$DEFAULTsys_sslkey" ]
	then
		unset DEFAULTsys_sslkey
		DEFAULTsys_sslkey=$(findkey)
	else
		if [ -z "$DEFAULTsys_sslkey" ]
		then
			DEFAULTsys_sslkey=$(findkey)
		fi
	fi
	if [ ! -d "$DEFAULTsys_themeroot/$DEFAULTsys_theme" ]
	then
		if [ -d "$DEFAULTsys_themeroot/gforge" ]
		then
			DEFAULTsys_theme=gforge
		fi
	fi
	rm -f $1.$$readdefault
}

setupinout(){

	computedefault

	writedefault $CONFFILEIN.new

	if [ -f $CONFFILEIN ]
	then
		echo "Reading defaults from $CONFFILEIN"
		readdefault $CONFFILEIN
	else
		readdefault $CONFFILEIN.new
	fi
	
	if [ "$interact" == true ]
	then
		echo "Enter values or type enter for defaults:"
		# Here is the fun II
		# This ask for change of default
		tmpfile=$1.$$getval
		cat $0 | grep "^	DEFAULT" | sed 's/	DEFAULT\(.[^=]*\)=.*/getval \1 "\${DEFAULT\1}"/' > $tmpfile
	else
		cat $0 | grep "^	DEFAULT" | sed 's/	DEFAULT\(.[^=]*\)=.*/\1="\${DEFAULT\1}"/' > $tmpfile
	fi
	. $tmpfile
	rm -f $tmpfile
	
	echo "Creating $CONFFILEOUT"
	[ ! -d `dirname $CONFFILEOUT` ] && (mkdir -p `dirname $CONFFILEOUT` || (echo "Could not create `dirname $CONFFILEOUT`" && exit 1))
	writedefault $CONFFILEOUT.new
	mv $CONFFILEOUT.new $CONFFILEOUT
	
	
	# Remove trailing space
	cat $CONFFILEIN | sed 's/ *$//' > $CONFFILEIN.new
	mv $CONFFILEIN.new $CONFFILEIN
	
	# Fill in the blanks
	EXCLUDEVHOST=' -not -name 55vhost'
	if [ "$dovhost" == true ]
	then
		EXCLUDEVHOST='' 		
	fi
	#
	rm -f $ETCDIR/httpd.d/10cvs
	rm -f $ETCDIR/httpd.d/10scmcvs
	rm -f $ETCDIR/httpd.d/10scmcvsauth
	rm -f $ETCDIR/httpd.d/07maindirhttps
	rm -f $ETCDIR/httpd.d/11scmcvshttp
	rm -f $ETCDIR/httpd.d/11scmsvnhttp
	rm -f $ETCDIR/httpd.d/12scmcvshttp.ssl
	rm -f $ETCDIR/httpd.d/20list
	#

	find $ETCTEMPLATEDIR/httpd.d  -type f -regex "$ETCTEMPLATEDIR/httpd.d/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.ssl\|.secrets\)" $EXCLUDEVHOST | sort | while read i
	do
		if [ "$ETCTEMPLATEDIR" != "$ETCDIR" -a -f $ETCDIR/httpd.d/`basename $i` ]
		then
			if diff -q $i $ETCDIR/httpd.d/`basename $i` 
			then
				rm -f $ETCDIR/httpd.d/`basename $i`
			else
				i=$ETCDIR/httpd.d/`basename $i`
			fi
		fi
		$BINDIR/fill-in-the-blanks.pl $i $ETCDIR/`basename $i`.gforge-new $CONFFILEOUT
	done
	
	if [ $listen80 == false ]
	then
		rm -f $ETCDIR/00listen80.gforge-new
	fi

	if [ $usessl == false -o -z "$(findkey)" -o -z "$(findcrt)" ]
	then
		rm -f $ETCDIR/[0-9][0-9]*.ssl.gforge-new
	fi

	echo "Creating $HTTPDCONF"
	ls $ETCDIR/[0-9][0-9]*.gforge-new | sort | xargs cat > $HTTPDCONF
	rm $ETCDIR/[0-9][0-9]*.gforge-new
	echo "Creating $HTTPDSECRETS"
	cat $ETCDIR/httpd.secrets.gforge-new > $HTTPDSECRETS
	rm $ETCDIR/httpd.secrets.gforge-new
	
	echo "Creating $LOCALINC"
	find $ETCTEMPLATEDIR/local.d -type f -regex "$ETCTEMPLATEDIR/local.d/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" | sort | while read i 
	do
		if [ "$ETCTEMPLATEDIR" != "$ETCDIR" -a -f $ETCDIR/local.d/`basename $i` ]
		then
			if diff -q $i $ETCDIR/local.d/`basename $i` 
			then
				rm -f $ETCDIR/local.d/`basename $i`
			else
				i=$ETCDIR/local.d/`basename $i`
			fi
		fi
		$BINDIR/fill-in-the-blanks.pl $i $CONFFILEOUTDIR/`basename $i` $CONFFILEOUT
	done
	(find $CONFFILEOUTDIR  -type f -regex "$CONFFILEOUTDIR/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" | sort | xargs cat ) > $LOCALINC
	find $CONFFILEOUTDIR  -type f -regex "$CONFFILEOUTDIR/\([a-z0-9]+\|_?([a-z0-9_.]+-)+[a-z0-9]+\|[a-z0-9][a-z0-9-]*\)\(\|.$database\)" -print0 | xargs -0 rm 

	echo "Creating other includes"
	#for i in $ETCDIR/templates/[a-z]*
	find $ETCTEMPLATEDIR/templates -type f -regex "$ETCTEMPLATEDIR/templates/[a-z].*"  | while read i 
	do
		if [ "$ETCTEMPLATEDIR" != "$ETCDIR" -a -f $ETCDIR/templates/`basename $i` ]
		then
			if diff -q $i $ETCDIR/templates/`basename $i` 
			then
				rm -f $ETCDIR/templates/`basename $i`
			else
				i=$ETCDIR/templates/`basename $i`
			fi
		fi
		$BINDIR/fill-in-the-blanks.pl $i $CONFFILEOUTDIR/`basename $i` $CONFFILEOUT
	done
	chmod 600 $HTTPDSECRETS $CONFFILEIN $CONFFILEOUT
	chmod 640 $CONFFILEOUTDIR/local.pl $CONFFILEOUTDIR/database.inc
	chown gforge:gforge $CONFFILEOUTDIR/local.pl $CONFFILEOUTDIR/database.inc
}
	
doapache() {	
	APACHECONF=/etc/apache/httpd.conf
	GFORGE_ETC_SEARCH=$HTTPDCONF
	export GFORGE_ETC_SEARCH
	if [ -f $APACHECONF -a -f $BINDIR/install-apache.sh ] ; then
		if [ ! -f /etc/apache/conf.d/gforge.httpd.conf ] ; then
			if ! grep -q "^Include $GFORGE_ETC_SEARCH" $APACHECONF ; then
				$BINDIR/install-apache.sh setup
			else 
				echo "Found Include $GFORGE_ETC_SEARCH in $APACHECONF"
			fi
		else
			LINK=`ls -l /etc/apache/conf.d/gforge.httpd.conf | sed 's/.*-> \(.*\)$/\1/'`
			if [ "$LINK" != "$GFORGE_ETC_SEARCH" ] ; then
				echo Need to readjust Symlink
				$BINDIR/install-apache.sh setup
			fi
			if ! grep -q "^Include $GFORGE_ETC_SEARCH" $APACHECONF ; then
				echo "Found /etc/apache/conf.d/gforge.httpd.conf"
			else 
				# There is a link and an include
				$BINDIR/install-apache.sh setup
			fi
		fi
	fi
}


ETCDIR=`pwd`/etc
ETCTEMPLATEDIR=`pwd`/etc
BINDIR=`pwd`/utils
CGIDIR=`pwd`/cgi-bin
GFGDIR=`pwd`
CHROOT=''
HOMEPATH=/home
GROUPPATH=/home/groups
CVSPATH=/cvsroot
SVNPATH=/svnroot
SHAREDIR=`pwd`
LIBDIR=`pwd`
CONFFILEOUTDIR=$ETCDIR
CONFFILEIN=$ETCDIR/gforge.conf
CONFFILEOUT=$ETCDIR/gforge.conf
LOCALINC=$ETCDIR/local.inc
HTTPDCONF=$ETCDIR/httpd.conf
HTTPDSECRETS=$ETCDIR/httpd.secrets
SYSTEM=pgsql
export ETCDIR ETCTEMPLATEDIR BINDIR GFGDIR CONFFILEOUTDIR CONFFILEIN CONFFILEOUT LOCALINC HTTPDCONF HTTPDSECRETS DOAPACHE SYSTEM
interact=false
noapache=false
database=env
dovhost=false
listen80=true
usessl=true

while [ $# -ne 0 ]
do
	case "$1" in
		-interact )
			interact=true
			;;
		-help )
			usage
			exit 0
			;;
		-httpdsecrets )
			shift
			HTTPDSECRETS=$1
			;;
		-httpdconf )
			shift
			HTTPDCONF=$1
			;;
		-localinc )
			shift
			LOCALINC=$1
			;;
		-input )
			shift
			CONFFILEIN=$1
			;;
		-output )
			shift
			CONFFILEOUT=$1
			;;
		-system )
			shift
			SYSTEM=$1
			;;
		-confdir )
			shift
			CONFFILEOUTDIR=$1
			CONFFILEIN=$1/gforge.conf
			CONFFILEOUT=$1/gforge.conf
			LOCALINC=$1/local.inc
			HTTPDCONF=$1/httpd.conf
			HTTPDSECRETS=$1/httpd.secrets
			echo Using $1 as config directory
			;;
		-fhs )
			shift
			ETCDIR=/etc/gforge
			ETCTEMPLATEDIR=/usr/share/gforge/etc
			BINDIR=/usr/lib/gforge/bin
			CGIDIR=/usr/lib/gforge/cgi-bin
			GFGDIR=''
			HOMEPATH=/home/users
			GROUPPATH=/home/groups
			CHROOT=/var/lib/gforge/chroot
			SHAREDIR=/usr/share/gforge
			LIBDIR=/usr/lib/gforge
			CONFFILEOUTDIR=/etc/gforge
			CONFFILEIN=/etc/gforge/gforge.conf
			CONFFILEOUT=/etc/gforge/gforge.conf
			LOCALINC=/etc/gforge/local.inc
			HTTPDCONF=/etc/gforge/httpd.conf
			HTTPDSECRETS=/etc/gforge/httpd.secrets
			;;
		-simple )
			database=simple
			;;
		-noapache )
			noapache=true
			;;
		-dovhost )
			dovhost=true
			;;
		-listen80 )
			listen80=true
			;;
		-nolisten80 )
			listen80=false
			;;
		-nossl )
			usessl=false
			;;
		-example )
			shift
			CONFFILEIN=$ETCDIR/gforge.conf.example
			CONFFILEOUT=$ETCDIR/gforge.conf.example
			LOCALINC=$ETCDIR/local.inc.example
			HTTPDCONF=$ETCDIR/httpd.conf.example
			HTTPDSECRETS=$ETCDIR/httpd.secrets.example
			database=simple
			noapache=true
			;;
		-home )
			shift
			HOMEPATH=$1
			;;
		-group )
			shift
			GROUPPATH=$1
			;;
		-clean )
			[ -f $CONFFILEIN ] && echo Removing $CONFFILEIN && rm -f $CONFFILEIN
			[ -f $CONFFILEOUT ] && echo Removing $CONFFILEOUT && rm -f $CONFFILEOUT
			[ -f $LOCALINC ] && echo Removing $LOCALINC && rm -f $LOCALINC
			[ -f $HTTPDCONF ] && echo Removing $HTTPDCONF && rm -f $HTTPDCONF
			[ -f $HTTPDSECRETS ] && echo Removing $HTTPDSECRETS && rm -f $HTTPDSECRETS
			exit 0
			;;
		-debug )
			set -x
			;;
		*)
			echo "Bad Parameter"
			usage
			exit 1
			;;
	esac
	shift
done
setupinout
[ "$noapache" != true ] && doapache