Tutorials

Task-driven tutorials and recipes for PageSeeder

How to configure CentOS/Amazon Linux for Berlioz

Skills requiredBasic Linux knowledge
Time required (minutes)30
Intended audienceDeveloper / Systems Administrator
DifficultyEasy
CategoryBerlioz

Objective

The purpose of this tutorial is to outline the steps required to prepare an installation of CentOS or Amazon Linux for PageSeeder and Berlioz. By the end of this tutorial you will have a working installation of PageSeeder and Jetty that can be used as a base for other PageSeeder and Berlioz tutorials.

Note

For developers that prefer the convenience of EC2 AMIs, a pre-configured AMI containing PageSeeder is available - search for ami-fdbf989e in public images. t2.medium is the smallest recommended instance size for running both Berlioz and PageSeeder. Once an instance has been instantiated, install Berlioz by following the tutorial from step 3 onwards.

Prerequisites

  • For a native install, a working install of CentOS 6-7, Amazon Linux, or another Red Hat-based distribution.
  • For a virtual install, any operating system supported by Vagrant.

Tutorial

This tutorial is written for Linux distributions based on, or derived from, Red Hat Enterprise Linux and Vagrant for Windows. Developers using Mac OS X and Linux can also use Vagrant, but in the interests of clarity, this tutorial is focused on Windows.

Install Vagrant on Windows

Note

Installing Vagrant requires administrator privileges on the host system.

Download the latest version of Vagrant from the following URL:


https://releases.hashicorp.com/vagrant/ 

Once downloaded, double-click on the MSI file to begin the installation. Accept the defaults, or change them as required. When the setup wizard is complete, click Finish and if prompted, restart Windows.

Configuring Vagrant

Once installed, initialise Vagrant in a working folder, and install a Vagrant box. Boxes are pre-built images that eliminate the need to manually install an Operating System. For this tutorial, the Vagrant box is built from CentOS 7.

Select a directory to use as a working folder, for example:

C:\Vagrant\Berlioz

Open a command prompt, and enter the following:

> mkdir C:\Vagrant\Berlioz
> cd C:\Vagrant\Berlioz
> vagrant init centos/7
> vagrant box add centos/7

If the folder was successfully initialised, you should see the following message:

A `Vagrantfile` has been placed in this directory. You are now ready
to `vagrant up` your first virtual environment! Please read the comments
in the Vagrantfile as well as documentation on `vagrantup.com` for more
information on using Vagrant.

to start the container, run

vagrant up

after the machine has booted, to enter the container, run

vagrant ssh

when the following shell prompt:

[vagrant@localhost ~]#

By default, Vagrant will synchronises the working folder with the

/home/vagrant

This allows you to add files to the box without the need to use external tools. For troubleshooting, refer to the Vagrant documentation, found at the following link:


https://docs.vagrantup.com/v2/ 

Install Java

Once CentOS 7 is installed virtually or natively, Java can be installed using the following command:

# sudo yum install -y java-1.8.0-openjdk

Use the following command to ensure that the OpenJDK 1.8.0 is the default Java:

# sudo alternatives --config java

When presented with a list of options, select the number appropriate for the version of Java installed and press <Enter>

Install Jetty

Unlike Java, a Jetty package is not available through standard distro repositories so it must be manually downloaded and installed.

As of the time of writing, the latest version of Jetty tested for PageSeeder and Berlioz is 9.2.14. For the Jetty home folder and Jetty base use these respective folders: 

/opt/jetty​
/opt/jetty/base

Enter the following commands to create the folder structure and download Jetty:

Create folder structure

# sudo mkdir -p /opt/jetty/base/logs
# cd /opt/jetty

Download Jetty

# sudo curl -O http://download.eclipse.org/jetty/9.2.14.v20151106/dist/jetty-distribution-9.2.14.v20151106.tar.gz
# sudo tar zxvf jetty-distribution-9.2.14.v20151106.tar.gz
# sudo ln -s jetty-distribution-9.2.14.v20151106 default

Create Jetty user

# sudo useradd --home-dir /opt/jetty jetty

Create Jetty defaults

# sudo cat <<EOF > /etc/default/jetty
JETTY_USER=jetty
JETTY_LOGS=/opt/jetty/base/logs
JAVA_OPTIONS="-Dberlioz.mode=live -Xdebug -Xrunjdwp:transport=dt_socket,address=6006,server=y,suspend=n"
JETTY_HOME=/opt/jetty/default
JETTY_BASE=/opt/jetty/base
EOF

Fix permissions

# sudo chown -R jetty:jetty /opt/jetty

Install Jetty as a service

# sudo ln -s /opt/jetty/default/bin/jetty.sh /etc/init.d/jetty
# sudo chkconfig jetty on
# sudo service jetty start

Install Berlioz

The Berlioz base can be downloaded from the Github repository:


https://github.com/pageseeder/berlioz-base 

Once the repository has been cloned, build the project in an appropriate development environment. The default folder for Berlioz installations is:

/opt/berlioz

Install PageSeeder (optional)

Java and MySQL Server are prerequisites for installing PageSeeder. 

Note

MySQL 5.7 is currently unsupported, and may result in unexpected application behaviour. MySQL 5.6 has been well tested and is the recommended version for new installations. MariaDB, a database that is binary compatible with MySQL and is available through the EPEL repository, will also work.

Install PageSeeder with the following commands:

# sudo yum install -y mysql-server
# sudo rpm -Uvh http://download.pageseeder.com/pub/rpm/pageseeder-repository-1.0-1.noarch.rpm
# sudo yum install -y pageseeder
# cd ~
# curl -O http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.36.tar.gz
# tar zxvf mysql-connector-java-5.1.36.tar.gz
# sudo service pageseeder config

For further instructions on configuring PageSeeder, see New installation.

Created on , last edited on