Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

testing LDAP on a Mac: Difference between revisions

From MoodleDocs
No edit summary
(format page)
Line 3: Line 3:
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:
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.
# 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.).
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.).
# 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):
# I opended the control panel, and changed the user.2 username for user2. i also changed his password for ‘admin’.
./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=*)”
# In the Moodle LDAP settings, I changed the following:
 
3- I opended the control panel, and changed the user.2 username for user2. i also changed his password for ‘admin’.
 
4- In the Moodle LDAP settings, I changed the following:


<pre>
Host URL: 127.0.0.1:1389 (it didn’t work without the port LDAP number)
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
Distinguished name: uid=user2,ou=People,dc=jerome,dc=moodle,dc=local
Password: admin
Password: admin
Contexts: ou=People,dc=jerome,dc=moodle,dc=local (you need this entire linet, just ‘ou=People’ doesn’t work.)
Contexts: ou=People,dc=jerome,dc=moodle,dc=local (you need this entire linet, just ‘ou=People’ doesn’t work.)
User attribut: uid
User attribute: uid
</pre>


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

Revision as of 00:29, 1 May 2013


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.