32.3 Gerrit的配置文件
Gerrit的配置文件保存在部署目录下的etc/gerrit.conf文件中。如果对安装时的配置不满意,可以手工修改配置文件,重启Gerrit服务即可。
全部采用默认配置时的配置文件:
[gerrit]
basePath=git
canonicalWebUrl=http://localhost:8080/
[database]
type=H2
database=db/ReviewDB
[auth]
type=OPENID
[sendemail]
smtpServer=localhost
[container]
user=gerrit
javaHome=/usr/lib/jvm/java-6-openjdk/jre
[sshd]
listenAddress=*:29418
[httpd]
listenUrl=http://*:8080/
[cache]
directory=cache
如果采用LDAP认证,下面的配置文件片断配置了一个支持匿名绑定的LDAP服务器配置。
[auth]
type=LDAP
[ldap]
server=ldap://localhost
accountBase=dc=foo,dc=bar
groupBase=dc=foo,dc=bar
如果采用MySQL而非默认的H2数据库,下面的配置文件显示了相关配置。
[database]
type=MYSQL
hostname=localhost
database=reviewdb
username=gerrit
LDAP绑定或与数据库连接的用户口令保存在etc/secure.config文件中。
[database]
password=secret
下面的配置将Web服务架设在Apache反向代理的后面。
[httpd]
listenUrl=proxy-https://*:8081/gerrit