Gerrit服务器安装

本文详细介绍了如何在Ubuntu18.04.1LTS上配置Gerrit和Apache2服务器,包括Gerrit的服务器配置、数据库设置、权限管理、邮件通知等,以及Apache2的端口配置、虚拟主机设置、代理配置和认证机制。同时提供了重启服务和检查错误日志的命令。

操作系统: Ubuntu 18.04.1 LTS

1 Gerrit服务器配置

/gerrit/review_site/etc/gerrit.config

[gerrit]
        basePath = git
        serverId = dd637df1-2fd7-4e5b-8932-e3b2f6ad796b
        canonicalWebUrl = http://192.168.1.147:8081/
[database]
        type = h2
        database = /home/gerrit/review_site/db/ReviewDB
[noteDb "changes"]
        disableReviewDb = true
        primaryStorage = note db
        read = true
        sequence = true
        write = true
[index]
        type = LUCENE
[auth]
        type = HTTP
[receive]
        enableSignedPush = false
[sendemail]
        smtpServer = smtp.163.com
        smtpUser = wwchaonj@163.com
[container]
        user = root
        javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = http://192.168.1.147:8081/
[cache]
        directory = cache

重启gerrit服务器命令:

/gerrit/review_site# ./bin/gerrit.sh restart

2 Apache2服务器配置

/etc/apache2/ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 8080

/etc/apache2/sites-available/gerrit.conf

<VirtualHost *:8080>
     
    ServerName 192.168.1.147
 
    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On
 
    <Proxy *>
          Order deny,allow
          Allow from all
    </Proxy>
 
    <Location "/login/">
        AuthType Basic
        AuthName "Gerrit Code Review"
        Require valid-user
        AuthBasicProvider file
        AuthUserFile /home/gerrit/review_site/password
    </Location>
 
    AllowEncodedSlashes On
    
    ProxyPass / http://192.168.1.147:8081/
 
</VirtualHost>

重启apache2服务器命令:

# systemctl restart apache2

查看apache2服务器错误日志:

# tail -f /var/log/apache2/error.log

查看服务器监听状态:

# netstat -ltnp
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值