X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-instaweb.sh;h=80adc8307b4310440b5de7df82c5200cc2c45cbb;hb=cf2999eb4cbe39d5a40add574be9e5c019df758b;hp=69aef3c20b099edd32aaa76ad8cfceb7e3f8a53a;hpb=12d4a97a03ebb4dc64ee995fe33f29076ffa9b39;p=git.git diff --git a/git-instaweb.sh b/git-instaweb.sh index 69aef3c20..80adc8307 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -25,7 +25,7 @@ conf=$GIT_DIR/gitweb/httpd.conf # Defaults: -# if installed, it doens't need further configuration (module_path) +# if installed, it doesn't need further configuration (module_path) test -z "$httpd" && httpd='lighttpd -f' # probably the most popular browser among gitweb users @@ -53,6 +53,13 @@ start_httpd () { return fi done + echo "$httpd_only not found. Install $httpd_only or use" \ + "--httpd to specify another http daemon." + exit 1 + fi + if test $? != 0; then + echo "Could not execute http daemon $httpd." + exit 1 fi } @@ -156,10 +163,20 @@ apache2_conf () { test "$local" = true && bind='127.0.0.1:' echo 'text/css css' > $fqgitdir/mime.types cat > "$conf" <> "$conf" + fi + done + cat >> "$conf" </dev/null 2>&1 || \ + echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf" cat >> "$conf" < Options +ExecCGI @@ -232,4 +251,5 @@ esac start_httpd test -z "$browser" && browser=echo -$browser http://127.0.0.1:$port +url=http://127.0.0.1:$port +$browser $url || echo $url