{"thread":{"id":"7355","subject":"Installation instructions for gitweb?","startedAt":"2007-03-22T17:52:53Z","lastAt":"2007-03-26T01:34:41Z","messageCount":8,"participants":["Han-Wen Nienhuys","Johannes Schindelin","Frank Lichtenheld","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"37752","messageId":"etufpl$7en$1@sea.gmane.org","threadId":"7355","inReplyTo":null,"subject":"Installation instructions for gitweb?","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2007-03-22T17:52:53Z","receivedAt":"2007-03-22T17:52:53Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"\nHello,\n\nI'm trying to get gitweb to serve my local repositories on the intranet\nhere, but I am not successful in getting it to run.  I got as far as\ngetting gitweb page, containing no projects but only \"403 forbidden - No\nprojects found.\" I tried setting the projects_list to a directory, a\nsubdirectory, a file with the projects to be published, etc.\n\nIs there a guide on setting up gitweb for hare-brained people like me\nthat don't know apache and don't know perl? In particular, the format of\ngitweb_conf.perl is not documented at all.\n"},{"id":"37754","messageId":"Pine.LNX.4.63.0703221910350.4045@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7355","inReplyTo":"etufpl$7en$1@sea.gmane.org","subject":"Re: Installation instructions for gitweb?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-22T18:11:12Z","receivedAt":"2007-03-22T18:11:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 22 Mar 2007, Han-Wen Nienhuys wrote:\n\n> I'm trying to get gitweb to serve my local repositories on the intranet \n> here, but I am not successful in getting it to run.  I got as far as \n> getting gitweb page, containing no projects but only \"403 forbidden - No \n> projects found.\" I tried setting the projects_list to a directory, a \n> subdirectory, a file with the projects to be published, etc.\n> \n> Is there a guide on setting up gitweb for hare-brained people like me\n> that don't know apache and don't know perl? In particular, the format of\n> gitweb_conf.perl is not documented at all.\n\nI never got to install gitweb myself. Instead, I used git-instaweb quite \nsuccessfully...\n\nCiao,\nDscho\n"},{"id":"37824","messageId":"20070323161210.GI8017@planck.djpig.de","threadId":"7355","inReplyTo":"etufpl$7en$1@sea.gmane.org","subject":"Re: Installation instructions for gitweb?","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-03-23T16:12:10Z","receivedAt":"2007-03-23T16:12:10Z","isPatch":false,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"On Thu, Mar 22, 2007 at 02:52:53PM -0300, Han-Wen Nienhuys wrote:\n> I'm trying to get gitweb to serve my local repositories on the intranet\n> here, but I am not successful in getting it to run.  I got as far as\n> getting gitweb page, containing no projects but only \"403 forbidden - No\n> projects found.\" I tried setting the projects_list to a directory, a\n> subdirectory, a file with the projects to be published, etc.\n\n>From looking at the code this error can mean quite a few things:\n\n- you set $projectroot incorrectly\n- you set $projects_list incorrectly\n- you set $export_ok to something != \"\" and didn't create\n  the necessary files\n- your repositories lack HEAD refs (don't know how this could happen,\n  though)\n\nMore diagnosis is difficult without knowing your exact setup.\n\n> Is there a guide on setting up gitweb for hare-brained people like me\n> that don't know apache and don't know perl? In particular, the format of\n> gitweb_conf.perl is not documented at all.\n\ngitweb_conf.perl is just included as perl code. It is primarly useful\nfor overriding the variables defined at the top of gitweb.cgi\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"},{"id":"37826","messageId":"f329bf540703230920r5034d025p5fd169b06837ad4e@mail.gmail.com","threadId":"7355","inReplyTo":"20070323161210.GI8017@planck.djpig.de","subject":"Re: Installation instructions for gitweb?","fromName":"Han-Wen Nienhuys","fromEmail":"hanwenn@gmail.com","sentAt":"2007-03-23T16:20:25Z","receivedAt":"2007-03-23T16:20:25Z","isPatch":false,"sender":{"key":"hanwenn@gmail.com","avatar":"https://gravatar.com/avatar/058832acb8d613baeb6ce9d21b009d9772424a309b9a521330423daef909a27a?d=mp&s=160"},"body":"> gitweb_conf.perl is just included as perl code. It is primarly useful\n> for overriding the variables defined at the top of gitweb.cgi\n\nThis explanation doesn't help me. Can you post an example snippet?\n\n\n-- \nHan-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"37828","messageId":"20070323164248.GJ8017@planck.djpig.de","threadId":"7355","inReplyTo":"f329bf540703230920r5034d025p5fd169b06837ad4e@mail.gmail.com","subject":"Re: Installation instructions for gitweb?","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-03-23T16:42:48Z","receivedAt":"2007-03-23T16:42:48Z","isPatch":false,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"On Fri, Mar 23, 2007 at 01:20:25PM -0300, Han-Wen Nienhuys wrote:\n> >gitweb_conf.perl is just included as perl code. It is primarly useful\n> >for overriding the variables defined at the top of gitweb.cgi\n> \n> This explanation doesn't help me. Can you post an example snippet?\n\ne.g. the default config file distributed in the Debian packages for git:\n\n# path to git projects (<project>.git)\n$projectroot = \"/var/cache/git\";\n\n# directory to use for temp files\n$git_temp = \"/tmp\";\n\n# target of the home link on top of all pages\n$home_link = $my_uri;\n\n# html text to include at home page\n$home_text = \"indextext.html\";\n\n# file with project list; by default, simply scan the projectroot dir.\n$projects_list = $projectroot;\n\n# stylesheet to use\n$stylesheet = \"/gitweb.css\";\n\n# logo to use\n$logo = \"/git-logo.png\";\n\n# the 'favicon'\n$favicon = \"/git-favicon.png\";\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"},{"id":"37892","messageId":"11747663931269-git-send-email-jnareb@gmail.com","threadId":"7355","inReplyTo":"etufpl$7en$1@sea.gmane.org","subject":"[PATCH] gitweb: Add some installation notes in gitweb/INSTALL","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-03-24T19:59:53Z","receivedAt":"2007-03-24T19:59:53Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Add some installation and configuration notes for gitweb in\ngitweb/INSTALL. Make use of filling gitweb configuration by\nMakefile.\n\nIt does not cover (yet?) all the configuration variables and\noptions.\n\nSome of contents duplicates information in gitweb/README file\n(it is referred from gitweb/INSTALL).\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nOn Thu, Mar 22, 2007, Han-Wen Nienhuys <hanwen@xs4all.nl> wrote:\n\n> I'm trying to get gitweb to serve my local repositories on the intranet\n> here, but I am not successful in getting it to run.  I got as far as\n> getting gitweb page, containing no projects but only \"403 forbidden - No\n> projects found.\" I tried setting the projects_list to a directory, a\n> subdirectory, a file with the projects to be published, etc.\n>\n> Is there a guide on setting up gitweb for hare-brained people like me\n> that don't know apache and don't know perl? In particular, the format of\n> gitweb_conf.perl is not documented at all.\n\nI hope that this addresses your questions.\n\n---\nWe should probably think about what should go to gitweb/README\nfile, and what should go to gitweb/INSTALL. \n\nI haven't checked gitweb/README when writing gitweb/INSTALL, so it\nrepeats some information from README (there are references to related\nsections in README).\n\nSome information which is in gitweb/README should probably be in\ngitweb/INSTALL, but gitweb/INSTALL did not exist when the information\nwas added.\n\n\nAnother issue is using `cp' vs `install' for gitweb installation.\n\n gitweb/INSTALL |  184 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 184 insertions(+), 0 deletions(-)\n create mode 100644 gitweb/INSTALL\n\ndiff --git a/gitweb/INSTALL b/gitweb/INSTALL\nnew file mode 100644\nindex 0000000..371407d\n--- /dev/null\n+++ b/gitweb/INSTALL\n@@ -0,0 +1,184 @@\n+GIT web Interface (gitweb) Installation\n+=======================================\n+\n+First you have to generate gitweb.cgi from gitweb.perl using\n+\"make gitweb/gitweb.cgi\", then copy appropriate files (gitweb.cgi,\n+gitweb.css, git-logo.png and git-favicon.png) to their destination.\n+For example if git was (or is) installed with /usr prefix, you can do\n+\n+\t$ make prefix=/usr gitweb/gitweb.cgi  ;# as yourself\n+\t# cp gitweb/git* /var/www/cgi-bin/    ;# as root\n+\n+Alternatively you can use autoconf generated ./configure script to\n+set up path to git binaries (via config.mak.autogen), so you can write\n+instead\n+\n+\t$ make configure                     ;# as yourself\n+\t$ ./configure --prefix=/usr          ;# as yourself\n+\t$ make gitweb/gitweb.cgi             ;# as yourself\n+\t# cp gitweb/git* /var/www/cgi-bin/   ;# as root\n+\n+The above example assumes that your web server is configured to run\n+[executable] files in /var/www/cgi-bin/ as server scripts (as CGI\n+scripts).\n+\n+\n+Build time configuration\n+------------------------\n+\n+See also \"How to configure gitweb for your local system\" in README\n+file for gitweb (in gitweb/README).\n+\n+- There are many configuration variables which affects building of\n+  gitweb.cgi; see \"default configuration for gitweb\" section in main\n+  (top dir) Makefile, and instructions for building gitweb/gitweb.cgi\n+  target.\n+\n+  One of most important is where to find git wrapper binary. Gitweb\n+  tries to find git wrapper at $(bindir)/git, so you have to set $bindir\n+  when building gitweb.cgi, or $prefix from which $bindir is derived. If\n+  you build and install gitweb together with the rest of git suite,\n+  there should be no problems. Otherwise, if git was for example\n+  installed from a binary package, you have to set $prefix (or $bindir)\n+  accordingly.\n+\n+- Another important issue is where are git repositories you want to make\n+  available to gitweb. By default gitweb search for repositories under\n+  /pub/git; if you want to have projects somewhere else, like /home/git,\n+  use GITWEB_PROJECTROOT build configuration variable.\n+\n+  By default all git repositories under projectroot are visible and\n+  available to gitweb. List of projects is generated by default by\n+  scanning the projectroot directory for git repositories. This can be\n+  changed (configured) as described in \"Gitweb repositories\" section\n+  below.\n+\n+  Note that gitweb deals directly with object database, and does not\n+  need working directory; the name of the project is the name of its\n+  repository object database, usually projectname.git for bare\n+  repositories. If you want to provide gitweb access to non-bare (live)\n+  repository, you can make projectname.git symbolic link under\n+  projectroot linking to projectname/.git (but it is just\n+  a suggestion).\n+\n+- You can control where gitweb tries to find its main CSS style file,\n+  its favicon and logo with GITWEB_CSS, GITWEB_FAVICON and GITWEB_LOGO\n+  build configuration variables. By default gitweb tries to find them\n+  in the same directory as gitweb.cgi script.\n+\n+Build example\n+~~~~~~~~~~~~~\n+\n+- To install gitweb to /var/www/cgi-bin/gitweb/ when git wrapper\n+  is installed at /usr/local/bin/git and the repositories (projects)\n+  we want to display are under /home/local/scm, you can do\n+\n+\tmake GITWEB_PROJECTROOT=\"/home/local/scm\" \\\n+\t     GITWEB_CSS=\"/gitweb/gitweb.css\" \\\n+\t     GITWEB_LOGO=\"/gitweb/git-logo.png\" \\\n+\t     GITWEB_FAVICON=\"/gitweb/git-favicon.png\" \\\n+\t     bindir=/usr/local/bin \\\n+\t     gitweb/gitweb.cgi\n+\n+\tcp -fv ~/git/gitweb/gitweb.{cgi,css} \\\n+\t       ~/git/gitweb/git-{favicon,logo}.png \\\n+\t     /var/www/cgi-bin/gitweb/\n+\n+\n+Gitweb config file\n+------------------\n+\n+See also \"Runtime gitweb configuration\" section in README file\n+for gitweb (in gitweb/README).\n+\n+- You can configure gitweb further using gitweb configuration file;\n+  by default it is file named gitweb_config.perl in the same place as\n+  gitweb.cgi script. You can control default place for config file\n+  using GITWEB_CONFIG build configuration variable, and you can set it\n+  using GITWEB_CONFIG environmental variable.\n+\n+- Gitweb config file is [fragment] of perl code. You can set variables\n+  using \"our $variable = value\"; text from \"#\" character until the end\n+  of a line is ignored. See perlsyn(1) for details.\n+\n+  See the top of gitweb.perl file for examples of customizable options.\n+\n+\n+Gitweb repositories:\n+--------------------\n+\n+- By default all git repositories under projectroot are visible and\n+  available to gitweb. List of projects is generated by default by\n+  scanning the projectroot directory for git repositories (for object\n+  databases to be more exact).\n+\n+  You can provide pre-generated list of [visible] repositories,\n+  together with information about their owners (the project ownership\n+  is taken from owner of repository directory otherwise), by setting\n+  GITWEB_LIST build configuration variable (or $projects_list variable\n+  in gitweb config file) to point to a plain file.\n+\n+  Each line of projects list file should consist of url-encoded path\n+  to project repository database (relative to projectroot) separated\n+  by space from url-encoded project owner; spaces in both project path\n+  and project owner have to be encoded as either '%20' or '+'.\n+\n+  You can generate projects list index file using project_index action\n+  (the 'TXT' link on projects list page) directly from gitweb.\n+\n+- By default even if project is not visible on projects list page, you\n+  can view it nevertheless by hand-crafting gitweb URL. You can set\n+  GITWEB_STRICT_EXPORT build configuration variable (or $strict_export\n+  variable in gitweb config file) to only allow viewing of\n+  repositories also shown on the overview page.\n+\n+- Alternatively, you can configure gitweb to only list and allow\n+  viewing of the explicitly exported repositories, via\n+  GITWEB_EXPORT_OK build configuration variable (or $export_ok\n+  variable in gitweb config file). If it evaluates to true, gitweb\n+  show repository only if this file exists in its object database\n+  (if directory has the magic file $export_ok).\n+\n+\n+Requirements\n+------------\n+\n+ - Core git tools\n+ - Perl\n+ - Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.\n+ - web server\n+\n+\n+Example web server configuration\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+See also \"Webserver configuration\" section in README file for gitweb\n+(in gitweb/README).\n+\n+\n+- Apache2, gitweb installed as CGI script,\n+  under /var/www/cgi-bin/\n+\n+\tScriptAlias /cgi-bin/ \"/var/www/cgi-bin/\"\n+\n+\t<Directory \"/var/www/cgi-bin\">\n+\t    Options Indexes FollowSymlinks ExecCGI\n+\t    AllowOverride None\n+\t    Order allow,deny\n+\t    Allow from all\n+\t</Directory>\n+\n+- Apache2, gitweb installed as mod_perl legacy script,\n+  under /var/www/perl/\n+\n+\tAlias /perl \"/var/www/perl\"\n+\n+\t<Directory \"/var/www/perl\">\n+\t    SetHandler perl-script\n+\t    PerlResponseHandler ModPerl::Registry\n+\t    PerlOptions +ParseHeaders\n+\t    Options Indexes FollowSymlinks +ExecCGI\n+\t    AllowOverride None\n+\t    Order allow,deny\n+\t    Allow from all\n+\t</Directory>\n-- \n1.5.0.5\n"},{"id":"37909","messageId":"f329bf540703241918y22830d50jbf20928d402c67fe@mail.gmail.com","threadId":"7355","inReplyTo":"11747663931269-git-send-email-jnareb@gmail.com","subject":"Re: [PATCH] gitweb: Add some installation notes in gitweb/INSTALL","fromName":"Han-Wen Nienhuys","fromEmail":"hanwenn@gmail.com","sentAt":"2007-03-25T02:18:48Z","receivedAt":"2007-03-25T02:18:48Z","isPatch":true,"sender":{"key":"hanwenn@gmail.com","avatar":"https://gravatar.com/avatar/058832acb8d613baeb6ce9d21b009d9772424a309b9a521330423daef909a27a?d=mp&s=160"},"body":"2007/3/24, Jakub Narebski <jnareb@gmail.com>:\n> Add some installation and configuration notes for gitweb in\n> gitweb/INSTALL. Make use of filling gitweb configuration by\n> Makefile.\n>\n> It does not cover (yet?) all the configuration variables and\n> options.\n\nI got it running with the help of the list, but this patch surely\nimproves the state of the docs. Just one nit: it should give a small\nexample of the desired syntax of the gitweb_conf.perl file\n\n-- \nHan-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"37982","messageId":"200703260334.42885.jnareb@gmail.com","threadId":"7355","inReplyTo":"f329bf540703241918y22830d50jbf20928d402c67fe@mail.gmail.com","subject":"[PATCH/RFC] gitweb: Add example of config file and how to generate projects list to gitweb/INSTALL","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-03-26T01:34:41Z","receivedAt":"2007-03-26T01:34:41Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Add simple example of config file (turning on and allowing override of\na few %features). Also example config file and script to generate list\nof projects in a format that can be used as GITWEB_LIST / $projects_list.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nHan-Wen Nienhuys wrote:\n> 2007/3/24, Jakub Narebski <jnareb@gmail.com>:\n> > Add some installation and configuration notes for gitweb in\n> > gitweb/INSTALL. Make use of filling gitweb configuration by\n> > Makefile.\n> >\n> > It does not cover (yet?) all the configuration variables and\n> > options.\n> \n> I got it running with the help of the list, but this patch surely\n> improves the state of the docs. Just one nit: it should give a small\n> example of the desired syntax of the gitweb_conf.perl file\n\nHTH\n\nI'm not sure about example how to get projects list in the format\nsuitable for gitweb. For example HTTP headers should be stripped\nfrom the projects_index gitweb.cgi output, but I don't remember\nproper sed invocation to skip all lines up to emty line/line\ncontaining only \"\\r\".\n\n\n gitweb/INSTALL |   45 +++++++++++++++++++++++++++++++++++++++++++--\n 1 files changed, 43 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/INSTALL b/gitweb/INSTALL\nindex 371407d..6328e26 100644\n--- a/gitweb/INSTALL\n+++ b/gitweb/INSTALL\n@@ -103,9 +103,25 @@ for gitweb (in gitweb/README).\n \n   See the top of gitweb.perl file for examples of customizable options.\n \n+Config file example\n+~~~~~~~~~~~~~~~~~~~\n \n-Gitweb repositories:\n---------------------\n+To enable blame, pickaxe search, and snapshot support, while allowing\n+individual projects to turn them off, put the following in your\n+GITWEB_CONFIG file:\n+\n+\t$feature{'blame'}{'default'} = [1];\n+\t$feature{'blame'}{'override'} = 1;\n+\n+\t$feature{'pickaxe'}{'default'} = [1];\n+\t$feature{'pickaxe'}{'override'} = 1;\n+\n+\t$feature{'snapshot'}{'default'} = ['x-gzip', 'gz', 'gzip'];\n+\t$feature{'snapshot'}{'override'} = 1;\n+\n+\n+Gitweb repositories\n+-------------------\n \n - By default all git repositories under projectroot are visible and\n   available to gitweb. List of projects is generated by default by\n@@ -139,6 +155,31 @@ Gitweb repositories:\n   show repository only if this file exists in its object database\n   (if directory has the magic file $export_ok).\n \n+Generating projects list using gitweb\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+We assume that GITWEB_CONFIG has its default Makefile value, namely\n+gitweb_config.perl. Put the following in gitweb_make_index.perl file:\n+\n+\t$GITWEB_CONFIG = \"gitweb_config.perl\";\n+\tdo $GITWEB_CONFIG if -e $GITWEB_CONFIG;\n+\n+\t$projects_list = $projectroot;\n+\n+Then create the following script to get list of project in the format\n+suitable for GITWEB_LIST build configuration variable (or\n+$projects_list variable in gitweb config):\n+\n+\t#!/bin/sh\n+\n+\texport GITWEB_CONFIG=\"gitweb_make_index.perl\"\n+\texport GATEWAY_INTERFACE=\"CGI/1.1\"\n+\texport HTTP_ACCEPT=\"*/*\"\n+\texport REQUEST_METHOD=\"GET\"\n+\texport QUERY_STRING=\"a=project_index\"\n+\n+\tperl -- /var/www/cgi-bin/gitweb.cgi\n+\n \n Requirements\n ------------\n-- \n1.5.0.5\n"}]}