2.2.5 - Generic Instance Layout

This installer just contain everything needed to start ApacheDS but it will not create a daemon not a Windows Service. Would one like to start ApacheDS, it will have to start the apacheds.sh or apacheds.bat script shell.

The installer is just a raeball that needs to be oepend and deflated at the selected position :

tar xzpf apacheds-<version>.tar.gz

or

gunzip apacheds-<version>.zip

The layout is quite simple :

apacheds-<version>
  |
  +-- lib/
  |    |
  |    +-- apacheds-service-<version>.jar
  |
  +-- instances/
  |    |
  |    +-- default/
  |         |    
  |         +-- run/
  |         |    
  |         +-- partitions/
  |         |    
  |         +-- log/
  |         |    
  |         +-- conf/
  |         |    |
  |         |    +-- log4j.properties
  |         |    |
  |         |    +-- config.ldif
  |         |
  |         +-- cache/
  |
  +-- bin/
  |    |
  |    +-- apacheds.bat
  |    |
  |    +-- apacheds.sh
  |    |
  |    +-- cpappend.bat
  |    
  +-- NOTICE
  |
  +-- LICENSE

In order to start the server, you will have to make the shell script executable (it is not by default):

$ chmod u+x apacheds-<version>/bin/apacheds.sh

Starting the server

Starting the server is as simple as starting the script :

$ ./apacheds-<version>/bin/apacheds.sh start
Using ADS_HOME:    .../apacheds-<version>
Using JAVA_HOME:   /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/

Starting ApacheDS instance 'default'...
$

Stopping the server

The server is now started. To stop it, you have to execute this command :

$ ./apacheds-<version>/bin/apacheds.sh stop
Using ADS_HOME:    .../apacheds-<version>
Using JAVA_HOME:   /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/

Stoping ApacheDS instance 'default' running as 23080
ApacheDS instance 'default' stopped successfully

Selection a different instance

You can start many instances of the server, assuming you have duplicated the content of teh instances/default directory, and modified the instances/default/conf/config.ldif file (cahnge the transports so that there is no collision between servers)

Logs

You can check what’s going on in the apacheds-/instances//log/apacheds.log file, which is created using the configuration set in apacheds-/instances//conf/log4j.properties.

Typically, when you start the server, you will get such log :

$ more apacheds.log
[10:53:05] WARN [org.apache.directory.server.core.DefaultDirectoryService] - You didn't change the admin password of 
directory service instance 'default'.  Please update the admin password as soon as possible to prevent a possible 
security breach.

and from the apacheds-/instances//log/apacheds.out file, which contains everything the server writes on the console, you will read :

$ more apacheds.out 
[10:53:05] WARN [org.apache.directory.server.core.DefaultDirectoryService] - You didn't change the admin password of 
directory service instance 'default'.  Please update the admin password as soon as possible to prevent a possible 
security breach.
           _                     _          ____  ____   
          / \   _ __    ___  ___| |__   ___|  _ \/ ___|  
         / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \  
        / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) | 
       /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/  
               |_|                                       

Log configuration

You can configure the log level and content by changing the content of the /var/lib/apacheds-<version>/<instance>/<conf>/log4j.properties file.

The default configuration is given below :

log4j.rootCategory=WARN, R, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${apacheds.log.dir}/apacheds.log

log4j.appender.R.MaxFileSize=1024KB
# Keep some backup files
log4j.appender.R.MaxBackupIndex=5

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n

log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n

# with these we'll not get innundated when switching to DEBUG
log4j.logger.jdbm.recman.BaseRecordManager=FATAL
log4j.logger.org.apache.directory.server.OPERATION_LOG=FATAL
log4j.logger.org.apache.directory.server.OPERATION_TIME=FATAL
log4j.logger.org.apache.directory.api.CODEC_LOG=FATAL
log4j.logger.org.apache.directory.server.ACI_LOG=FATAL

# Replication logs
log4j.logger.org.apache.directory.server.PROVIDER_LOG=FATAL
log4j.logger.org.apache.directory.server.CONSUMER_LOG=FATAL

# Search log
log4j.logger.org.apache.directory.CURSOR_LOG=FATAL

# Other logs
log4j.logger.org.apache.directory.api=FATAL
log4j.logger.org.apache.directory.server=FATAL
log4j.logger.net.sf.ehcache=FATAL
log4j.logger.org.apache.mina=FATAL