Feel free to wrap the jar in a service wrapper and run it as a service. Just Google: running a java jar as a windows service for the many options available.
Special installation notes available for: Amazon EC2 Raspberry Pi CHIP 9$ Computer
This works on a local box and any cloud server with command line (ssh) access.
Make sure you have Java 8 (1.8) installed
java -version
Set up a directory and get the release
mkdir permeagility
cd permeagility
wget http://sourceforge.net/projects/permeagility/files/permeagility-0.8.0.jar
Then create the scripts to run it using a logical link for upgradability and allowing restart from the web console.
Here are some scripts that you can use when deploying a server on Linux. They are provided here so that you can paste them into vi or other text editor easily. Naturally, you can customize these however you want.
Create the randr.sh file (Run and Restart)
vi randr.sh
hit the i key and paste the contents below
randr.sh (note that sudo is only needed for port 80 - ports above 1024 do not generally need sudo)
#!/bin/bash
# Run the server and restart until exit status != 1
status=1
while [ $status == 1 ]; do
java -jar permeagility.jar 80
status=$?
done
Runs on port 80 and restarts the server if it returns an exit code of 1 (Shutdown with restart) Notice that the permeagility-<ver>.jar is not mentioned explicitly, this is so that the script will not be version specific - create a symbolic file link to point the script to the specific jar to use. Then when you want to upgrade versions, change the symbolic link to the newer version and invoke a shutdown with restart using the web interface. The Context page displays the jar file name being used by the server.
Create the symbolic link
ln -sf permeagility-0.8.0.jar permeagility.jar
Create the run file
vi run.sh
hit the i key and paste the contents below
run.sh contents
#!/bin/bash
# Run the server script
nohup ./randr.sh &
This script will run the run and restart script under nohup to prevent shutdown when your session closes. This is generally needed when running on cloud servers or virtual machines.
Make the scripts executable
chmod +x randr.sh
chmod +x run.sh
Start the server
sudo ./run.sh (sudo not needed for ports > 1024)
It can be restarted from the web browser and is easily upgraded with the download of a new jar file and an updated symbolic link and restart.
Security Note
If you change the server password, it will be saved in a file called init.pa and used on startup.
If a restart doesn't work, check nohup.out for messages about not being able to run without a tty device - on Amazon AMI servers, you probably have Defaults requiretty enabled, edit the sudoers configuration file with sudo vi /etc/sudoers and comment that line out.