Gitorious无法连接到Active Directory(authentication.yml)


1

我已经成立了Gitorious。使用本地数据库,一切正常。我的所有日​​志和配置文件都包含在内。问题是,当我使用活动目录配置Gitorious进行身份验证时,我想访问gitorious.localdomain。我从nginx收到502 Bad Gateway错误。

更新:如果我重命名或删除authentication.yml文件。我没有收到错误,我可以连接本地数据库。所以我认为错误必须在authentication.yml中,但我仍然无法解决它。

这是我的authentication.yml

production:
disable_default: true
methods:
    - adapter: Gitorious::Authentication::LDAPAuthentication
    host: activedirectory.lab

    # Override the default port (389)
    #port: 1999

    # The base DN to search
    #base_dn: DC=domain,DC=local

    # The base DN when searching for groups (for authorization)
    # If unspecified, base_dn is used
    group_search_dn: OU=ouname,dc=domainname,dc=local

    # What LDAP attribute to use for user authentication. Default is CN
    # login_attribute: uid  

    # How to build a user's DN. Default: $LOGIN_ATTRIBUTE={},$BASE_DN,
    # e.g. CN=chris,DC=gitorious,DC=org
    distinguished_name_template: "{}@thename.local"

    bind_user:
    username: user@thename.local
    password: Password

    # When using LDAP authorization: which attribute in a user
    # record specifies groups a user is member of
    # This will depend on your schema/LDAP server implementation
    # but in 9/10 cases, it will be memberof
    membership_attribute_name: memberof

    # When using LDAP authorization: which attribute in a group
    # record specifies users that are member of the group
    # This will depend on your  LDAP schema, but will usually be
    # member or uniquemember
    members_attribute_name: member

在文件gitorious.yml中。我没有注释下一个规则:

use_ldap_authorization:true

“/var/log/nginx/access.log”的输出:

10.203.40.148 - - [08 / Apr / 2013:12:12:56 +0200]“GET / HTTP / 1.1”502 575“ - ”“Mozilla / 5.0(Windows NT 6.2; WOW64)AppleWebKit / 537.31(KHTML,like Gecko)Chrome / 26.0.1410.43 Safari / 537.31“” - “10.203.40.148 - - [08 / Apr / 2013:12:12:56 +0200]”GET /favicon.ico HTTP / 1.1“502 575” - “” Mozilla / 5.0(Windows NT 6.2; WOW64)AppleWebKit / 537.31(KHTML,如Gecko)Chrome / 26.0.1410.43 Safari / 537.31“” - “

“/var/log/nginx/error.log”的输出

2013/04/08 12:12:56 [错误] 1571#0:* 9 connect()到unix:///var/www/gitorious/app/tmp/pids/unicorn.sock失败(111:拒绝连接)连接到上游时,客户端:10.203.40.148,服务器:gitorious.localdomain,请求:“GET / HTTP / 1.1”,上游:“ http:// unix:/// var / www / gitorious / app / tmp / pids /unicorn.sock:/ “,主持人:”10.203.40.150“2013/04/08 12:12:56 [错误] 1571#0:* 9 connect()到unix:/// var / www / gitorious / app /tmp/pids/unicorn.sock失败(111:连接被拒绝),同时连接到上游,客户端:10.203.40.148,服务器:gitorious.localdomain,请求:“GET /favicon.ico HTTP / 1.1”,上游:“ http: //unava:///var/www/gitorious/app/tmp/pids/unicorn.sock:/favicon.ico “,主持人:”10.203.40.150“

“bundle exec rails c RAILS_ENV = production script / test_ldap_connection username password”的输出

README相同的app / controllers / application_controller.rb相同的app / helpers / application_helper.rb相同的config / database.yml相同的config / routes.rb相同的config / locales / en.yml相同的db / seeds.rb相同的config / initializers / backtrace_silencers。 rb相同的config / initializers / inflections.rb相同的config / initializers / mime_types.rb相同的config / initializers / new_rails_defaults.rb覆盖config / initializers / session_store.rb?(输入“h”寻求帮助)[Ynaqdh] y force config / initializers / session_store.rb覆盖config / initializers / cookie_verification_secret.rb?(输入“h”寻求帮助)[Ynaqdh] y force config / initializers / cookie_verification_secret.rb相同的配置/环境。

log / production.log的输出

[root @Gitorious app] #tail log / production.log #Logfile创建于2008年4月8日星期四11:35:56 +0200 2013 [root @Gitorious app]#

Answers:


0

在authentication.yml中,您的base_dn行被注释掉了,您是否尝试过使用此集并取消注释?

取消注释后,尝试从app目录运行“RAILS_ENV = production script / test_ldap_connection username password”。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.