Last active
October 31, 2022 06:10
-
-
Save chinboon/df3c9dfb4703d442a881e13515c2a8b0 to your computer and use it in GitHub Desktop.
Script to install Wildfly 10 and JDK 8 into Amazon Linux AMI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# remove previous versions of java | |
sudo yum remove -y java-1.7.0-openjdk | |
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm" | |
sudo yum localinstall -y jdk-8u92-linux-x64.rpm | |
java -version | |
# download wildfly | |
sudo wget http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.tar.gz | |
# create server dir | |
WILDFLY_HOME=/opt/wildfly | |
sudo mkdir $WILDFLY_HOME | |
# unzip | |
tar -xzf wildfly-10.0.0.Final.tar.gz -C /opt/wildfly --strip 1 | |
cd /opt/wildfly | |
# install wildfly as service | |
sudo groupadd wildfly | |
sudo useradd -M -s /bin/nologin -g wildfly -d $WILDFLY_HOME wildfly | |
sudo chown -R wildfly:wildfly $WILDFLY_HOME | |
# delete files | |
sudo rm jdk-8u92-linux-x64.rpm | |
sudo rm wildfly-10.0.0.Final.tar.gz | |
# forget me | |
sudo history -c | |
# start wildfly bind to all address | |
sudo -u wildfly /opt/wildfly/bin/standalone.sh -b=0.0.0.0 & | |
# or if you want to also bind the management port to all address | |
sudo -u wildfly /opt/wildfly/bin/standalone.sh -b=0.0.0.0 -bmanagement=0.0.0.0 & | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just in case