简体   繁体   中英

Gerrit with Apache2 - The HTTP server did not provide the username in the Authorization header when it forwarded the request to Gerrit Code Review

I have problem with gerrit instalation with HTTP auth.

This is my gerrit.config:

[gerrit]
    basePath = git
    serverId = fee746a4-35f5-43e5-a39f-e2e77ce5bd7c
    canonicalWebUrl = http://127.0.0.1:9091/
[database]
    type = h2
    database = /home/mapa/gerrit_example/db/ReviewDB
[auth]
    type = HTTP
[receive]
    enableSignedPush = false
[sendemail]
    smtpServer = localhost
[container]
    user = root
    javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
[sshd]
    listenAddress = *:29418
[httpd]
    listenUrl = http://*:9090/
[cache]
    directory = cache

and my virtualhost config on apache:

Listen 9091
<VirtualHost *:9091>
    ServerName 127.0.0.1
    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 /media/sf_shared/.htpasswd
        Require valid-user
    </Location>
    AllowEncodedSlashes On
    ProxyPass / http://127.0.0.1:9090/
</VirtualHost>

All what I get is result

I have followed other tutorials and solutions for similar problems but with no result.

Your Apache work on port 9091, and gerrit on canonicalWebUrl = http://127.0.0.1:9091/ (Apache and gerrit must work on diferent ports)

Your Apache redirect to ProxyPass / http://127.0.0.1:9090/

try to use canonicalWebUrl = http://127.0.0.1:9090/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM