sudo apt-get -y install openjdk-7-jdk # Install JDK 7
sudo apt-get -y install unzip # Install unzip
wget http://bit.ly/1CGCtI9 -O temp.zip # Download Payara
- sudo mkdir -p /opt/payara # Make dir for Payara
- sudo chown vagrant:vagrant /opt/payara # Make sure vagrant owns dir
+ sudo mkdir -p /opt/payara/startup # Make dirs for Payara
unzip temp.zip -d /opt/payara # unzip Payara to dir
+ sudo cp /vagrant/payara_service-4.1.151 /opt/payara/startup/
+ sudo chmod +x /opt/payara/startup/payara_service-4.1.151
+ ln -s /opt/payara/startup/payara_service-4.1.151 /etc/init.d/payara
+ sudo update-rc.d payara defaults
+ sudo chown -R vagrant:vagrant /opt/payara # Make sure vagrant owns dir
+ service payara start
SHELL
end
export PAYARA_HOME
+
+start() {
+ echo -n "Starting Payara: "
+ $PAYARA_HOME/bin/asadmin start-domain
+}
+
+stop() {
+ echo -n "Stopping Payara: "
+ $PAYARA_HOME/bin/asadmin stop-domain
+}
+
+
case "$1" in
start)
start
\*)
echo "usage: $0 (start|stop|restart|help)"
esac
-
-
-start() {
- echo -n "Starting Payara: "
- $PAYARA_HOME/bin/asadmin start-domain
-}
-
-stop() {
- echo -n "Stopping Payara: "
- $PAYARA_HOME/bin/asadmin stop-domain
-}