Before You Begin
Please read the following important notes before you begin installing BellaDati on Jetty:
- Make sure you have the right version of Java. See Installing Java for more details.
- Deploying multiple BellaDati WAR application in a single Jetty container is not supported. We do not test this configuration and updating any of the applications (even for point releases) is likely to break it.
- We recommend not deploying any other applications in the same Jetty container that runs BellaDati, especially if these other applications have large memory requirements or require additional libraries in Jetty's lib sub-directory. Multiple applications in a container can impact stability as a crash in one application could make the entire container inaccessible. Additionally, in order to update or reconfigure any of the applications, you'll need to restart the whole container.
1. Setup data warehouse
Please follow the instructions on the Setting up the PostgreSQL Database page.
2. Download and extract BellaDati WAR Archive
Download the BellaDati WAR distribution as a ZIP archive from the BellaDati download page and extract its content using a tool such as 7-Zip for Windows or Linux's GNU tar tools. Only one of the files in the ZIP archive is used for this setup - belladati.war
.
Avoid using Windows' built-in file extraction tool! This tool silently fails to extract files with long names. Other users have also reported problems with WinRAR.
Avoid using Solaris' default tar utility! Please use GNU tar on this operating system to extract BellaDati, as GNU tar handles long file names better.
3. Configure BellaDati WAR
You have successfully downloaded and extracted the BellaDati WAR distribution as described in the previous step. To configure Belladati, you need to extract and modify a configuration file placed inside the WAR archive by following these easy steps:
1. Extract application.properties
file from the WAR file using a tool such as 7-Zip for Windows or Linux's unzip tool.
unzip belladati.war WEB-INF/classes/conf/application.properties
2. Edit extracted file WEB-INF/classes/conf/application.properties
. Under JDBC properties, remove the # sign in the first line. Update jdbc.url, jdbc.username and jdbc.password to match your system configuration. You can remove all lines starting with # from the JDBC properties section. The configuration should look like:
# APPLICATION properties application.url=http://localhost:8080 application.production-mode=true application.secure-mode=false # JDBC properties jdbc.resource=jdbc/belladati_db # when connecting directly to the db jdbc.driverClassName=org.postgresql.Driver jdbc.url=jdbc:postgresql://db_host:5432/belladati_db jdbc.username=belladati_dbuser jdbc.password=password # SMTP properties smtp.server.address=localhost smtp.server.username= smtp.server.password= # EMAIL properties email.sender=support@belladati.com email.footer=BellaDati Inc. # OpenID properties application.mybelladati.url=https://my.belladati.com application.registration=http://www.belladati.com/try application.registration.openid= # Google analytics properties application.google-site-verification= application.google-analytics-account= application.google-analytics-account.mercato= # Lucene index dir lucene.indexes=indexes
Configuration settings are explained in detail in the BellaDati WAR Configuration Overview.
3. Save configuration file WEB-INF/classes/conf/application.properties
and update the WAR archive. On Linux, the command looks like:
zip -d belladati.war WEB-INF/classes/conf/application.properties zip -u belladati.war WEB-INF/classes/conf/application.properties
4. Copy the belladati.war
to $JETTY_HOME/webapps
.
4. Configure Jetty
4.1 Java environment
Before you start Jetty, make sure you have configured the JAVA_HOME variable, which points to the installed Java. You can do it in this way:
$ export JAVA_HOME=/path/to/jdk
You can also add the JAVA_HOME
parameter to /etc/default/jetty
. This will set the JAVA_HOME
variable whenever you start Jetty.
4.2 Configure Memory Settings in Jetty
Jetty memory settings need to be modified to avoid the following issue:
- BellaDati requires more memory than what Jetty provides by default. This may lead to
OutOfMemory
errors when running BellaDati if these memory settings are not increased.
To prevent this issue, follow the instructions below.
Set the JAVA_OPTIONS variable:
$ export JAVA_OPTIONS="-Xms1024m -Xmx2048m -XX:MaxPermSize=512m"
Alternatively, you can set the JAVA_OPTIONS parameter in the /etc/default/jetty
file:
JAVA_OPTIONS="-Xms1024m -Xmx2048m -XX:MaxPermSize=512m"
If you are using the Java Service Wrapper, follow these instructions:
Edit $JETTY_HOME/bin/jetty-service.conf
file (or create this file if it does not exist) and add the following to this file:
wrapper.java.additional.3=-Xms1024m wrapper.java.additional.4=-Xmx2048m wrapper.java.additional.5=-XX:MaxPermSize=512m wrapper.java.maxmemory=2048
For other environments and more information on memory settings, see the System Requirements.
Please note, that the value 2048MB
for -Xmx (max heap size) is dedicated for evaluation purposes only. Please refer to Recommended JVM Options article to find suggested settings for production deployments.
You can download the Java Service Wrapper for many different platforms.
4.3 Configure location for logs
The default location for logs generated by BellaDati (see Configure logging for more details) is relative to the exploded belladati.war which is not suitable for long term storage.
To change the logs directory, add a new JVM option -Dlogs.location=<location>, where <location> is the desired absolute path to the parent directory in which logs will be stored, to your Jetty (see section 4.2 for more details on how to do it).
5. Start or Restart Jetty
BellaDati is now ready to run in Jetty. You can start (or restart) the Jetty server with one of Jetty's start scripts (depends on Jetty version and your OS) from $JETTY_HOME directory:
bin/jetty.sh run
bin/Jetty-Service.exe
6. Run the Setup Wizard
Point your browser to http://localhost:8080/belladati
. This starts the Setup Wizard, which will take you through BellaDati's setup procedure.