1

我正在尝试让 ldap 身份验证在 Plone 4.2 版上工作。我已经在这个问题上敲了几个小时,但没有结果。我什至尝试过这些步骤:

  1. 安装 python-ldap 2.6 (C:\Python26)
  2. 使用安装程序安装 Plone 4.2 (D:\Plone)
  3. 在 EGG 和 ZCML 部分中使用 plone.app.ldap 编辑 buildout.cfg
  4. 在 D:\Plone\buildout-cache\eggs\ 中创建一个名为 python_ldap-2.3.12-py2.6.egg 的新文件夹
  5. 复制 C:\Python26\lib\site-packages\python_ldap-2.3.12-py2.6.egg-info 到 D:\Plone\buildout-cache\eggs\python_ldap-2.3.12-py2.6.egg\ 和重命名为 EGG-INFO
  6. 还将 C:\Python26\lib\site-packages\ 中的 ldap 文件夹复制到 D:\Plone\buildout-cache\eggs\python_ldap-2.3.12-py2.6.egg\
  7. 还将文件 ldapurl.py 复制到 C:\Python26\lib\site-packages\ 到 D:\Plone\buildout-cache\eggs\python_ldap-2.3.12-py2.6.egg\
  8. 下一个副本: 文件夹:C:\Python26\lib\site-packages\python_ldap-2.3.12-py2.6.egg-info 文件夹:C:\Python26\lib\site-packages\ldap 到 D:\Plone\python \Lib\站点包
  9. 启动命令框并运行 bin\buildout
  10. 启动 Plone,以管理员身份登录并转到额外产品部分。在这里您将找到 LDAP 产品。安装它并输入您的 LDAP 详细信息。

这些都没有真正帮助。当我尝试 bin/buildout 时,我收到以下消息:

Installing instance.
Getting distribution for 'dataflake.fakeldap'.
zip_safe flag not set; analyzing archive contents...

Installed /tmp/easy_install-oISsVG/dataflake.fakeldap-1.0/setuptools_git-0.4.2-py2.6.egg
Got dataflake.fakeldap 1.0.
Generated script '/usr/local/Plone/zinstance/bin/instance'.
Installing zopepy.
Generated interpreter '/usr/local/Plone/zinstance/bin/zopepy'.
Installing zopeskel.
Generated script '/usr/local/Plone/zinstance/bin/zopeskel'.
Generated script '/usr/local/Plone/zinstance/bin/paster'.
Updating backup.
Updating chown.
chown: Running 
echo Dummy references to force this to execute after referenced parts
echo /usr/local/Plone/zinstance/var/backups sudo -u plone
chmod 600 .installed.cfg
find /usr/local/Plone/zinstance/var -type d -exec chmod 700 {} \;
chmod 744 /usr/local/Plone/zinstance/bin/*
Dummy references to force this to execute after referenced parts
/usr/local/Plone/zinstance/var/backups sudo -u plone
Updating repozo.
Updating unifiedinstaller.
*************** PICKED VERSIONS ****************
[versions]
Products.LDAPMultiPlugins = 1.14
Products.LDAPUserFolder = 2.23
Products.PloneLDAP = 1.1
collective.sendaspdf = 2.6
dataflake.fakeldap = 1.0
jquery.pyproxy = 0.4.1
plone.app.ldap = 1.2.8

*************** /PICKED VERSIONS ***************

当我尝试 bin/buildout 时,它说守护进程已启动并给出一个 id,但是当我尝试 localhost:8080 时,它说“问题加载页面”并且页面未加载。我尝试使用 bin/instance fg 来显示错误,并关注消息。

bin/instance fg
2012-07-24 08:53:18 INFO ZServer HTTP server started at Tue Jul 24 08:53:18 2012
        Hostname: 0.0.0.0
        Port: 8080
2012-07-24 08:53:18 INFO Zope Set effective user to "plone"
2012-07-24 08:53:19 WARNING SecurityInfo Conflicting security declarations for "setText"
2012-07-24 08:53:19 WARNING SecurityInfo Class "ATTopic" had conflicting security declarations
2012-07-24 08:53:19 ERROR Application Could not import Products.LDAPMultiPlugins
Traceback (most recent call last):
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/OFS/Application.py", line 606, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/__init__.py", line 22, in <module>
    from Products.LDAPMultiPlugins.LDAPMultiPlugin import addLDAPMultiPluginForm
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/LDAPMultiPlugin.py", line 29, in <module>
    from Products.LDAPUserFolder import manage_addLDAPUserFolder
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/__init__.py", line 20, in <module>
    from Products.LDAPUserFolder.LDAPUserFolder import LDAPUserFolder
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPUserFolder.py", line 52, in <module>
    from Products.LDAPUserFolder.LDAPDelegate import filter_format
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPDelegate.py", line 19, in <module>
    import ldap
  File "/usr/local/Plone/buildout-cache/eggs/python_ldap-2.3.12-py2.6.egg/ldap/__init__.py", line 22, in <module>
    from _ldap import *
ImportError: No module named _ldap
Traceback (most recent call last):
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/run.py", line 76, in <module>
    run()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/run.py", line 22, in run
    starter.prepare()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/__init__.py", line 86, in prepare
    self.startZope()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/Startup/__init__.py", line 259, in startZope
    Zope2.startup()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/Zope2/App/startup.py", line 67, in startup
    OFS.Application.import_products()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/OFS/Application.py", line 583, in import_products
    import_product(product_dir, product_name, raise_exc=debug_mode)
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.15-py2.6.egg/OFS/Application.py", line 606, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/__init__.py", line 22, in <module>
    from Products.LDAPMultiPlugins.LDAPMultiPlugin import addLDAPMultiPluginForm
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPMultiPlugins-1.14-py2.6.egg/Products/LDAPMultiPlugins/LDAPMultiPlugin.py", line 29, in <module>
    from Products.LDAPUserFolder import manage_addLDAPUserFolder
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/__init__.py", line 20, in <module>
    from Products.LDAPUserFolder.LDAPUserFolder import LDAPUserFolder
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPUserFolder.py", line 52, in <module>
    from Products.LDAPUserFolder.LDAPDelegate import filter_format
  File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.23-py2.6.egg/Products/LDAPUserFolder/LDAPDelegate.py", line 19, in <module>
    import ldap
  File "/usr/local/Plone/buildout-cache/eggs/python_ldap-2.3.12-py2.6.egg/ldap/__init__.py", line 22, in <module>
    from _ldap import *
ImportError: No module named _ldap

我究竟做错了什么?帮助将不胜感激

4

2 回答 2

1

您的构建成功运行,那里没有问题。您选择的某些软件包没有固定,因此您的构建报告了它为您选择的版本。

您的服务器本身确实没有运行,因为您安装的 Python LDAP egg 似乎安装不正确。缺少库buildout-cache/eggs/python_ldap-2.3.12-py2.6.egg/ldap/_ldap.so文件。

删除整个鸡蛋 ( rm -rf buildout-cache-eggs/python_ldap-2.3.12-py2.6.egg) 确保您的系统上安装了 OpenLDAP 2.x 库和头文件(在 Ubuntu 和 Debian 上libldap2-dev应该足够了)。然后重新运行 buildout 以重新安装 egg。

或者,您可以尝试安装系统python-ldap包(删除鸡蛋),然后看看 buildout 是否会选择它。

于 2012-07-24T07:14:55.783 回答
0

您需要安装 2 个库:

sudo apt-get install libldap2-dev

sudo apt-get install libsasl2-dev

希望这会有所帮助。

于 2013-07-26T08:08:14.490 回答