git-instaweb: Put httpd logs in a "$httpd_only" subdirectory
Resolve full httpd and create "$httpd_only" subdirectory before writing httpd.conf so that error.log and access.log go into it. While at it, change apache2 configuration to use logs in a similiar fashion. Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Petr Baudis <pasky@ucw.cz> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pavan Kumar Sunkara committed
May 28, 2010 at 11:55 UTC
be5347b398dd35cdbbb2e2d8b102aacca853df86
1 file changed
+9
-5
git-instaweb.sh
+9
-5
@@ -206,11 +206,11 @@ server.port = $port
206
server.modules = ( "mod_setenv", "mod_cgi" )
207
server.indexfiles = ( "gitweb.cgi" )
208
server.pid-file = "$fqgitdir/pid"
209
-server.errorlog = "$fqgitdir/gitweb/error.log"
209
+server.errorlog = "$fqgitdir/gitweb/$httpd_only/error.log"
210
211
# to enable, add "mod_access", "mod_accesslog" to server.modules
212
# variable above and uncomment this
213
-#accesslog.filename = "$fqgitdir/gitweb/access.log"
213
+#accesslog.filename = "$fqgitdir/gitweb/$httpd_only/access.log"
214
215
setenv.add-environment = ( "PATH" => env.PATH )
216
@@ -277,7 +277,6 @@ EOF
277
278
apache2_conf () {
279
test -z "$module_path" && module_path=/usr/lib/apache2/modules
280
- mkdir -p "$GIT_DIR/gitweb/logs"
280
bind=
281
test x"$local" = xtrue && bind='127.0.0.1:'
282
echo 'text/css css' > "$fqgitdir/mime.types"
@@ -285,6 +284,8 @@ apache2_conf () {
284
ServerName "git-instaweb"
285
ServerRoot "$fqgitdir/gitweb"
286
DocumentRoot "$fqgitdir/gitweb"
287
+ErrorLog "$fqgitdir/gitweb/$httpd_only/error.log"
288
+CustomLog "$fqgitdir/gitweb/$httpd_only/access.log" combined
289
PidFile "$fqgitdir/pid"
290
Listen $bind$port
291
EOF
@@ -357,8 +358,8 @@ root $fqgitdir/gitweb
358
ports $port
359
index_files gitweb.cgi
360
#ssl_cert $fqgitdir/gitweb/ssl_cert.pem
360
-error_log $fqgitdir/gitweb/error.log
361
-access_log $fqgitdir/gitweb/access.log
361
+error_log $fqgitdir/gitweb/$httpd_only/error.log
362
+access_log $fqgitdir/gitweb/$httpd_only/access.log
363
364
#cgi setup
365
cgi_env PATH=$PATH,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH
@@ -406,6 +407,9 @@ gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi"
407
gitweb_css "$GIT_DIR/@@GITWEB_CSS_NAME@@"
408
gitweb_js "$GIT_DIR/@@GITWEB_JS_NAME@@"
409
410
+resolve_full_httpd
411
+mkdir -p "$fqgitdir/gitweb/$httpd_only"
412
+
413
case "$httpd" in
414
*lighttpd*)
415
lighttpd_conf