Howto - Change the default Scalix ldap port from 389

From Scalix Wiki
Revision as of 10:41, 26 November 2013 by Admin (Talk | contribs) (How is it done?)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Scalix 11

In Scalix 11, the switch to using the ldapmapper daemon rather than smtpd added a new requirement to running the LDAP daemon omslapd on a port other than 389.

Why do it?

So why does anyone want change the default LDAP port from port 389? There are a number of reasons for this, but the most common are:

  • Co-hosting with another LDAP server (e.g. for running a Samba-LDAP (smbldap) server on the same host)
  • Network or firewall restrictions

How is it done?

The LDAP port is specified in a number of files for Scalix, each used by different parts of the total solution. e.g. the mail server needs to know, so does the Admin Console, and so does the Web Appliciation. And, with the introduction of ldapmapper in Scalix 11, the ldapmapper needs to know what port its mapping to (it'll assume the default port, 389).

To actually do it, you need to edit the properties files for each major component in Scalix, as well as editing a config file that is used by the ldapmapper. The edits below can be made while Scalix is already running - but the changes won't propagate until a restart, as the properties files are only read on startup typically.

If you don't change the ldapmapper, then you'll get a lot of mail building up in the "Internet Mail Gateway" queue stuck on the outbound side. Your Scalix installation will receive mail just fine, and deliver locally, but Sendmail won't know how to contact the ldap server, and you'll get this error in /var/log/maillog

Jan 19 23:45:26 mail ldapmapper[4210]: cannot send search request to instance mail: No such object
Jan 19 23:45:26 mail sendmail[10458]: l0JCjQaa010458: SYSERR(root): Error getting LDAP results in map ldapsx: Unknown error 325

Note: If you're getting this message, and haven't been playing around with the ldap port, go read the Scalix 12 FAQs page :)

The example below assumes you're changing it to port 3890 - good for lazy typists, and to make it easier to remember what runs on the port at a later date.

Files to edit

The files you need to edit to make it all work with the new port are:

Note: The code snippets are not the complete files - they are just to highlight the relevant lines.


# server specific data
subschemaSubentry       "cn=subSchema,o=Scalix"
altServer                       ""
portNum                         3890


# Port number for the Scalix LDAP servers. The default is 389.
# If you change this number make sure all the sladp.conf file on
# all Scalix LDAP servers are changed to the same port here.


NOTE: This file has two lines that specify port number.



# ldap port (since 10.0.1 this can be different from 389)


Finally, don't forget to change the ldapmapper. This is the complete file, as it only has one config line. Notice the ldapmapper(8) part - there's a man page, so go check it out too if you're interested!

# Scalix ldapmapper(8) options
LDAPMAPPER_OPTIONS="-L ldap://%s:3890"

After the edits

Restart the all the Scalix processes.

# /etc/rc.d/init.d/scalix restart
# /etc/rc.d/init.d/scalix-tomcat restart

You can verify which port the LDAP server is running on. First, check its not on 389:

#lsof -i :389

That should return nothing, unless you've already jumped ahead and started openldap or some other LDAP server!

Then check the new port:

#lsof -i :3890
omslapd 20092 root    8u  IPv4 725279       TCP *:ndsconnect (LISTEN)

And you're all done - you can then set up whatever else you want to, or retire happily for a quiet beer.