Installation

This page explain how to install the Project Web Manager using the WAR release bundle.

In order to make the application work you'll need two mandatory things:
  • A data base (MySQL or MariaDB only for now)
  • A Java Application Web Server, such as Tomcat 7.x or whatever supporting Java Servlet v3.0
If you want better performances, you can complete the installation using an HTTP Web server (Apache or IIS).

Since this is a J2EE application, it can work on Windows or Unix.

Upgrade/Migration

If you already have a working copy of PWM, read the upgrade documentation.

The Data Base

For now, the only data base that is supported is MySQL and MariaDB. The project may not work on other data base due to specific SQL request, we'll keep you informed of any changes.

  • Download MySQL or MariaDB data base
  • Install the data base following the instructions regarding your environment (Windows or Unix)
  • Set a root password to your data base (up to you to define the root login and password)
  • Start your data base server (depending of your environment)
  • Prepare the database (commands are the same for MySQL and MariaDB):
    • Connect to the data base, in a console type:
      mysql -u root -p
      press enter, where root is the login of the root user of your data base (selected during the database installation).
    • MySQL will prompt you for the root password, type it.
    • Use the following code to create a database:
      create database IF NOT EXISTS project_m CHARACTER SET=UTF8;
      press enter to execute the request.
    • Use the following request to add a user in your data base that will be the root user of Project Web Manager:
      CREATE USER pwmroot IDENTIFIED BY 'yourPasswordForThisUser';
      press enter to execute the request.
      Where yourPasswordForThisUser is a secret password of your choice (don't loose it, you'll need it later).
    • Give pwmroot all rights on the project_m databse using the following request:
      GRANT ALL PRIVILEGES ON project_m.* TO 'pwmroot'@'localhost' IDENTIFIED BY 'yourPasswordForThisUser';FLUSH PRIVILEGES;
      press enter to execute the two requests.
      Those lines will grand access only if already connected to the computer holding the data base, you can change and complete if needed.
    • Exit the connexion as root, and reconnect as pwmroot:
      exit
      press enter to execute
      mysql -u pwmroot -p
      press enter and give the password for the pwmroot user.
    • Run the following commands that will create all tables and index used by Project Web Manager (execute as pwmroot user in a mysql session):
      source path/mysql-create.sql
      where path is the path to the script (ex: c:/toto/titi), press enter to execute.
      Note It may be necessary before loading the script to specify the targeted data base, in order to do so, simply use the following command:
      USE project_m;
      CAUTION whatever your platform is use '/' (and NOT '\'), and do not use spaces in the path, move the file if needed.
    • Exit the connexion:
      exit
      press enter to execute.

The data base is in place, in order to let people upload large file into it you'll need to change/add one line in your mysql data base configuration file.

Note that in PWM, each file can do 2Mg and you can post a maximum of 16M of files at the same time.

  • Stop your MySQL server (depending of your environment)
  • Find your data base configuration file (called myxxxxx.ini on Windows or myxxxx.cfg or myxxxx.cnf on Unix). Note that xxxx can be nothing or whatever you define as your MySQL server/instance.
  • Edit the file using your favourite editor.
  • Add or change in section [mysqld]
    max_allowed_packet=20M
  • Add or change in section [mysqldump]
    max_allowed_packet=20M
  • Save the file, and restart your MySQL server.

If you understand what you're doing you can also change other parameters for your MySQL server.

Do NOT forget to Re-Start your MySQL server.

The Java Application Web Server

As all J2EE application, you'll need a Java Application Web Server. In our cases, the only mandatory need is to support Servlet version 3.0 (read the documentation of your server for more details).

The following explanations show how to configure a Tomcat server

  • Download Tomcat (v7.x minimum) (choose the version depending of you system)
  • Unzip or install the downloaded file.
  • If you like, you can install APR libs for your Tomcat (http://tomcat.apache.org/native-doc/index.html)
  • Copy the following Jar to your Tomcat/lib directory regarding the targeted data base (stop it first if started):
    • For MySQL : mysql-connector-java-5.x.y-bin.jar downloadable here Please use the Platform Independent download.
    • For MariaDB : mariadb-java-client-1.x.x.jar downloadable here Select the JAR file for download.

Application Itself

Before starting the application, you'll need to:
  • set the data base access properly
  • configure the Spring mail service
  • configure the Spring temporary file service
  • configure the Spring super administrator service
  • configure the logs

Regarding the data base access:
  • Open the WAR file using a Zip program (such as 7-Zip for Windows or whatever tool you want)
  • Edit the file in META-INF directory called context.xml
  • In the file, you can change the login/password and database name
  • Change the login and password to match what you have done during the data base installation.
    ...
    username="pwmroot"
    password="yourPasswordForThisUser"
    ... />
  • If your data base is MySQL:
    ...
    driverClassName="com.mysql.jdbc.Driver"
    ... />
  • If your data base is MariaDB:
    ...
    driverClassName="org.mariadb.jdbc.Driver"
    ... />
  • Save your changes

Regarding the mail service configuration:
  • Open the WAR file using a Zip program (such as 7-Zip for Windows or whatever tool you want)
  • Edit the file in WEB-INF\classes\spring directory called mailBusinessServiceContext.xml
  • If you are using mail forwarding on your server, there is nothing to do, otherwise simply specify the following informations:
    • serverName will represent the name of the mail server, can be an IP or a DNS name
    • login will represent a login to use with the mail server if needed
    • password will represent a password to use with the mail server if needed
    • port will represent the mail server port
    • ssl indicate true if you want to use SSL
    • id the reference id used in other Spring services, you can create more than one mail service and use the id to build the link with other Spring services.
    <bean class="pwm.bs.mail.JavaMailService" id="Your-IMailService" ...>
     <property name="serverName" value="localhost" />
     <property name="forbidenDomain">
     <array>
      <value>1</value>
     </array>
     </property>
    </bean>

    Or an other example:
    <bean class="pwm.bs.mail.JavaMailService" id="Your-IMailService-2" ...>
     <property name="serverName" value="smtp.mydomain.com" />
     <property name="login" value="toto@mydomain.com" />
     <property name="password" value="titi" />
     <property name="port" value="587" />
     <property name="ssl" value="true" />
    </bean>
  • Save your changes
  • Meanwhile, you can change the IUserMailService Spring service and change the fromEmail property. This property is used when PWM needs to send an email to a user, it is the From of all emails send.
    <bean id="IUserMailService" ... >
     <property name="mailService" ref="Your-IMailService" />
    ...
     <property name="fromEmail" value="admin@mydomain.com"" />
    ...
    </bean>

    Notice the mailService property that point to your mail service id define previously.

Regarding the temporary file service configuration:
  • Open the WAR file using a Zip program (such as 7-Zip for Windows or whatever tool you want)
  • Edit the file called technicalServiceContext.xml in WEB-INF\classes\spring directory
  • You'll need to specify a directory where your Tomcat can read and write, this directory will contain temporary files.
    <bean id="IFileService" ...>
     <property name="directory" value="c:/temp/" />
    </bean>
  • Save your changes

Regarding the super user service configuration:
  • Open the WAR file using a Zip program (such as 7-Zip for Windows or whatever tool you want)
  • Edit the file in WEB-INF\classes\spring directory called technicalServiceContext.xml
  • You'll need to specify a login and a password for the super user administration console. This console is a mono user interface used for the creation of domain. You'll connect to it at next step. You can also indicate a locale to use (fr for french or en for english).
    <bean id="IAdminAuthenticationService" ...>
     <property name="login" value="toto" />
     <property name="password" value="titi" />
     <property name="locale" value="en" />
    </bean>
  • Save your changes. You can use whatever you want as login and password but you must set a login and a password.

Regarding the log configuration:
  • Open the WAR file using a Zip program (such as 7-Zip for Windows or whatever tool you want)
  • Edit the file in WEB-INF\classes\ directory called log4j.properties
  • At least, you'll need to change the log path.
    ...
    log4j.appender.localFile.File=c:/toto/titi.log
    ...
  • Save your changes. You can also change the mail configuration (remove it or change it).

Run The Application

Now is the time to deploy you WAR with the configuration of your choice.

Stop your application server.

Simply copy the WAR file in your server deployment directory (on Tomcat it is the webapps directory).

Start your application server.

Have a look at your logs, if no error login to the super user console: http://localhost:8080/pwm/adminLogon

Use your login/password set for the super user service.

Click on the golden key.

Create a domain by specifying the first administrator user and the license options. A user will be created and an email will be send with its login/password information.

Quit the super user console (use the plug near the golden key).

Have a look at your logs, if no error login using the main application: http://localhost:8080/pwm/logon