50,530
社区成员
发帖
与我相关
我的任务
分享
gerrit.config如下:
[gerrit]
basePath = git
canonicalWebUrl = http://192.168.253.5:8081/gerrit/
[database]
type = h2
database = db/ReviewDB
[auth]
type = HTTP
[sendemail]
smtpServer = localhost
[container]
user = gerrit
javaHome = /usr/java/jdk1.7.0_79/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = proxy-http://127.0.0.1:8081/gerrit/
[cache]
directory = cache
apache的httpd.conf如下:
<VirtualHost *>
ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location "/gerrit/login/">
AuthType Basic
AuthName "Gerrit Code Review"
AuthBasicProvider file
AuthUserFile /home/gerrit/review_site/etc/gerrit.passwd
Require valid-user
</Location>
AllowEncodedSlashes On
RedirectMatch ^/gerrit$ /gerrit/
ProxyPass /gerrit/ http://127.0.0.1:8081/gerrit/
ProxyPassReverse /gerrit/ http://127.0.0.1:8081/gerrit/
</VirtualHost>
Configuration Error
Check the HTTP server's authentication settings.
The HTTP server did not provide the username in the Authorization header when it forwarded the request to Gerrit Code Review.
If the HTTP server is Apache HTTPd, check the proxy configuration includes an authorization directive with the proper location, ensuring it ends with '/':
<VirtualHost 127.0.0.1:8081>
ServerName 127.0.0.1
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
...
</Location>
AllowEncodedSlashes On
ProxyPass /gerrit/ http://.../gerrit/ nodecode
</VirtualHost>