22
0
Fork 0
wiki/HowtoGitWeb.md

91 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2016-12-29 11:25:39 +01:00
**Cette page a été importée automatiquement de notre ancien wiki mais n'a pas encore été révisée.**
# HowtoGitWeb
## Prérequis
Installation de gitweb et highlight :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
2017-01-14 00:06:38 +01:00
# aptitude install gitweb highlight
2016-12-29 11:25:39 +01:00
~~~
### Configuration Nginx
Installation de fcgiwrapper :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
2017-01-14 00:06:38 +01:00
# aptitude install fcgiwrap
2016-12-29 11:25:39 +01:00
~~~
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
Modifier /etc/gitweb.conf et remplacer les lignes suivantes :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/pub/git";
$projects_list = $ENV{'GITWEB_PROJECTLIST'} || $projectroot;
~~~
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
Rajout de la conf highlight :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
cat >> /etc/gitweb.conf <<CONF
\$feature{'highlight'}{'default'} = [1];
CONF
~~~
## Configuration
Choix de l'utilisateur $GIT :
* $GIT : utilisateur propriétaire des dépots
* dépôts présent dans /home/$GIT/repositories
* accès git:// depuis $GIT@votre-domaine.tld
~~~
GIT='git'
~~~
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
Configuration du vhost :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
cat > /etc/nginx/sites-available/gitweb_$GIT <<VHOST
server {
server_name $GIT.$(hostname -d);
listen 0.0.0.0:80;
listen [::]:80;
root /usr/share/gitweb;
location / {
index gitweb.cgi;
include fastcgi_params;
gzip off;
fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
fastcgi_param GITWEB_PROJECTROOT /home/$GIT/repositories;
fastcgi_param GITWEB_PROJECTLIST /home/$GIT/projects.list;
if (\$uri ~ "/gitweb.cgi") {
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
}
access_log /var/log/nginx/gitweb.access.log;
error_log /var/log/nginx/gitweb.error.log;
}
VHOST
~~~
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
Activation du vhost :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
ln -s /etc/nginx/sites-available/gitweb_$GIT /etc/nginx/sites-enabled/gitweb_$GIT
~~~
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
Donne l'accès en lecture au dépôts à l'utilisateur www-data :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
addgroup www-data $GIT
~~~
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
Redémarre le démon fcgiwrap :
2017-01-03 11:20:35 +01:00
2016-12-29 11:25:39 +01:00
~~~
service fcgiwrap restart
2017-01-03 11:20:35 +01:00
~~~