通过http认证设置Gerrit

问题描述 投票:7回答:3

我正在尝试使用http baisc身份验证配置gerrit,我的httpd配置是

<VirtualHost *:8081>
    ServerName localhost

    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

    <Proxy *>
          Order deny,allow
          Allow from all
    </Proxy>

<Location "/login/">
AuthType Basic
AuthName "Gerrit Code Review"
AuthBasicProvider file
AuthUserFile /usr/local/apache/passwd/passwords
Require valid-user
</Location>
ProxyPass / http://localhost:8081/
</VirtualHost>

和我的gerrit.config是

[gerrit]
        basePath = git
        canonicalWebUrl = http://localhost:8081/
[database]
        type = mysql
        hostname = localhost
        database = reviewdb
        username = gerrit
[auth]
        type = HTTP
[sendemail]
        smtpServer = localhost
        smtpUser = gerrit
[container]
        user = gerrit
        javaHome = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = proxy-http://*:8081/
[cache]
        directory = cache

我不确定我要去哪里错,但是访问http://x.x.x.x:8081表示

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 '/': 

我的Gerrit运行在内置码头管理员上,我的操作系统是centos 6.4

我要去哪里错了??

apache http gerrit
3个回答
5
投票

好。实际上,我在端口8081上创建了一个虚拟主机,而我的Jetty(和gerrit一起)也在侦听同一端口,我的配置几乎保持不变,但是这些是附加步骤:-


3
投票

希望提供身份验证。使用HTTP身份验证时,它不允许匿名访问。


2
投票

您的配置存在一些问题:

© www.soinside.com 2019 - 2024. All rights reserved.