Merge branch 'wl/insta-mongoose'
* wl/insta-mongoose: Add support for the Mongoose web server.
This commit is contained in:
commit
c3f0cadfa8
@ -29,7 +29,7 @@ OPTIONS
|
|||||||
The HTTP daemon command-line that will be executed.
|
The HTTP daemon command-line that will be executed.
|
||||||
Command-line options may be specified here, and the
|
Command-line options may be specified here, and the
|
||||||
configuration file will be added at the end of the command-line.
|
configuration file will be added at the end of the command-line.
|
||||||
Currently lighttpd, apache2 and webrick are supported.
|
Currently apache2, lighttpd, mongoose and webrick are supported.
|
||||||
(Default: lighttpd)
|
(Default: lighttpd)
|
||||||
|
|
||||||
-m::
|
-m::
|
||||||
|
@ -77,11 +77,30 @@ start_httpd () {
|
|||||||
resolve_full_httpd
|
resolve_full_httpd
|
||||||
|
|
||||||
# don't quote $full_httpd, there can be arguments to it (-f)
|
# don't quote $full_httpd, there can be arguments to it (-f)
|
||||||
$full_httpd "$fqgitdir/gitweb/httpd.conf"
|
case "$httpd" in
|
||||||
if test $? != 0; then
|
*mongoose*)
|
||||||
echo "Could not execute http daemon $httpd."
|
#The mongoose server doesn't have a daemon mode so we'll have to fork it
|
||||||
exit 1
|
$full_httpd "$fqgitdir/gitweb/httpd.conf" &
|
||||||
fi
|
#Save the pid before doing anything else (we'll print it later)
|
||||||
|
pid=$!
|
||||||
|
|
||||||
|
if test $? != 0; then
|
||||||
|
echo "Could not execute http daemon $httpd."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > "$fqgitdir/pid" <<EOF
|
||||||
|
$pid
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
$full_httpd "$fqgitdir/gitweb/httpd.conf"
|
||||||
|
if test $? != 0; then
|
||||||
|
echo "Could not execute http daemon $httpd."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_httpd () {
|
stop_httpd () {
|
||||||
@ -308,6 +327,31 @@ EOF
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mongoose_conf() {
|
||||||
|
cat > "$conf" <<EOF
|
||||||
|
# Mongoose web server configuration file.
|
||||||
|
# Lines starting with '#' and empty lines are ignored.
|
||||||
|
# For detailed description of every option, visit
|
||||||
|
# http://code.google.com/p/mongoose/wiki/MongooseManual
|
||||||
|
|
||||||
|
root $fqgitdir/gitweb
|
||||||
|
ports $port
|
||||||
|
index_files gitweb.cgi
|
||||||
|
#ssl_cert $fqgitdir/gitweb/ssl_cert.pem
|
||||||
|
error_log $fqgitdir/gitweb/error.log
|
||||||
|
access_log $fqgitdir/gitweb/access.log
|
||||||
|
|
||||||
|
#cgi setup
|
||||||
|
cgi_env PATH=/usr/local/bin:/usr/bin:/bin,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH
|
||||||
|
cgi_interp $PERL
|
||||||
|
cgi_ext cgi,pl
|
||||||
|
|
||||||
|
# mimetype mapping
|
||||||
|
mime_types .gz=application/x-gzip,.tar.gz=application/x-tgz,.tgz=application/x-tgz,.tar=application/x-tar,.zip=application/zip,.gif=image/gif,.jpg=image/jpeg,.jpeg=image/jpeg,.png=image/png,.css=text/css,.html=text/html,.htm=text/html,.js=text/javascript,.c=text/plain,.cpp=text/plain,.log=text/plain,.conf=text/plain,.text=text/plain,.txt=text/plain,.dtd=text/xml,.bz2=application/x-bzip,.tbz=application/x-bzip-compressed-tar,.tar.bz2=application/x-bzip-compressed-tar
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
script='
|
script='
|
||||||
s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#;
|
s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#;
|
||||||
s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#;
|
s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#;
|
||||||
@ -344,6 +388,9 @@ case "$httpd" in
|
|||||||
webrick)
|
webrick)
|
||||||
webrick_conf
|
webrick_conf
|
||||||
;;
|
;;
|
||||||
|
*mongoose*)
|
||||||
|
mongoose_conf
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown httpd specified: $httpd"
|
echo "Unknown httpd specified: $httpd"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user