Skip to end of metadata
Go to start of metadata

This page is designed to show how to integrate Roller 5.1 with LDAP (Apache DS). The below instructions have been tested on Ubuntu, Tomcat 7.x and JDK 7 with the following Apache DS releases:

Install Roller and Test

If you're new to installing Roller, it's best to first install with regular database username/password security following the Roller Install Guide.  This will make sure that your JDK, database, mail server, etc., are all properly configured and running, providing a good foundation prior to bringing in LDAP authentication.  For Roller, the first user created automatically has admin rights, so perhaps advisable to use the same username here as the uid of the future Admin user in the LDAP configuration below (using "rolleradmin" in the next section, but that can be changed as desired), although with a different password from the one in LDAP.  Using a different password will allow you to confirm that you're authenticating via Roller database now, and later (using the LDAP password) via LDAP.

After confirming you can create a user, a blog for that user, and a blog entry, proceed onward for configuring LDAP. 

Activating Apache Directory Server

The instructions below do not provide a full tutorial on how to configure ApacheDS, refer to its documentation for comprehensive information.  This provides minimal information just to demonstrate LDAP authentication. 

There are several ways to install and start Apache DS, depending on the operating system you're using.  Ubuntu proved unusually clumsy, the Debian packages would not work for me so I used the standard .tar.gz download instead.  Then I needed to do the following to activate ApacheDS on Ubuntu (Steps #1-#3 are Ubuntu-specific, Steps #4 onward should be the same for all environments):

  1. Define a system environment variable $ADS_HOME pointing to my ADS install directory (used by $ADS_HOME/bin/apacheds.sh).
  2. Edit the apacheds.sh script, replacing the $RUN_JAVA and associated quotes around it with the path to your java.exe:  eval /path/to/jdk/bin/java $JAVA_OPTS $ADS_CONTROLS...
  3. From the ApacheDS home folder, run "sudo bash bin/apacheds.sh default start" (note necessary use of "bash" for Ubuntu) from the command prompt.  Then run the command again, if you get a complaint that it's already running you're in good shape, further confirmation can be had by checking the instances/default/log/apacheds.out file, you should see the ApacheDS ASCII art message indicating a successful activation.   
  4. Next, install and activate Apache Directory Studio.
  5. Create a new LDAP Connection with the following settings:
    • Connection Name: Local ApacheDS
    • Hostname: localhost
    • Port: 10389
    • Encryption: No Encryption
    • (Click Next)
    • Bind DN or user: uid=admin,ou=system
    • Bind password: secret
    • (Click Finish)
  6. Download roller.ldif to your Desktop. This file contains an "rolleradmin" account with password "adminldap" (both of course should be changed for an actual installation) as well as Groups and People organizational units.
  7. In Apache Directory Studio, right click on dc=example,dc=com and select Import > LDIF Import...
  8. Select roller.ldif for the LDIF file and click Finish. You may get an error during the import, but it should add entries successfully.
  9. Under the dc=example,d=com heading add additional users under rolleradmin with different passwords.

Configuring Roller to use LDAP authentication

Now that we have our users in our LDAP directory, we'll configure Roller to authenticate against them.  Make sure Roller is shut down before proceeding, so the new configuration will be detected on startup:

  1. Alter your roller-custom.properties to activate LDAP:

    If you aren't using Apache DS, you may need to alter the attribute values Roller uses to bring in the LDAP data elements.

  2. Alter the security.xml located in the WEB-INF folder of the roller.war file, switching authentication from normal password to LDAP following the instructions given in the comments in that file.  The default Apache DS LDAP password (secret) should of course be changed to that of your LDAP installation.
  3. Start Tomcat and login to your blog with rolleradmin/adminldap (the password here as defined in the roller.ldif file downloaded).  By confirming that your LDAP password is working but your prior database-created one is no longer, you'll know that the LDAP authentication method has being activated.
  4. Go to the Blog Server Administration settings page and click the "Allow New Users?" setting to let other users log in with their LDAP usernames and passwords.  As those other users log in, Roller will present them an opportunity to create their new blogs.

 

Any questions with LDAP configuration, please contact the Roller User's mailing list.

  • No labels