Nov 4, 2021 2:49:28 PM Thomas Dumont avatar

Installation of a Lutèce application

Tools required

See Required tools installation for the tools required to install a Lutèce application.

Preliminary configurations

Before launching the build of the application, either from the sources of a Lutèce component or from a site, it will be necessary to ensure that the properties needed for the functioning of the core and of the components are properly completed. Refer to the documentation to find out which properties need to be changed.

The modification of each properties file can be done either by modifying the original file in the sources (if it exists), or by creating an overload of it. You can read the Site specific configuration and How lutece-maven-plugin works wikis to learn more about how to provide file overloads for a Lutece application.

The following configurations are valid for all applications.

Configuration of the database

Among the properties to be informed, the connection to the database of your application is defined in a db.properties file from Lutèce Core. You will have to modify the portal.url, portal.user and portal.password properties of this file depending on your database server.

Example for a MySQL database:

portal.url=jdbc:mysql://localhost/my_db_name?autoReconnect=true&useUnicode=yes&characterEncoding=utf8
portal.user=root
portal.password=password

See the section Connection pools and db.properties in Access to data for more information on configuring db.properties.

Plugin initialization data (optional)

The file plugins.dat located in the application in the folder WEB-INF/plugins is a property file brought back by Lutèce Core and used to initialize when the application is started for the first time regarding plugins.

Two properties can be defined :

  • a property indicating whether the plugin is installed. If the property has the value 1, the plugin will be installed. If the property is not present or has another value, the plugin will not be installed.
  • a property indicating the name of the connection pool to use for the plugin. If the property is not present the pool portal will be used by default.

Each plugin is referenced from the name given to it in its descriptor (plugin-specific file located in the same directory as plugins.dat; the name is located in the name tag at the start of the file).

Example :

myplugin.installed=1
myplugin.pool=mypool

Build and deploy the application

Build the project

Check in the file pom.xml that the version of the lutece-global-pom in the tag parent is well above or equal to 5.1.0 for the components and 3.1.0 for the sites (and correct if necessary).

Launch an application build to take into account this new configuration:

  • for a component

$ mvn clean lutece:exploded

  • for a site

$ mvn clean lutece:site-assembly

Initialization of the database

Issue the following Ant command to initialize a database for the application:

$ ant -f target/<exploded_directory>/WEB-INF/sql/build.xml

where <exploded_directory> is the name of the folder in which the application files have been placed :

  • with the lutece:exploded goal, this folder is named lutece
  • with the lutece:site-assembly goal, this folder is named according to the artifactId and the version of the project (see in the pom.xml of the project)

A new database is then created on the database server based on the information in db.properties.

Info With the lutece:exploded goal, you can also use the antrun:run goal which does the same processing as this command. The order made in the previous paragraph could therefore be as follows :

$ mvn clean lutece:exploded antrun:run

Configuration and launch of Tomcat

We can now deploy our site on Tomcat.

To do this, modify the server.xml file in the tomcat/conf folder of your Tomcat, by adding a Context tag :

<Host ...>
    ...
    <Context docBase="(...)/myapp/target/<exploded_directory>" path="/myapp" workDir="(...)/myapp/target/<exploded_directory>/work" />
</Host>

where <exploded_directory> is the name of the folder in which the application files have been placed :

  • with the lutece:exploded goal, this folder is named lutece
  • with the lutece:site-assembly goal, this folder is named according to the artifactId and the version of the project (see in the pom.xml of the project)

Start Tomcat and then check that the site is accessible on the URL http://localhost:8080/myapp/ (replace the port used by tomcat if necessary, for example 8084).

Info If you use NetBeans, you can consult the wiki corresponding to setting up Tomcat from NetBeans.

Configuration of the application in Back Office

Access to the Back Office

Go to the administration section of the site at http://localhost:8080/myapp/jsp/admin/AdminMenu.jsp and authenticate with the default admin account :

  • login : admin
  • password : adminadmin

Change password

If your application must contain sensitive data or access working resources (business APIs, SI...), you will need to change the default password for the admin account. To do this in the drop-down menu at the top right of the Back Office screen, click on Password. Once the change has been made, you will need to log in again.

Activation of plugins

In the System menu, select the entry Plugins management. On the page that appears, activate all the necessary plugins by clicking on the green buttons on the right of the screen.

Update of the rights of the admin user

Select in the menu Managers the entry Users management. On the screen that appears, select the Update button of the user admin.

On the corresponding page, go to the Rights tab, then check the boxes corresponding to the functionalities to which you wish to access, and apply the modifications by clicking on the button Apply rights list at the bottom of the page.

Depending on what you want to use, it may also be necessary to update the roles and workgroups of the admin user in the corresponding tabs by pressing Update again at the admin user level.