Skip to content

Instantly share code, notes, and snippets.

@AlexCallejas
Forked from Burning-Chai/InstallJBossonCentOS7.md
Last active March 28, 2018 03:29
Show Gist options
  • Save AlexCallejas/d03da9585aabe10e14df29aa912155d8 to your computer and use it in GitHub Desktop.
Save AlexCallejas/d03da9585aabe10e14df29aa912155d8 to your computer and use it in GitHub Desktop.
How to install JBoss on CentOS7
# yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
# java -version
java version "1.7.0_171"
OpenJDK Runtime Environment (rhel-2.6.13.0.el7_4-x86_64 u171-b01)
OpenJDK 64-Bit Server VM (build 24.171-b01, mixed mode)

# javac -version
javac 1.7.0_171

# yum install wget unzip

# wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip
# unzip jboss-as-7.1.1.Final.zip -d /opt/
# cd /opt/
# ln -s jboss-as-7.1.1.Final/ jboss
# adduser jboss

# cd /opt/jboss-as-7.1.1.Final/
# wget http://repo1.maven.org/maven2/org/jboss/modules/jboss-modules/1.1.5.GA/jboss-modules-1.1.5.GA.jar
# mv jboss-modules.jar jboss-modules-1.1.1.GA.jar
# mv jboss-modules-1.1.5.GA.jar jboss-modules.jar

# chown -R jboss:jboss /opt/jboss-as-7.1.1.Final/ /opt/jboss

# su - jboss
$ cd /opt/jboss/bin
$ ./add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): a

Enter the details of the new user to add.
Realm (ManagementRealm) : [Enter]
Username : jboss
Password : [Password]
Re-enter Password : [Password]
About to add user 'jboss' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'jboss' to file '/opt/jboss-as-7.1.1.Final/standalone/configuration/mgmt-users.properties'
Added user 'jboss' to file '/opt/jboss-as-7.1.1.Final/domain/configuration/mgmt-users.properties'
# wget https://git.io/darkaxl-jboss-as-standalone.sh
# chmod 0755 darkaxl-jboss-as-standalone.sh
# cp -pRf  darkaxl-jboss-as-standalone.sh /etc/init.d/jboss
Edit line 277 /opt/jboss/standalone/configuration/standalone.xml:
    <interfaces>
        <interface name="management">
            <any-ipv4-address/>           <--- change
        </interface>
        <interface name="public">
            <any-ipv4-address/>           <--- change
        </interface>
# firewall-cmd --permanent --add-port={22/tcp,80/tcp,443/tcp,8080/tcp,8443/tcp,9990/tcp,9999/tcp}
# firewall-cmd --permanent --add-service={http,https,ssh}
# systemctl restart firewalld.service

# firewall-cmd --permanent --zone=public --list-all

# firewall-cmd --permanent --direct --add-rule ipv4 nat PREROUTING 0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
# firewall-cmd --permanent --direct --add-rule ipv4 nat PREROUTING 0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
# systemctl restart firewalld.service

# firewall-cmd --permanent --zone=public --direct --get-all-rules
ipv4 nat PREROUTING 0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
ipv4 nat PREROUTING 0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443
# 
# service jboss start && chkconfig jboss on
http://<your ip address>:9990/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment