我正在尝试使用HTTP身份验证在CentOS
上设置Gerrit,但获取" Service Temporarily Unavailable
"当我尝试在" http://x.x.x.x/gerrit/login/
"。
这似乎是Gerrit / Apache的一些配置问题。我试图更改设置但没有运气。
根据我的理解,因为我的Gerrit使用HTTP身份验证,因此Apache需要将身份验证传递给Gerrit,并且两者都应该在不同的端口上运行(我正在尝试这样做)。
我在这里(another question)通过其他问题为Gerrit的HTTP身份验证但无法通过。
这是我的gerrit.config
[gerrit]
basePath = git
canonicalWebUrl = http://localhost:8081/gerrit
[database]
type = h2
database = db/ReviewDB
[index]
type = LUCENE
[auth]
type = HTTP
[sendemail]
smtpServer = localhost
[container]
user = gerrit2
javaHome = /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79.x86_64/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://x.x.x.x:8081/
[cache]
directory = cache
这是我的/etc/httpd/conf/httpd.conf
的结尾<VirtualHost *:80>
ServerName www.example.org
ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location /gerrit/login/>
AuthType Basic
AuthName "Gerrit Code Review"
Require valid-user
AuthUserFile '/etc/httpd/gerrit.htpasswd'
</Location>
AllowEncodedSlashes On
ProxyPass /gerrit http://localhost:8081/gerrit
</VirtualHost>
答案 0 :(得分:0)
尝试更改位置标记的Apache配置 从
<Location /gerrit/login/>
到
<Location "/">
答案 1 :(得分:0)
您的listenUrl = http://x.x.x.x:8081/
应为listenUrl = http://x.x.x.x:8081/gerrit