git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitweb install
@ 2006-11-20  1:15 lamikr
  2006-11-20  1:32 ` Jakub Narebski
  0 siblings, 1 reply; 3+ messages in thread
From: lamikr @ 2006-11-20  1:15 UTC (permalink / raw)
  To: Git Mailing List

Hi

Following dummyuser test case (me :-) might be usefull for improving docs.
I have read the gitweb/README but in addition of that I find out that
there is really little documentation about installing gitweb
except the Makefile & git-instaweb.sh itself.

I would like to install gitweb to /var/run/html/gitweb directory and
after reading the git/INSTALL & gitweb/README
I came to conclusion that something like following could work

1) build git by changing some of the default gitweb configs as a user
    make prefix=/usr all doc GITWEB_SITENAME='gitweb test'
GITWEB_PROJECTROOT=/var/www/html/gitweb 
2) install git as a root after build
    make prefix=/usr install install-doc
3) add following to apache config
    <VirtualHost www:80>
        ServerName my-web-page
        DocumentRoot /gitweb
        RewriteEngine on
        RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$
/cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
        SetEnv    GITWEB_CONFIG    /etc/gitweb.conf
    </VirtualHost>
4) move git repository (kernel for example) to /var/www/html/gitweb
5) restart apache
6) open browser to http://my-web-page/gitweb

Obviously something failed, as after step 2, I do not have either the
/etc/gitweb.conf or gitweb scripts under directory /var/www/html/gitweb

regards
    Mika
   

   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gitweb install
  2006-11-20  1:15 gitweb install lamikr
@ 2006-11-20  1:32 ` Jakub Narebski
  2006-11-20  2:29   ` lamikr
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Narebski @ 2006-11-20  1:32 UTC (permalink / raw)
  To: git

lamikr wrote:

> Hi
> 
> Following dummyuser test case (me :-) might be usefull for improving docs.
> I have read the gitweb/README but in addition of that I find out that
> there is really little documentation about installing gitweb
> except the Makefile & git-instaweb.sh itself.
> 
> I would like to install gitweb to /var/run/html/gitweb directory and
> after reading the git/INSTALL & gitweb/README
> I came to conclusion that something like following could work
> 
> 1) build git by changing some of the default gitweb configs as a user
>     make prefix=/usr all doc GITWEB_SITENAME='gitweb test' \
>          GITWEB_PROJECTROOT=/var/www/html/gitweb 
> 2) install git as a root after build
>     make prefix=/usr install install-doc
> 3) add following to apache config
>     <VirtualHost www:80>
>         ServerName my-web-page
>         DocumentRoot /gitweb
>         RewriteEngine on
>         RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
>         SetEnv    GITWEB_CONFIG    /etc/gitweb.conf
>     </VirtualHost>
> 4) move git repository (kernel for example) to /var/www/html/gitweb
It should be enough to symlink it, given appropriate setup.

> 5) restart apache
> 6) open browser to http://my-web-page/gitweb
> 
> Obviously something failed, as after step 2, I do not have either the
> /etc/gitweb.conf or gitweb scripts under directory /var/www/html/gitweb

First, "make install" does not install the gitweb, as the place where
it should be installed depends from configuration to configuration.
By the way, you may compile ony gitweb using "make gitweb/gitweb.cgi"
with appropriate params. So 2.1) step would be to manually copy
gitweb.cgi and gitweb.css at least, perhaps also git-logo.png and
git-favicon.png.

Second, you have to set up gitweb.cgi as a CGI script, or as legacy
mod_perl script. I have for example in /var/www/cgi-bin symlink named
gitweb to directory with gitweb.cgi, gitweb.css etc. and in
/var/www/perl symplink to the same place.

The CGI configuration for Apache2 is (simplest case, I'd appreciate
better solutions):

 LoadModule cgi_module modules/mod_cgi.so
 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
 <Directory "/var/www/cgi-bin">
    Options Indexes FollowSymlinks ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
 </Directory>

and can use for example http://localhost/cgi-bin/gitweb/gitweb.cgi

The mod_perl configuration for Apache2 is (again, I'd appreciate
pointing out better solution):

 # mod_perl configuration, c.f. CGI version
 #
 Alias /perl "/var/www/perl"
 <Directory "/var/www/perl">
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    Options Indexes FollowSymlinks +ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
 </Directory>

If you don't have conf.d/perl.conf, then you have also to add to
your apache config the line

 LoadModule perl_module modules/mod_perl.so

Well, mod_perl configuration could also be in the conf.d/perl.conf file.

I can use http://localhost/perl/gitweb/gitweb.cgi for mod_perl driven
gitweb.

HTH
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gitweb install
  2006-11-20  1:32 ` Jakub Narebski
@ 2006-11-20  2:29   ` lamikr
  0 siblings, 0 replies; 3+ messages in thread
From: lamikr @ 2006-11-20  2:29 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

Jakub Narebski wrote:
> lamikr wrote:
>
>   
>> Hi
>>
>> Following dummyuser test case (me :-) might be usefull for improving docs.
>> I have read the gitweb/README but in addition of that I find out that
>> there is really little documentation about installing gitweb
>> except the Makefile & git-instaweb.sh itself.
>>
>> I would like to install gitweb to /var/run/html/gitweb directory and
>> after reading the git/INSTALL & gitweb/README
>> I came to conclusion that something like following could work
>>
>> 1) build git by changing some of the default gitweb configs as a user
>>     make prefix=/usr all doc GITWEB_SITENAME='gitweb test' \
>>          GITWEB_PROJECTROOT=/var/www/html/gitweb 
>> 2) install git as a root after build
>>     make prefix=/usr install install-doc
>> 3) add following to apache config
>>     <VirtualHost www:80>
>>         ServerName my-web-page
>>         DocumentRoot /gitweb
>>         RewriteEngine on
>>         RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
>>         SetEnv    GITWEB_CONFIG    /etc/gitweb.conf
>>     </VirtualHost>
>> 4) move git repository (kernel for example) to /var/www/html/gitweb
>>     
> It should be enough to symlink it, given appropriate setup.
>   
Are people usually using symlinks to their "real development"
repositories? Or is it more common to have personal working repository
for example in the own home directory and then the second "public copy"
for http pages? And then configure the personal repository to push the
changes somehow to public one?
That would seem to be more secure even it rises the gap between real and
published changes.

>> 5) restart apache
>> 6) open browser to http://my-web-page/gitweb
>>
>> Obviously something failed, as after step 2, I do not have either the
>> /etc/gitweb.conf or gitweb scripts under directory /var/www/html/gitweb
>>     
>
> First, "make install" does not install the gitweb, as the place where
> it should be installed depends from configuration to configuration.
> By the way, you may compile ony gitweb using "make gitweb/gitweb.cgi"
> with appropriate params. So 2.1) step would be to manually copy
> gitweb.cgi and gitweb.css at least, perhaps also git-logo.png and
> git-favicon.png.
>   
Ok, I did that.
> Second, you have to set up gitweb.cgi as a CGI script, or as legacy
> mod_perl script. I have for example in /var/www/cgi-bin symlink named
> gitweb to directory with gitweb.cgi, gitweb.css etc. and in
> /var/www/perl symplink to the same place.
>
> The CGI configuration for Apache2 is (simplest case, I'd appreciate
> better solutions):
>
>  LoadModule cgi_module modules/mod_cgi.so
>  ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
>  <Directory "/var/www/cgi-bin">
>     Options Indexes FollowSymlinks ExecCGI
>     AllowOverride None
>     Order allow,deny
>     Allow from all
>  </Directory>
>   
Thanks, it seems that in Mandriva the preferred way it to put each of
these to own files under webapps.d directory.
So I created following /etc/httpd/conf/webapps.d/gitweb.conf by using
your script and cgi-script examples from httpd.conf as a help and got
things working.
   
# gitweb Apache configuration file
Alias /gitweb /var/www/gitweb
<Directory "/var/www/gitweb">
    AllowOverride All
    Options ExecCGI FollowSymLinks SymLinksifOwnerMatch
    Order allow,deny
    Allow from all
    RewriteEngine on
    RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$
/cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
    SetEnv    GITWEB_CONFIG    /etc/gitweb.conf
</Directory>

Is there btw, any examples from the /etc/gitweb.conf file?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-20  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-20  1:15 gitweb install lamikr
2006-11-20  1:32 ` Jakub Narebski
2006-11-20  2:29   ` lamikr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).