Application Path
The application path is the primary configuration and working directory for an instance of PWM. Each instance of PWM must have its own unique application path. The following contents are stored in the application path directory:
The path value is given as an absolute directory path on the local file system. The PWM application must have full permissions to create, modify and delete folders in this directory. The directory must already be exist when PWM is started, it will not be automatically created.
Older versions of PWM did not require the application path to be set and would automatically use the exploded war directory's
WEB-INF
directory as the application path. This is no longer done automatically, and having the application path be within the exploded war or anywhere in the application server's directory structure is
not recommended.
The application will read the PWM_APPLICATIONPATH variable to determine the location of the application path. Relative paths are not permitted.
Because you set this value at the OS level, it will make maintaining and updating the application easier because you will not need to change anything other than
applying a new war
file.
export PWM_APPLICATIONPATH='/home/user/pwm-data'
This environment variable would typically be set as part of an init or other script file that starts your application server.
set "PWM_APPLICATIONPATH=c:\pwm-data"
This environment variable is typically set as part of a .bat
file that starts your application server, or possibly as a system-wide environment variable via the windows control panel.
The application will read the java system property pwm.applicationPath variable to determine the location of the application path. Relative paths are not permitted. These example parameters would be added to the java command line that starts the application server (tomcat) and java process.
-Dpwm.applicationPath='/home/user/pwm-data'
-Dpwm.applicationPath="c:\pwm-data"
Modify the servlet WEB-INF/web.xml
file. You must modify the application war file to accomplish this method. This method accommodates multiple
applications on a single application server. File paths must be absolute.
This method is not recommended because updates to the WAR will overwrite the web.xml and you will need to re-apply any changes.
<context-param>
<description>...</description>
<param-name>applicationPath</param-name>
<param-value>/home/user/pwm-data</param-value>
</context-param>
<context-param>
<description>...</description>
<param-name>applicationPath</param-name>
<param-value>c:\pwm-data</param-value>
</context-param>
export PWM_APPLICATIONFLAGS='ManageHttps,NoFileLock'
The environment variables and system properties listed above, such as PWM_APPLICATIONPATH
and pwm.applicationPath
assume the default context name of
/pwm
is used.
Context | Java System Property Name | Environment Variable Name |
/pwm | pwm.applicationPath or pwm.pwm.applicationPath | PWM_APPLICATIONPATH or PWM_PWM_APPLICATIONPATH |
/acme | pwm.acme.applicationPath | PWM_ACME_APPLICATIONPATH |
/acme2 | pwm.acme2.applicationPath | PWM_ACME2_APPLICATIONPATH |
In case of conflict, the application path parameters are evaluated in the following order.
Other PWM Environment Properties
The applicationPath
property is just one of many that can be set. The following properties also exist, and are set the same way as the applicationPath
describe above. Additionally, properties can also be set using a application.properties file in the root of the
applicationPath
directory, though in that case the keys do not need a context prefix.
Flag | Behavior |
applicationPath | Root of the application path directory as discussed above. |
ManageHttps | Enable the setting category HTTPS Server |
NoFileLock | Disable the file lock in the application path directory. |
InstanceID | Override the default random-generated InstanceID value |