Gerrit - 安装配置GitWeb
1 - GitWeb简介
GitWeb是一个支持在Web页面上查看代码以及提交信息的工具。
安装GitWeb工具并且集成到Gerrit中,就可以直接在Gerrit的项目列表中查看项目的代码信息。
2 - 安装GitWeb
启动gerrit服务
[gerrit@mt101 ~]$ sudo gerrit_testsite/bin/gerrit.sh start
Starting Gerrit Code Review: OK
[gerrit@mt101 ~]$
[gerrit@mt101 ~]$ sudo service nginx start
Redirecting to /bin/systemctl start nginx.service
[gerrit@mt101 ~]$
通过yum安装GitWeb
[gerrit@mt101 ~]$ sudo yum -y install gitweb
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
mongodb-org-4.0 | 2.5 kB 00:00:00
nginx-stable | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package gitweb.noarch 0:1.8.3.1-20.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================
Package Arch Version Repository Size
=====================================================================================================
Installing:
gitweb noarch 1.8.3.1-20.el7 base 112 k
Transaction Summary
=====================================================================================================
Install 1 Package
Total download size: 112 k
Installed size: 320 k
Downloading packages:
gitweb-1.8.3.1-20.el7.noarch.rpm | 112 kB 00:00:07
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : gitweb-1.8.3.1-20.el7.noarch 1/1
Verifying : gitweb-1.8.3.1-20.el7.noarch 1/1
Installed:
gitweb.noarch 0:1.8.3.1-20.el7
Complete!
[gerrit@mt101 ~]$
3 - 设置projectroot目录
配置文件:/etc/gitweb.conf
[gerrit@mt101 ~]$ sudo vim /etc/gitweb.conf
[gerrit@mt101 ~]$ sudo cat /etc/gitweb.conf |grep -v "#" |grep -Ev "^$"
our $projectroot = "/home/gerrit/gerrit_testsite/git"
[gerrit@mt101 ~]$
4 - 配置GitWeb的httpd服务
4.1 配置GitWeb路径
GitWeb是基于httpd服务工作的,配置文件:/etc/httpd/conf.d/git.conf
[gerrit@mt101 ~]$ sudo cat /etc/httpd/conf.d/git.conf
Alias /git /var/www/git
<Directory /var/www/git>
Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex gitweb.cgi
</Directory>
[gerrit@mt101 ~]$
[gerrit@mt101 ~]$ sudo vim /etc/httpd/conf.d/git.conf
[gerrit@mt101 ~]$
[gerrit@mt101 ~]$ sudo cat /etc/httpd/conf.d/git.conf
Alias /gitweb /var/www/git
SetEnv GITWEB_CONFIG /etc/gitweb.conf
<Directory /var/www/git>
Options +ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
AddHandler cgi-script .cgi
DirectoryIndex gitweb.cgi
</Directory>
[gerrit@mt101 ~]$
4.2 配置服务端口
在/etc/httpd/conf/httpd.conf
中配置服务端口
[gerrit@mt101 ~]$ sudo cat /etc/httpd/conf/httpd.conf |grep -v "#" |grep -Ev "^$" |grep -i listen
Listen 80
[gerrit@mt101 ~]$
[gerrit@mt101 ~]$ sudo vim /etc/httpd/conf/httpd.conf
[gerrit@mt101 ~]$ sudo cat /etc/httpd/conf/httpd.conf |grep -v "#" |grep -Ev "^$" |grep -i listen
Listen 8084
[gerrit@mt101 ~]$
4.3 重启httpd服务
[gerrit@mt101 ~]$ sudo systemctl restart httpd.service
[gerrit@mt101 ~]$ sudo systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2019-12-10 22:57:22 CST; 9s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 3432 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Main PID: 3439 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
Tasks: 7
CGroup: /system.slice/httpd.service
├─3439 /usr/sbin/httpd -DFOREGROUND
├─3440 /usr/sbin/httpd -DFOREGROUND
├─3441 /usr/sbin/httpd -DFOREGROUND
├─3442 /usr/sbin/httpd -DFOREGROUND
├─3443 /usr/sbin/httpd -DFOREGROUND
├─3444 /usr/sbin/httpd -DFOREGROUND
└─3445 /usr/sbin/httpd -DFOREGROUND
Dec 10 22:57:16 mt101 systemd[1]: Starting The Apache HTTP Server...
Dec 10 22:57:21 mt101 httpd[3439]: AH00558: httpd: Could not reliably determine the server's f...sage
Dec 10 22:57:22 mt101 systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[gerrit@mt101 ~]$
4.4 开放防火墙
[gerrit@mt101 ~]$ sudo firewall-cmd --zone=public --permanent --add-port=8084/tcp
success
[gerrit@mt101 ~]$ sudo firewall-cmd --reload
success
[gerrit@mt101 ~]$ sudo firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3 enp0s8
sources:
services: ssh dhcpv6-client
ports: 8080/tcp 80/tcp 83/tcp 8083/tcp 8084/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[gerrit@mt101 ~]$
5 - 访问GitWeb
6 - 和Gerrit集成
6.1 更新Gerrit配置文件
增加如下部分
[gitweb]
type = gitweb
cgi = /var/www/git/gitweb.cgi
[gerrit@mt101 ~]$ sudo vim gerrit_testsite/etc/gerrit.config
[gerrit@mt101 ~]$ sudo cat gerrit_testsite/etc/gerrit.config
[gerrit]
basePath = git
canonicalWebUrl = http://192.168.16.101:8083/
serverId = 0b911b9e-195a-46b0-a5cd-b407b776b344
[container]
javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
user = root
javaHome = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-2.b14.el7.x86_64/jre
[index]
type = lucene
[auth]
type = HTTP
[receive]
enableSignedPush = false
[sendemail]
smtpServer = localhost
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://192.168.16.101:8083/
[cache]
directory = cache
[gitweb]
type = gitweb
cgi = /var/www/git/gitweb.cgi
[gerrit@mt101 ~]$
6.2 修改git配置
[gerrit@mt101 ~]$ git config --file /home/gerrit/gerrit_testsite/etc/gerrit.config gitweb.cgi /var/www/git/ gitweb.cgi
[gerrit@mt101 ~]$ git config --file /home/gerrit/gerrit_testsite/etc/gerrit.config --unset gitweb.url
[gerrit@mt101 ~]$
6.3 重启Gerrit服务
[gerrit@mt101 ~]$ sudo gerrit_testsite/bin/gerrit.sh restart
Stopping Gerrit Code Review: OK
Starting Gerrit Code Review: OK
[gerrit@mt101 ~]$
6.4 重新登录,确认GitWeb链接
BROWSE---》Repositories---》Repository Browser---》gitweb链接
点击All-Project的gitweb链接
6.5 配置GitWeb访问权限
默认只有Gerrit管理员用户才有GieWeb的访问权限。
BROWSE---》Repositories---》All-Projects---》Access---》Reference: refs/meta/config
在“refs/meta/config”的Read选项中添加“Registered Users”的ALLOW 权限
Gerrit - 安装配置GitWeb的更多相关文章
- gerrit安装配置记录
gerrit安装配置 java -jar gerrit-2.13.5.war init -d gerrit Authentication method [OPEN/?]: htt Install Ve ...
- Gerrit安装配置
环境: CentOS 1611 + gerrit-2.11.4 (review.openstack.org) 1. 安装java1.8 (>1.7) [root@review ~]# yum i ...
- 安装配置gerrit
Centos 安装配置gerrit 关闭selinux,不然nginx的反向代理会报错connect() to 127.0.0.1:8080 failed (13: Permission denied ...
- gerrit+nginx+centos安装配置
安装环境 centos 6.8 gerrit-full-2.5.2.war 下载地址:https://gerrit-releases.storage.googleapis.com/gerrit-ful ...
- Gerrit+apache+H2数据库简单安装配置及建库流程
Gerrit 是一个基于 Web 的代码评审和项目管理的工具,面向基于 Git 版本控制系统的项目.因此需要Apache.Mysql.GIT等相关软件的支持 系统配置: 新装的UBANTU LINUX ...
- Gerrit安装
1.安装gerrit [sisi@pre-srv44 ~]$ su - gerrit2Password: [gerrit2@pre-srv44 ~]$ lltotal 83872-rw-r--r-- ...
- Gerrit2安装配置
我主要根据下面这个文章而安装,遇到一些小问题,记录如下:2016.4.30 安装 2.12.2,要将加密的东东全装上!!!注意 1) 由于新的git-bash ...
- Centos7安装配置gitlab
Centos7安装配置gitlab 这篇文字我会介绍在Centos7上安装gitlab,配置gitlab的smtp,并且创建项目demo. sudo yum install openssh-serve ...
- Git服务器的Gitosis安装配置及gitignore的使用方法
Git服务器Gitosis安装设置 1.安装 openssh服务器 sudo apt-get install openssh-server openssh-client 2.创建个人公钥和私钥 在默认 ...
随机推荐
- redux学你参考网站
redux官方网站 http://cn.redux.js.org/docs/api/combineReducers.html https://www.redux.org.cn 从设计的角度看Redux ...
- python语言(五)匿名函数、读写excel、操作数据库、加密、redis操作
一.匿名函数 递归:就是调用自己 def func(): num = int(input('num:')) if num % 2 ==0: print('是偶数') return else: func ...
- 注解 @EnableFeignClients 工作原理
概述在Spring cloud应用中,当我们要使用feign客户端时,一般要做以下三件事情 : 使用注解@EnableFeignClients启用feign客户端:示例 : @SpringBootAp ...
- 少女NULL中
NULL inline void read (int &now) { register ; ; !isdigit (word); word = getchar ()) ; + word - ' ...
- Zookeeper——一致性协议:Zab协议
Reference: https://www.jianshu.com/p/2bceacd60b8a 什么是Zab协议 Zab 协议的作用 Zab 协议原理 Zab 协议核心 Zab 协议内容 原子广播 ...
- K8S集群搭建——基于CentOS 7系统
环境准备集群数量此次使用3台CentOS 7系列机器,分别为7.3,7.4,7.5 节点名称 节点IPmaster 192.168.0.100node1 192.168.0.101node2 192. ...
- maven 无法引入包 报错 处理方式
<!--orderquery thrift client定义--> <dependency> <groupId>com.sankuai.qcs</groupI ...
- 【转】gdb typeid 详解
在揭开typeid神秘面纱之前,我们先来了解一下RTTI(Run-Time Type Identification,运行时类型识别),它使程序能够获取由基指针或引用所指向的对象的实际派生类型, ...
- 【转】Android原生PDF功能实现
1.背景 近期,公司希望实现安卓原生端的PDF功能,要求:高效.实用. 经过两天的调研.编码,实现了一个简单Demo,如上图所示.关于安卓原生端的PDF功能实现,技术点还是很多的,为了咱们安卓开发的同 ...
- spatiaLite