Note:

This site is no longer used and is in read-only mode. Instead please go to our new Moodle Developer Resource site.

testing LDAP on a Mac: Difference between revisions

From MoodleDocs
format page
Note about plan not to migrate this page to the new developer resources. See template for more info.
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Template:WillNotMigrate}}
{{stub}}
{{stub}}


Line 5: Line 6:
# I had Moodle installed with Apache LDAP module installed too.
# I had Moodle installed with Apache LDAP module installed too.
# I downloaded OpenDS for Mac and installed it.  I changed the hostname for jerome.moodle.local.  Which is translated into dc=jerome,dc=moodle,dc=local. I didn’t change cn= Directory Manager. I set the password to ‘admin’. Finally I selected to generate 5 users (if you missed out this step, you can uninstall and reinstall the server. That’s what I did when I ended up to have some difficulties to create a new user.).
# I downloaded OpenDS for Mac and installed it.  I changed the hostname for jerome.moodle.local.  Which is translated into dc=jerome,dc=moodle,dc=local. I didn’t change cn= Directory Manager. I set the password to ‘admin’. Finally I selected to generate 5 users (if you missed out this step, you can uninstall and reinstall the server. That’s what I did when I ended up to have some difficulties to create a new user.).
# To test if the LDAP server was correctly installed I run the following command line (in OpenDS/bin folder): <code>./ldapsearch -h 127.0.0.1 -p 1389 -b uid=user2,ou=People,dc=jerome,dc=moodle,dc=local -D “uid=user2,ou=People,dc=jerome,dc=moodle,dc=local” -w admin “(objectClass=*)”</code>
# To test if the LDAP server was correctly installed I run the following command line (in OpenDS/bin folder): <syntaxhighlight lang="php">./ldapsearch -h 127.0.0.1 -p 1389 -b uid=user2,ou=People,dc=jerome,dc=moodle,dc=local -D “uid=user2,ou=People,dc=jerome,dc=moodle,dc=local” -w admin “(objectClass=*)”</syntaxhighlight>
# I opended the control panel, and changed the user.2 username for user2. i also changed his password for ‘admin’.
# I opended the control panel, and changed the user.2 username for user2. i also changed his password for ‘admin’.
# In the Moodle LDAP settings, I changed the following:
# In the Moodle LDAP settings, I changed the following:

Latest revision as of 13:47, 24 June 2022


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.



It was quite a battle to install a LDAP server on my mac and make it work with Moodle. Here are the steps for OpenDS in Mac OSX Lion:

  1. I had Moodle installed with Apache LDAP module installed too.
  2. I downloaded OpenDS for Mac and installed it. I changed the hostname for jerome.moodle.local. Which is translated into dc=jerome,dc=moodle,dc=local. I didn’t change cn= Directory Manager. I set the password to ‘admin’. Finally I selected to generate 5 users (if you missed out this step, you can uninstall and reinstall the server. That’s what I did when I ended up to have some difficulties to create a new user.).
  3. To test if the LDAP server was correctly installed I run the following command line (in OpenDS/bin folder):
    ./ldapsearch -h 127.0.0.1 -p 1389 -b uid=user2,ou=People,dc=jerome,dc=moodle,dc=local -D “uid=user2,ou=People,dc=jerome,dc=moodle,dc=local” -w admin (objectClass=*)
    
  4. I opended the control panel, and changed the user.2 username for user2. i also changed his password for ‘admin’.
  5. In the Moodle LDAP settings, I changed the following:
Host URL: 127.0.0.1:1389 (it didn’t work without the port LDAP number)
Distinguished name: uid=user2,ou=People,dc=jerome,dc=moodle,dc=local
Password: admin
Contexts: ou=People,dc=jerome,dc=moodle,dc=local (you need this entire linet, just ‘ou=People’ doesn’t work.)
User attribute: uid

Note: disconnect your computer from the network, otherwise the LDAP server could send requests everywhere and you could be banned.