Personal Services: Raspberry Pi Setup

Submitted by code_admin on Mon, 07/23/2018 - 11:01

How to install Personal Services on a Raspberry Pi

This article describes the process to set-up a full Personal Services server on a Raspberry Pi.
Before starting this article check you have the following for prerequisites:

  • You have a Raspberry Pi with Raspbian installed
  • The Raspberry Pi is connected to the internet ("ping www.google.com" to check)
  • Your Raspberry Pi has a static ip address/hostname on your wifi network

Once you have confirmed you have met the prerequisites and you know the hostname of thee RaspberryPi you can proceed through the following steps:

  1. Check Java is installed
  2. Download installer JAR file
  3. Run installer
  4. Check Initialization
  5. Post install clean-up
  6. Optional: Setup Servers to run on startup

Details for each step are below:

Check Java is installed

Java is installed by default on recent Raspbian installs. To check it is run the following command:

  1. java -version

If it isn't installed you can install the jre or the jdk.

  1. sudo apt-get update
  2. sudo apt-get install openjdk-8-jre
  1. sudo apt-get update
  2. sudo apt-get install oracle-java8-jdk

Download installer JAR file

You now need to create a directory to store the Personal Services files and download the installer and certificate into this directory. To do this run the following commands:

  1. cd ~
  2. mkdir PersonalServices
  3. cd PersonalServices

Note: --no-check-certificate is there as I have a self signed https certificate on my server.

Run installer

Run the following command:

  1. java -jar PersonalServicesInstaller_Latest.jar

Follow the prompts to preform the setup.
The default settings work for all parameters except:

  • Single Node Server - Instance Action Category: Select SINGLEUSERMACHINE - This will enable you to use the Shell Action

Make sure to note down the username and password for the First Admin Web Server user. (Normally the username is webSiteUser)

Note: Having the host as localhost works, although you could provide the RaspberryPi's hostname here.

Check Initialization

Start the services by running the following command:

  1. ~/PersonalServices/svcControl.sh start

You can check the output of the server logs to see them start:

  1. cat ~/PersonalServices/log/AdminWebServ.log
  2. cat ~/PersonalServices/log/SingleNodeServer.log

Open a web browser and visit https://localhost:8080/app/. (Alter the port number if you installed the Admin Web Server on a different port.). Login with the First User credentials you entered in the setup process.

You should log in successfully and can now start configuring sockets:
TODO Pic of main screen

Post install clean-up

The setup process creates some helper files which run the setup processes for each component. These are helpful for advanced users who want to change their setup but once you are happy with the institutionalization you should delete them as accidentally running them may break the initialization.
Delete:

  • SetupAdminWebserver.sh
  • SetupAdminWebServKeystore.sh
  • SetupConsole.sh
  • SetupSingleNodeServer.sh

Setup Servers to run on startup

It may be useful to set the server to run on startup of the RaspberryPi. To do this run the following commands:

  1. sudo cp -s ~/PersonalServices/svcControl.sh /etc/init.d/personalservices

Then we will add the command to start the service at the end of rc.local:

  1. sudo nano  /etc/rc.local

Line to add:

  1. su pi -c '/etc/init.d/personalservices start'

Put this line at the end just before exit 0

RJM Article Type
Work Notes