{"thread":{"id":"18233","subject":"[PATCH] git-instaweb: fix lighttpd configuration on cygwin","startedAt":"2009-03-09T18:31:55Z","lastAt":"2009-03-10T17:34:34Z","messageCount":2,"participants":["Ramsay Jones","Pascal Obry"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"107492","messageId":"49B5609B.5070705@ramsay1.demon.co.uk","threadId":"18233","inReplyTo":null,"subject":"[PATCH] git-instaweb: fix lighttpd configuration on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2009-03-09T18:31:55Z","receivedAt":"2009-03-09T18:31:55Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nA recent email from Pascal reminded me that I had this patch\nkicking around. I haven't tested this on Linux, since I don't\nhave lighttpd installed there (I already have Apache), but I\ndon't expect any problems; famous last words!\n\nThe essence of the change is the addition of the \"mod_setenv\"\nmodule, along with the PATH environment variable assignment.\n(otherwise gitweb can't find a shell and, therefore, can't\nexecute any git programs)\n\nAlso, I had to add a default mime-type assignment of text/plain\n(\"\" => \"text/plain\").  If my memory serves me, the other additions\nto the mime-type mapping was just cosmetic; and why not?\n\nHmmm, I just noticed that the first hunk, which is needed to\nsuppress a \"lighttpd: not found\" error message, could perhaps be\nseen as an un-related fix. Dunno.\n\nATB,\nRamsay Jones\n\n\n git-instaweb.sh |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++++--\n 1 files changed, 66 insertions(+), 3 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 0843372..5f4419b 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -49,7 +49,7 @@ resolve_full_httpd () {\n \tesac\n \n \thttpd_only=\"$(echo $httpd | cut -f1 -d' ')\"\n-\tif case \"$httpd_only\" in /*) : ;; *) which $httpd_only >/dev/null;; esac\n+\tif case \"$httpd_only\" in /*) : ;; *) which $httpd_only >/dev/null 2>&1;; esac\n \tthen\n \t\tfull_httpd=$httpd\n \telse\n@@ -179,11 +179,74 @@ lighttpd_conf () {\n \tcat > \"$conf\" <<EOF\n server.document-root = \"$fqgitdir/gitweb\"\n server.port = $port\n-server.modules = ( \"mod_cgi\" )\n+server.modules = ( \"mod_setenv\", \"mod_cgi\" )\n server.indexfiles = ( \"gitweb.cgi\" )\n server.pid-file = \"$fqgitdir/pid\"\n+server.errorlog = \"$fqgitdir/gitweb/error.log\"\n+\n+# to enable, add \"mod_access\", \"mod_accesslog\" to server.modules\n+# variable above and uncomment this\n+#accesslog.filename = \"$fqgitdir/gitweb/access.log\"\n+\n+setenv.add-environment = ( \"PATH\" => \"/usr/local/bin:/usr/bin:/bin\" )\n+\n cgi.assign = ( \".cgi\" => \"\" )\n-mimetype.assign = ( \".css\" => \"text/css\" )\n+\n+# mimetype mapping\n+mimetype.assign             = (\n+  \".pdf\"          =>      \"application/pdf\",\n+  \".sig\"          =>      \"application/pgp-signature\",\n+  \".spl\"          =>      \"application/futuresplash\",\n+  \".class\"        =>      \"application/octet-stream\",\n+  \".ps\"           =>      \"application/postscript\",\n+  \".torrent\"      =>      \"application/x-bittorrent\",\n+  \".dvi\"          =>      \"application/x-dvi\",\n+  \".gz\"           =>      \"application/x-gzip\",\n+  \".pac\"          =>      \"application/x-ns-proxy-autoconfig\",\n+  \".swf\"          =>      \"application/x-shockwave-flash\",\n+  \".tar.gz\"       =>      \"application/x-tgz\",\n+  \".tgz\"          =>      \"application/x-tgz\",\n+  \".tar\"          =>      \"application/x-tar\",\n+  \".zip\"          =>      \"application/zip\",\n+  \".mp3\"          =>      \"audio/mpeg\",\n+  \".m3u\"          =>      \"audio/x-mpegurl\",\n+  \".wma\"          =>      \"audio/x-ms-wma\",\n+  \".wax\"          =>      \"audio/x-ms-wax\",\n+  \".ogg\"          =>      \"application/ogg\",\n+  \".wav\"          =>      \"audio/x-wav\",\n+  \".gif\"          =>      \"image/gif\",\n+  \".jpg\"          =>      \"image/jpeg\",\n+  \".jpeg\"         =>      \"image/jpeg\",\n+  \".png\"          =>      \"image/png\",\n+  \".xbm\"          =>      \"image/x-xbitmap\",\n+  \".xpm\"          =>      \"image/x-xpixmap\",\n+  \".xwd\"          =>      \"image/x-xwindowdump\",\n+  \".css\"          =>      \"text/css\",\n+  \".html\"         =>      \"text/html\",\n+  \".htm\"          =>      \"text/html\",\n+  \".js\"           =>      \"text/javascript\",\n+  \".asc\"          =>      \"text/plain\",\n+  \".c\"            =>      \"text/plain\",\n+  \".cpp\"          =>      \"text/plain\",\n+  \".log\"          =>      \"text/plain\",\n+  \".conf\"         =>      \"text/plain\",\n+  \".text\"         =>      \"text/plain\",\n+  \".txt\"          =>      \"text/plain\",\n+  \".dtd\"          =>      \"text/xml\",\n+  \".xml\"          =>      \"text/xml\",\n+  \".mpeg\"         =>      \"video/mpeg\",\n+  \".mpg\"          =>      \"video/mpeg\",\n+  \".mov\"          =>      \"video/quicktime\",\n+  \".qt\"           =>      \"video/quicktime\",\n+  \".avi\"          =>      \"video/x-msvideo\",\n+  \".asf\"          =>      \"video/x-ms-asf\",\n+  \".asx\"          =>      \"video/x-ms-asf\",\n+  \".wmv\"          =>      \"video/x-ms-wmv\",\n+  \".bz2\"          =>      \"application/x-bzip\",\n+  \".tbz\"          =>      \"application/x-bzip-compressed-tar\",\n+  \".tar.bz2\"      =>      \"application/x-bzip-compressed-tar\",\n+  \"\"              =>      \"text/plain\"\n+ )\n EOF\n \ttest x\"$local\" = xtrue && echo 'server.bind = \"127.0.0.1\"' >> \"$conf\"\n }\n-- \n1.6.2\n"},{"id":"107594","messageId":"49B6A4AA.7050301@obry.net","threadId":"18233","inReplyTo":"49B5609B.5070705@ramsay1.demon.co.uk","subject":"Re: [PATCH] git-instaweb: fix lighttpd configuration on cygwin","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2009-03-10T17:34:34Z","receivedAt":"2009-03-10T17:34:34Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Ramsay Jones a écrit :\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n> \n> A recent email from Pascal reminded me that I had this patch\n> kicking around. I haven't tested this on Linux, since I don't\n> have lighttpd installed there (I already have Apache), but I\n> don't expect any problems; famous last words!\n> \n> The essence of the change is the addition of the \"mod_setenv\"\n> module, along with the PATH environment variable assignment.\n> (otherwise gitweb can't find a shell and, therefore, can't\n> execute any git programs)\n> \n> Also, I had to add a default mime-type assignment of text/plain\n> (\"\" => \"text/plain\").  If my memory serves me, the other additions\n> to the mime-type mapping was just cosmetic; and why not?\n> \n> Hmmm, I just noticed that the first hunk, which is needed to\n> suppress a \"lighttpd: not found\" error message, could perhaps be\n> seen as an un-related fix. Dunno.\n\nTested on my side using Cygwin 1.5.25 and httpd. Working fine. Thanks.\n\n  Tested-by: Pascal Obry <pascal@obry.net>\n\nor\n\n  Signed-off-by: Pascal Obry <pascal@obry.net>\n\nNot sure as I have never seen Tested-by!\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"}]}