Linux 下Jboss安装

1. 准备工作

1.1 去掉baseurl的注释,注释掉mirrorlist

[root@Hm311~]# vi  /etc/yum.repos.d/epel.repo

# 去掉baseurl的注释,注释掉mirrorlist
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

1.2 JDK的安装

Linux 下JDK的安装

2. Jboss的安装

2.1 上传Jboss的安装包

jboss-eap-6.4版本下载

通过winscp上传本地的jboss-eap-6.4到/opt文件夹下, 然后执行如下脚本

[root@HM311 ~]#  cd /opt
[root@HM311 opt]# useradd jboss-as
[root@HM311 opt]# mkdir -p /var/log/jboss-as
[root@HM311 opt]# chown jboss-as:jboss-as -R /var/log/jboss-as/
[root@HM311 opt]# chown jboss-as:jboss-as -R /opt/jboss-eap-6.4/
[root@HM311 opt]# chmod -R 777 /opt/jboss-eap-6.4/

创建Jboss管理员账户(这是只是创建master服务,并不集成slave服务)

[root@HM311 opt]# cd /jboss-eap-6.4/bin
[root@HM311 bin]# /opt/jboss-eap-6.4/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.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : admin
The username 'admin' is easy to guess
Are you sure you want to add user 'admin' yes/no? y
Password requirements are listed below. To modify these restrictions edit the add-user.properties configuration file.
 - The password must not be one of the following restricted values {root, admin, administrator}
 - The password must contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
 - The password must be different from the username
Password : 1qaz@WSX
Re-enter Password : 1qaz@WSX
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]:
About to add user 'admin' for realm 'ManagementRealm'
Is this correct yes/no? y
Added user 'admin' to file '/opt/jboss-eap-6.4/standalone/configuration/mgmt-users.properties'
Added user 'admin' to file '/opt/jboss-eap-6.4/domain/configuration/mgmt-users.properties'
Added user 'admin' with groups  to file '/opt/jboss-eap-6.4/standalone/configuration/mgmt-groups.properties'
Added user 'admin' with groups  to file '/opt/jboss-eap-6.4/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? n

3. 配置jboss为系统启动服务

[root@HM311 ~]# ln -s /opt/jboss-eap-6.4/bin/init.d/jboss-as-domain.sh /etc/init.d/jboss
[root@HM311 ~]# chmod 777 -R /etc/init.d/jboss
[root@HM311 ~]# mkdir -p /etc/jboss-as/
[root@HM311 ~]# ln -s /opt/jboss-eap-6.4/bin/init.d/jboss-as.conf /etc/jboss-as/jboss-as.conf
[root@HM311 ~]# ln -s /opt/jboss-eap-6.4/ /usr/share/jboss-as
[root@HM311 ~]# vi /etc/jboss-as/jboss-as.conf

# General configuration for the init.d scripts,
# not necessarily for JBoss AS itself.
# The username who should own the process.
#去掉以下的注释
 JBOSS_USER=jboss-as
# The amount of time to wait for startup
#
# STARTUP_WAIT=30
# The amount of time to wait for shutdown
#
# SHUTDOWN_WAIT=30
# Location to keep the console log
#
# JBOSS_CONSOLE_LOG=/var/log/jboss-as/console.log

启动、关闭Jboss服务

[root@HM311 ~]# service jboss stop
[root@HM311 ~]# service jboss start

启动后可以访问 http://127.0.0.1:9990/console/App.html#topology
这里写图片描述

4. 允许外网访问Jboss应用

[root@HM311 ~]# cd /opt/jboss-eap-6.4/domain/configuration/
[root@HM311 configuration]# vi host.xml

# 修改以下内容,改为本机IP(获取本机IP使用ifconfig)
 <interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:x.x.x.x}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:x.x.x.x}"/>
        </interface>
        <interface name="unsecure">
            <inet-address value="${jboss.bind.address.unsecure:x.x.x.x.}"/>
        </interface>
    </interfaces>

猜你喜欢

转载自blog.csdn.net/yk10010/article/details/81317719