Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
We provide installers for various OSes (Linux, Windows, macOSX) and architectures (32 bits and 64 bits). We also provide generic binaries which don't install a daemon.
This document explains how those installers are working, for people who want to get deep into the process. As it, this document is not targeting users, but rather developers.
We support:
It's convenient to have a package that can be installed as a daemon. We provide such package. We use a wrapper (Tanuki)
It's quite easy. You need to be in the installers module and launch mvn clean install -P where is one of :
NOTE: In order to be able to build the rpm, windows and deb packages, you need to install the following tools:
You'll need to run the installers using this command line:
mvn clean install -Pdebian -Dinstallers.dpkg=/usr/local/bin/dpkg
You'll need to run the installers using this command line:
mvn clean install -Prpm -Dinstallers.dpkg=/usr/local/bin/rpmbuild
You'll need to run the installers using this command line:
mvn clean install -Pwindows -Dinstallers.makensis=/usr/local/bin/makensis
Building a bin installer generates two files :
Those files are scripts concatenated with a tar file. The script will ask you to validate the Apache license, extract the tar file, launch the install.sh script and cleanup temporary files once the installation is done. Here is the layout of the installer once executed, before the installation is ran:
/ | +--/instance | | | +-- config.ldif | | | +-- etc-initd-script | | | +-- log4j.properties | | | +-- wrapper-instance.conf | +--/server | | | +--/bin | | | | | +-- apacheds* | | | | | +-- wrapper* | | | +--/conf | | | | | +-- wrapper.conf | | | +--/lib | | | | | +-- apacheds-service-2.0.0.AM27-SNAPSHOT.jar | | | | | +-- apacheds-wrapper-2.0.0.AM27-SNAPSHOT.jar | | | | | +-- libwrapper.so | | | | | +-- wrapper-3.2.3.jar | | | +-- NOTICE | | | +-- LICENSE | +--/sh | +-- functions.sh* | +-- install.sh* | +-- variables.sh*
The way the instal.sh script works is that it uses the variable.sh file content to configure the server: each variable (@@) in the /server/bin/apacheds script will be substituted with the default value or the provided value. Here is an exalple of what happens when the script is executed:
$ ./install.sh Where do you want to install ApacheDS? [Default: /opt/apacheds-] Where do you want to install ApacheDS instances? [Default: /var/lib/apacheds-] What name do you want for the default instance? [Default: default] Where do you want to install the startup script? [Default: /etc/init.d]
Here are the variables that can be configured :
Once the installer has been run, the server files are located in various places :
/opt/apacheds-2.0.0.AM27-SNAPSHOT | +-- /bin | | | +-- apacheds* | | | +-- wrapper* | +-- /conf | | | +-- wrapper.conf | +-- /lib | +-- apacheds-service-2.0.0.AM27-SNAPSHOT.jar | +-- apacheds-wrapper-2.0.0.AM27-SNAPSHOT.jar | +-- libwrapper.so | +-- wrapper-3.2.3.jar . . . /var/lib/apacheds-2.0.0.AM27-SNAPSHOT | +-- /default | +-- /conf | | | +-- config.ldif | | | +-- log4j.properties | | | +-- wrapper-instance.conf | +-- /log | +-- /partitions | +-- /run . . . /etc/rc.d/init.d | +-- apacheds-2.0.0.AM27-SNAPSHOT-default
In the process, a user and group will be created if they didn't exist beforhand.
NOTE: if one want to run the server with a port under 389, there are some configuration to change, as this is a privileged port.
This plugin just create the initial installer, copying various files in the right place before creating the tar file.
At the end, it calls the createInstaller.sh script that will generate the final package.
Debugging one of the installers maven plugins in Eclipse is quite easy:
NOTE: If you were to modify the plugin, do not forget to recompile it before debugging it !