{"thread":{"id":"20547","subject":"[PATCHv2] git-instaweb: detect difference between mod_cgi and mod_cgid for apache2","startedAt":"2009-08-12T02:34:22Z","lastAt":"2009-08-12T02:34:22Z","messageCount":1,"participants":["Mark A Rada"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"120351","messageId":"F920560B-FABD-47A1-9F83-47A3F2C3193D@mailservices.uwaterloo.ca","threadId":"20547","inReplyTo":null,"subject":"[PATCHv2] git-instaweb: detect difference between mod_cgi and mod_cgid for apache2","fromName":"Mark A Rada","fromEmail":"marada@uwaterloo.ca","sentAt":"2009-08-12T02:34:22Z","receivedAt":"2009-08-12T02:34:22Z","isPatch":false,"sender":{"key":"marada@uwaterloo.ca","avatar":"https://avatars.githubusercontent.com/u/38430?v=4"},"body":"Comments?\n\n--\nMark A Rada (ferrous26)\nmarada@uwaterloo.ca\n\n\n--->8----\nSome people have mod_cgid in place of mod_cgi, this will check which one\nthe user has available to them first and then act accordingly.\n\nIt is possible to have both mod_cgi and mod_cgid installed at the same\ntime; in these cases, mod_cgi will preferred over mod_cgid to make\nthings easier.\n\nIn the case that no CGI modules are available for apache2 the script\nwill print a message to the user notifying him/her about the problem.\n\nSigned-off-by: Mark Rada <marada@uwaterloo.ca>\n---\n  git-instaweb.sh |   15 ++++++++++++++-\n  1 files changed, 14 insertions(+), 1 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex 5f5cac7..ec0b518 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -298,7 +298,20 @@ EOF\n  \t\tresolve_full_httpd\n  \t\tlist_mods=$(echo \"$full_httpd\" | sed \"s/-f$/-l/\")\n  \t\t$list_mods | grep 'mod_cgi\\.c' >/dev/null 2>&1 || \\\n-\t\techo \"LoadModule cgi_module $module_path/mod_cgi.so\" >> \"$conf\"\n+\t\tif test -f \"$module_path/mod_cgi.so\"\n+\t\tthen\n+\t\t\techo \"LoadModule cgi_module $module_path/mod_cgi.so\" >> \"$conf\"\n+\t\telse\n+\t\t\t$list_mods | grep 'mod_cgid\\.c' >/dev/null 2>&1 || \\\n+\t\t\tif test -f \"$module_path/mod_cgid.so\"\n+\t\t\tthen\n+\t\t\t\techo \"LoadModule cgid_module $module_path/mod_cgid.so\" >> \"$conf\"\n+\t\t\telse\n+\t\t\t\techo \"You don't have any CGI support!\"\n+\t\t\t\texit 2\n+\t\t\tfi\n+\t\t\techo \"ScriptSock logs/gitweb.sock\" >> \"$conf\"\n+\t\tfi\n  \t\tcat >> \"$conf\" <<EOF\n  AddHandler cgi-script .cgi\n  <Location /gitweb.cgi>\n-- \n1.6.4\n"}]}