0

I am trying to setup Gerrit on CentOS using HTTP authentication but getting "Service Temporarily Unavailable" when I tried to access it on "http://x.x.x.x/gerrit/login/".

It seems that this is some configuration issue with Gerrit/Apache. I tried to change the settings but no luck.

As per my understanding since my Gerrit is on HTTP authentication so Apache needs to pass the authentication to Gerrit and both should be running on different ports(which is I am trying to do).

I gone through the other questions over here(another question) for HTTP auth for Gerrit but unable to get through.

This is my 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

This is my end of /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>
Community
  • 1
  • 1
Garry
  • 4,493
  • 3
  • 28
  • 48

2 Answers2

0

Try change Apache configuration of location tag from

<Location /gerrit/login/>

to

<Location "/">
hsiaoairplane
  • 511
  • 4
  • 15
0

Your listenUrl = http://x.x.x.x:8081/ should be listenUrl = http://x.x.x.x:8081/gerrit

Neil
  • 664
  • 6
  • 16