centos安装http协议的git server

#yum install httpd git git-daemon gitweb


#adduser git
#su git
#passwd
#cd ~/git


#cat ~/.ssh/goas.pub >> ~/.ssh/authorized_keys


#mkdir -p /data/repositories/v0/xconst.git
#ln -s /data/repositories/v0 /v0
#cd /v0/xconst.git
#git --bare init


#vim /etc/httpd/conf.d/git.conf


Alias /git /var/www/git

<Directory /var/www/git>
  Options FollowSymLinks +ExecCGI
  AddHandler cgi-script .cgi
  DirectoryIndex index.cgi gitweb.cgi
  Order allow,deny
  Allow from all
</Directory>

ScriptAlias /v0 /usr/libexec/git-core/git-http-backend/

<Directory "/usr/libexec/git-core/">
  SetEnv GIT_PROJECT_ROOT /v0
  SetEnv GIT_HTTP_EXPORT_ALL
  SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
  Options +ExecCGI
  Order allow,deny
  Allow from all
</Directory>


#vim  /etc/gitweb.conf


$projectroot = "/v0";


#chmod a+x /data
#chmod a+x /data/repositories
#chmod a+x /data/repositories/v0


#chkconfig --level 5 httpd on
#service httpd start
#service httpd restart

你可能感兴趣的:(git)