LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2013, 11:32 AM   #1
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Rep: Reputation: Disabled
install gerrit with http authentication method


Hi All,
I am trying to install gerrit for git repository on CentOS Linux release 6.0 (Final). I could install it using database type as mysql and authentication type as OpenID. But since login is happening through OpenID such as google mail, yahoo mail etc... we don't wanted it to be via OpenID. So I wanted to install it using database type as mysql and authentication type as http. For that first I created user gerrit2 and downloaded gerrit-full-2.5.1.war and renamed as gerrit.war.
I followed the steps from this link as steps that I followed as in gerrit_installation.pdf attachment. After installation if I open
Code:
http://cent.mylocal.internal:8080/login/admin/projects/
giving error as in gerrit_error.png attachment. I had also tried by selecting yes for the field after selecting http authentication while installation as below.
Code:
Get username from custom HTTP header [y/N]? y
then also it was giving similar error. Then followed the guidance from that error to fix it and added the below entries in /etc/httpd/conf/httpd.conf file

Code:
NameVirtualHost *:80

<VirtualHost cent.mylocal.internal:8080>
    ServerName cent.mylocal.internal

    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

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

<Location /login/>
        AuthType Basic
        AuthName "Gerrit Code Review"
        Require valid-user
</Location>

    ProxyPass / http://.../
</VirtualHost>
then reloaded the httpd service, but couldn't get rid that error. Then followed the steps from here and changed the settings as below.
Code:
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin admin@cent.mylocal.internal
    ServerName cent
    ServerAlias cent
    ErrorLog "logs/error_log"
    CustomLog "logs/access_log" vcommon

    ProxyRequests Off
    ProxyVia Off
    ProxyPreserveHost On

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

    <Location /login/>
       AuthType Basic
       AuthName "Gerrit Code Review"
       AuthUserFile /credentials/users
       #AuthGroupFile /rddata/www/gerrit/groups
       #Require group review
       Order Deny,Allow
       Allow from all
    </Location>

    ProxyPass /login/ http://127.0.0.1:8080/login/
</VirtualHost>
saved the file and created gerrit2 user for http authentication and reloaded httpd service using,
Code:
htpasswd -c /credentials/users gerrit2
service httpd reload
But still getting same error as "The HTTP server did not provide the username in the Authorization header when it forwarded the request to Gerrit Code Review."
So please help me, I am trying for gerrit installation with http authentication since couple of days, but I couldn't.
Here is the configuration details & permissions
Code:
# ls -ld /gerrit/
drwxr-xr-x 3 gerrit2 gerrit2 4096 Jan 18 20:40 /gerrit/

# ls -l /gerrit/
total 4
drwxrwxr-x 12 gerrit2 gerrit2 4096 Jan 18 20:43 review_site

# ls -l /gerrit/review_site/
total 40
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 18 20:43 bin
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 18 20:43 cache
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 18 20:40 data
drwxrwxr-x 3 gerrit2 gerrit2 4096 Jan 18 20:43 etc
drwxrwxr-x 3 gerrit2 gerrit2 4096 Jan 18 20:43 git
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 18 20:42 lib
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 18 20:43 logs
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 18 20:43 plugins
drwxrwxr-x 2 gerrit2 gerrit2 4096 Jan 18 20:40 static
drwx------ 3 gerrit2 gerrit2 4096 Jan 18 20:43 tmp

[root@cent ~]# ls -l /gerrit/review_site/git/
total 4
drwxrwxr-x 7 gerrit2 gerrit2 4096 Jan 18 20:43 All-Projects.git

# cat /gerrit/review_site/etc/gerrit.config 
[gerrit]
	basePath = git
[database]
	type = MYSQL
	hostname = localhost
	database = reviewdb
	username = gerrit2
[auth]
	type = HTTP
[sendemail]
	smtpServer = localhost
[container]
	user = gerrit2
	javaHome = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
[sshd]
	listenAddress = *:29418
[httpd]
	listenUrl = http://*:8080/
[cache]
	directory = cache

# ls -ld /credentials/
drwxr-xr-x 2 root root 4096 Jan 18 21:03 /credentials/

# ls -l /credentials/
total 4
-rw-r--r-- 1 root root 22 Jan 18 21:03 users

# cat /credentials/users 
gerrit2:/uM6Da/r0vbYc
I don't know that what I am missing the entries in configuration files. I hope, my problem can be fixed with linuxquestions.org. Very thanks in advance for your kind help.
Attached Thumbnails
Click image for larger version

Name:	gerrit_error.png
Views:	128
Size:	151.9 KB
ID:	11643  
Attached Files
File Type: pdf gerrit_installation.pdf (58.5 KB, 157 views)

Last edited by roopakl; 01-18-2013 at 10:34 PM.
 
Old 01-18-2013, 10:37 PM   #2
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
Can anybody please help me to install gerrit with http authentication?
 
Old 01-20-2013, 07:47 AM   #3
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
Hi All,
Should we use only OpenID as authentication?
Can anybody come to this thread and help me to configure gerrit with authentication method as HTTP?
 
Old 04-22-2013, 03:29 PM   #4
catalan42
LQ Newbie
 
Registered: Jul 2012
Location: Carlsbad, CA
Distribution: Fedora
Posts: 1

Rep: Reputation: Disabled
Hi - I just ran into this same problem with a demo gerrit install. The solution I found for testing purposes is to use:


git config --file ~/etc/gerrit.config auth.type DEVELOPMENT_BECOME_ANY_ACCOUNT

Please note that THIS IS FOR TESTING ONLY! It disables all authentication!

Alan Thompson
 
Old 05-26-2016, 03:54 AM   #5
rashdev
LQ Newbie
 
Registered: May 2016
Posts: 1

Rep: Reputation: Disabled
Hi ALL,

I am facing the same problem.
I have Gerrit on my docker container and I am trying to configure with Gerrit authentication through apache.. and I encounter the problem

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


PLEASE HELP.

Rashmi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] http authentication with libxml2 manu-tm Programming 6 06-06-2011 07:57 AM
LXer: This week at LWN: Gerrit: Google-style code review meets git LXer Syndicated Linux News 0 11-18-2009 06:50 AM
execute a webtest with basic http authentication using perl's http::webtest mariogarcia Programming 1 04-07-2009 03:05 AM
mod_rewrite *and* http authentication belorion Linux - General 0 01-20-2005 05:05 PM
HTTP AUTHENTICATION with PHP lemotion Programming 1 04-22-2004 03:08 PM


All times are GMT -5. The time now is 04:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration