testing LDAP on a Mac: Difference between revisions
From MoodleDocs
(format page) |
David Mudrak (talk | contribs) m (Text replacement - "<code>" to "<syntaxhighlight lang="php">") |
||
Line 5: | Line 5: | ||
# 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): < | # 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=*)”</code> | ||
# 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: |
Revision as of 13:04, 14 July 2021
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:
- 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.).
- 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=*)”
- 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:
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.