HTTP Authentication - Configuration Error

463 views
Skip to first unread message

pmes...@gmail.com

unread,
Apr 29, 2015, 10:21:14 AM4/29/15
to repo-d...@googlegroups.com
Hello All,

After many investigation I cannot get gerrit to work!

Get Configuration Error
Check the HTTP server's authentication settings.

gerrit.config
[gerrit]
        basePath = /srv/repos/git
        canonicalWebUrl = http://localhost:8081/gerrit/
[database]
        type = h2
        database = db/ReviewDB
[index]
        type = LUCENE
[auth]
        type = HTTP
[sendemail]
        smtpServer = localhost
[container]
        user = gerrit
        javaHome = /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.7.el7_1.x86_64/jre
[sshd]
        listenAddress = *:29418
[httpd]
        #listenUrl = proxy-http://*:8080/gerrit/
        listenUrl = http://*:8080/gerrit/
        #listenUrl = proxy-http://127.0.0.1:8081/r/
[cache]
        directory = cache

gerrit.conf
<VirtualHost *:80>
        ServerName server

        ProxyRequests Off
        ProxyVia Off
        ProxyPreserveHost On

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

        <Location /gerrit/>
          AuthType Basic
          AuthName "Gerrit Code Review"
          AuthUserFile /home/gerrit/config/gerrit.htpasswd/
          Require valid-user
          Order Deny,Allow
          Allow from all
        </Location>

        ErrorLog logs/gerrit_error_log
        AllowEncodedSlashes On
        #ProxyPass /gerrit/ http://localhost:8081/gerrit/ nocanon
        ProxyPass /gerrit http://127.0.0.1:8080/gerrit nocanon
        #ProxyPassReverse /gerrit/ http://localhost:8081/gerrit/
</VirtualHost>


What is missing?
Location for Apache should be?
Is there a need to make symbolic links or something?

Edwin Kempin

unread,
Apr 29, 2015, 10:23:41 AM4/29/15
to pmes...@gmail.com, Repo and Gerrit Discussion
Which version of Apache are you using?
 
        </Proxy>

        <Location /gerrit/>
          AuthType Basic
          AuthName "Gerrit Code Review"
          AuthUserFile /home/gerrit/config/gerrit.htpasswd/
          Require valid-user
          Order Deny,Allow
          Allow from all
        </Location>

        ErrorLog logs/gerrit_error_log
        AllowEncodedSlashes On
        #ProxyPass /gerrit/ http://localhost:8081/gerrit/ nocanon
        ProxyPass /gerrit http://127.0.0.1:8080/gerrit nocanon
        #ProxyPassReverse /gerrit/ http://localhost:8081/gerrit/
</VirtualHost>


What is missing?
Location for Apache should be?
Is there a need to make symbolic links or something?

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pmes...@gmail.com

unread,
Apr 29, 2015, 10:31:28 AM4/29/15
to repo-d...@googlegroups.com, pmes...@gmail.com
Hello and thank you for replay.
Server version: Apache/2.4.6 (CentOS)

Edwin Kempin

unread,
Apr 29, 2015, 10:34:31 AM4/29/15
to pmes...@gmail.com, Repo and Gerrit Discussion
2015-04-29 16:31 GMT+02:00 <pmes...@gmail.com>:
Hello and thank you for replay.
Server version: Apache/2.4.6 (CentOS)
Well, then you should change your configuration as suggested in this change.

pmes...@gmail.com

unread,
Apr 30, 2015, 5:24:44 AM4/30/15
to repo-d...@googlegroups.com, pmes...@gmail.com
Updated and still have the same problem...

pmes...@gmail.com

unread,
May 7, 2015, 5:58:45 AM5/7/15
to repo-d...@googlegroups.com
Tried with nginx and still having the same problem.

server {
    listen 80;
    server_name gerrit;

    access_log  /home/gerrit2/review/logs/nginx_log_error.txt;

#    location / {
#      proxy_set_header Host $host;
#      proxy_set_header X-Real-IP $remote_addr;
#      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#      proxy_pass http://localhost:8081;
#    }   

    location / {
                   proxy_pass   http://127.0.0.1:8081;
                   proxy_set_header X-Forwarded-For $remote_addr;
                   proxy_set_header Host $host;
        #auth_basic "off";   
        auth_basic "Restricted";
                   auth_basic_user_file /etc/nginx/.htpasswd;
           }


}

Can someone please help
Reply all
Reply to author
Forward
0 new messages