登录网页出现welcome to wildfly 安装配置8 什么意思

Wildfly 9 部署简介 (Domain方式) - 简书
下载简书移动应用
写了4297字,被1人关注,获得了0个喜欢
Wildfly 9 部署简介 (Domain方式)
Wildfly是一个开源的基于JavaEE的轻量级应用服务器,最新版本是Wildfly 10,遵循LGPL许可,意味着可以在任何商业应用中免费使用。具有启动速度快、轻量、强大的管理界面、支持JavaEE7(Wildfly 10)、易于测试等特性。但是一旦说起Wildfly,我们一定要提到JBoss,Wildfly既是JBoss改名而来。2006年,JBoss被Redhat公司收购。 JBoss AS目前作为Redhat公司的商业产品JBoss Enterprise Application Platform的上游基础,为了使这两个产品有差异化,避免用户混淆,因此该公司在去年10月份就寻求为JBoss AS找一个新名字。
RedHat公司称,新名称WildFly反映了服务器“非常灵活、轻量、不羁、自由”的特性。其实就是更新会快些,可以不再那么束缚开发者,而且商业版本还能有钱赚。但是不管怎么说,对于JBoss、开发者、使用者都是好的!
本文仅仅是介绍基础操作和安装配置,更详细、准确、进阶的,请查看官方文档:
基础知识 & 操作说明
以下内容将使用网页端控制台,没有安装好Wildfly的请先安装和配置。
Wildfly Deployments
Deployments是指server相关的项目部署,server与deployments是分开的,一个server可以有多个deployments,一个deployments可以指向多个server。这点与Weblogic是一样的。
新增deployment
这里只讲解unmanaged deployment,这样可以指定一个部署路径(需要指向的Server所在Host的部署路径),而不需要上传项目EAR文件。在deployments中配置的路径,是指此deployments所要分配的server所在host的路径,而并非Domain主机的路径。选择 Create an unmanaged deployment
Add Deploy Step 1
Path填写项目部署文件路径,注意这里的Runtime Name必需以.war结尾
Add Deploy Step 2
分配deployment
新增deployments之后,需要分配到已创建的server group,以运行此deployment注意这里是分配给server group,而不能直接分配给server,这是因为Wildfly注重可扩展、易管理的操作方式。这点在之后的Profiles、Groups会讲到。
Assign Deploy
Wildfly Configuration
Configuration 中可以配置Profiles、Socket Binding,这是运行一个server基本的配置项。
Wildfly Profiles
Profiles是一个定义ServerGroup配置的集合,你可以配置所有关于应用容器相关的内容,例如Datasources、Logging、Web Services等等。Wildfly内置了default/full/full-ha/ha四个Profile。
Basically,你的项目用不到这其中的任何配置,最常见的是使用Datasources,这需要你在项目中支持Wildfly的框架,比如你怎么连接到Wildfly提供的JNDI的代码段。
这里我们直接使用内置的任何一个都可以,并不会对我们的项目产生影响。
Wildfly Socket Binding
Socket Binding
Socket binding定义了在指定的网络接口启用HTTP/HTTPS等方式的起始端口的配置,支持MuiltCast方式,但是暂时没有用到。
注意,这里的Socket binding是用于Server Group的,在此Server Group中的Server根据需要,指定端口偏移值,才是Server的端口。例如,Socket Binding中的standard-sockets定义了http端口是8080,如果test-group应用了standard-sockets,test-group其中的test-server-1在创建时,必需设定8080的偏移值,如果是1,则test-server-1的http访问方式为IP:8081。
更改起始端口
选择需要更改的Socket类型,例如https,点击edit修改起始端口
Update Port
Wildfly Runtime
Runtime,运行时。用于管理应用容器的运行时生命周期,例如新增、启动、停止等等。
Wildfly Host
Host即主机,你需要一个用于运行Server的host,这个就是domain/configuration/host.xml中配置的主机。每个主机的wildfly服务在启动之后,将连接到Domain,由Domain统一管理。包括Domain自身也属于一个host,只不过同时是管理Domain的入口。所有的Host在Domain看来都是一致的,每个Host中运行的Wildfly版本应该一致,而且Domain可以访问他们任何一个Host。
Wildfly Server Group
Server Group是同一业务类型的Server的集合,可以批量的管理在该集合之下的所有server,Wildfly中使用了Server Group强制代替了直接管理Server的方式,也就是说,在创建Server之前,你必须要创建Server Group,再在这个Server Group中创建Server。
创建 Server Group
指定需要使用的Profile、Socket Binding,从而基本定义了这个Server Group。
Add Server Group
Wildfly Server
这里的Server才是最终运行的服务,但是Server自身只能定义自己的端口偏移值,JVM参数,System Properties等信息,其他的都由Server Group使用的Profiles和Socket Binding配置。
创建 Server
你需要指定此Server运行于哪个Host,属于哪个Server Group,端口偏移值和是否需要自启动等信息。
Add Server
更新 Server JVM
Config Server
安装和配置
这里开始讲解如何以Domain方式安装和配置Wildfly,在配置并启动后,所有其他操作尽量在网页控制台中进行,不要随意更改domain.xml或者host.xmlDomain的方式即一个管理节点(domain),多个受控节点(slave)。
DOMAIN & SLAVE: 安装JDK
[root@localhost opt]# ll
total 138892
-rw-r--r--. 1 root root
1 17:31 jdk-7u71-linux-x64.tar.gz
drwxr-xr-x. 2 root root
4096 May 10
[root@localhost opt]# tar zxf jdk-7u71-linux-x64.tar.gz
DOMAIN & SLAVE: 安装Wildfly
## 将wildfly的安装包放置在用户目录下
[irm@localhost ~]$ tar zxf wildfly-9.0.2.Final.tar.gz
DOMAIN & SLAVE: 配置环境变量
[irm@localhost ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
# User specific environment and startup programs
JAVA_HOME=/opt/jdk1.7.0_71
export JBOSS_HOME=/home/irm/wildfly-9.0.2.Final
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export PATH
DOMAIN : 创建Wildfly管理用户
[irm@localhost ~]$ wildfly-9.0.2.Final/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,以添加管理用户
Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
# 输入用户名
Username : test
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should be different from the username
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
# 输入用户密码
Password :
WFLYDM0099: Password should have at least 8 characters!
# 确认则输入yes
Are you sure you want to use the password entered yes/no? yes
# 重新输入密码
Re-enter Password :
# 留空即可
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 'test' for realm 'ManagementRealm'
# 继续则输入yes
Is this correct yes/no? yes
Added user 'test' to file '/home/irm/wildfly-9.0.2.Final/standalone/configuration/mgmt-users.properties'
Added user 'test' to file '/home/irm/wildfly-9.0.2.Final/domain/configuration/mgmt-users.properties'
Added user 'test' with groups
to file '/home/irm/wildfly-9.0.2.Final/standalone/configuration/mgmt-groups.properties'
Added user 'test' with groups
to file '/home/irm/wildfly-9.0.2.Final/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
yes/no? yes
这里需要注意,用户添加完毕后,将回馈给你此用户的secret value,可在domain与slave 的通信中用到,下文中会讲到
To represent the user add the following to the server-identities definition &secret value="YWFhYWFh" /&
DOMAIN: 配置Wildfly Domain
[irm@localhost ~]$ cd wildfly-9.0.2.Final/domain/configuration/
[irm@localhost configuration]$ vi host.xml
&!-- 更改hostname为标识本机的host名称,与系统的hostname无关 --&
&host name="irms_host_1" xmlns="urn:jboss:domain:3.0"&
&!-- 编辑server-identities标签,配置文件中没有的手动添加这一段,更改secret value为刚刚添加用户返回的值 --&
&management&
&security-realms&
&security-realm name="ManagementRealm"&
&server-identities&
&secret value="YWFhYWFh"/&
&/server-identities&
&!-- 注意下面的http-interface security-realm="ManagementRealm" 是与slave配置的不同之处,slave没有这段配置 --&
&management-interfaces&
&native-interface security-realm="ManagementRealm"&
&socket interface="management" port="${jboss.management.native.port:9999}"/&
&/native-interface&
&http-interface security-realm="ManagementRealm" http-upgrade-enabled="true"&
&socket interface="management" port="${jboss.management.http.port:9990}"/&
&/http-interface&
&/management-interfaces&
&!--这里的domain-controller中的内容是空的,因为本机服务器是domain,所以无需指定谁是controller--&
&domain-controller&
&/domain-controller&
&!-- 编辑下面的IP地址为本机的IP地址 --&
&interfaces&
&interface name="management"&
&inet-address value="${jboss.bind.address.management:10.174.243.1}"/&
&/interface&
&interface name="public"&
&inet-address value="${jboss.bind.address:10.174.243.1}"/&
&/interface&
&interface name="unsecure"&
&inet-address value="${jboss.bind.address.unsecure:10.174.243.1}"/&
&/interface&
&/interfaces&
&!--清空servers标签中的内容,原内容为server 的example--&
&/servers&
SLAVE: 配置Wildfly Slave
[irm@localhost ~]$ cd wildfly-9.0.2.Final/domain/configuration/
#### 删除domain.xml,或者重命名
[irm@localhost configuration]$ mv domain.xml domain.xml_bak
#### 编辑slave配置文件
[irm@localhost configuration]$ vi host.xml
&!-- 更改hostname为标识本机的host名称,与系统的hostname无关 --&
&host name="hostname" xmlns="urn:jboss:domain:3.0"&
&!-- 编辑server-identities标签,配置文件中没有的手动添加这一段,更改secret value为与domain一样的配置 --&
&management&
&security-realms&
&security-realm name="ManagementRealm"&
&server-identities&
&secret value="YWFhYWFh"/&
&/server-identities&
&!-- 更改domain-controller中的host为Wildfly Domain的IP地址 --&
&domain-controller&
&remote protocol="remote" host="10.174.243.1" port="9999" security-realm="ManagementRealm" username="slave"/&
&/domain-controller&
&!-- 更改下面三个IP地址为本机IP地址--&
&interfaces&
&interface name="management"&
&inet-address value="${jboss.bind.address.management:10.174.243.5}"/&
&/interface&
&interface name="public"&
&inet-address value="${jboss.bind.address:10.174.243.5}"/&
&/interface&
&interface name="unsecure"&
&inet-address value="${jboss.bind.address.unsecure:10.174.243.5}"/&
&/interface&
&/interfaces&
&!--清空servers标签中的内容,原内容为server 的example--&
&/servers&
DOMAIN & SLAVE: 配置系统服务
#### 编辑Wildfly服务所需的配置文件
[root@localhost /]# vi /etc/default/wildfly.conf
## JDK目录
JAVA_HOME="/opt/jdk1.7.0_71"
## JBOSS_HOME是Wildfly的安装根目录
JBOSS_HOME="/home/irm/wildfly-9.0.2.Final"
## 这里需要改为执行wildfly的用户
JBOSS_USER=irm
## 指定运行模式为domain
JBOSS_MODE=domain
## 指定domain的配置文件为domain.xml,slave的配置文件为host.xml
JBOSS_DOMAIN_CONFIG=domain.xml
JBOSS_HOST_CONFIG=host.xml
# 安装和启用服务,先启动Domain的服务,再启动各个Slave
[root@localhost /]# cp wildfly-9.0.2.Final/bin/init.d/wildfly-init-redhat.sh /etc/init.d/wildfly
[root@localhost /]# chmod +x /etc/init.d/wildfly
[root@localhost /]# chkconfig --add wildfly
[root@localhost /]# chkconfig wildfly on
[root@localhost /]# service wildfly start
访问Wildfly
在浏览器中访问 以管理Wildfly,这里的用户名和密码是在运行add-user.sh时配置的。
需注意的问题
Wildfly 9 的控制台对IE浏览器支持不佳,尽量使用Chrome或者其他浏览器代替
deployments的runtime name必需以.war结尾
如果项目中使用了slf4j,或者项目中包含log4j.properties,则需要禁用Wildfly自身的日志功能,因为这会产生冲突在项目的WEB-INF目录中,编辑或新增jboss-deployment-structure.xml文件,内容如下:&?xml version="1.0"?&
&jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"&
&deployment&
&exclusions&
&module name="mons.logging" /&
&module name="org.apache.log4j" /&
&module name="org.jboss.logging" /&
&module name="org.jboss.logging.jul-to-slf4j-stub" /&
&module name="org.jboss.logmanager" /&
&module name="org.jboss.logmanager.log4j" /&
&module name="org.slf4j" /&
&module name="org.slf4j.impl" /&
&/exclusions&
&/deployment&
&/jboss-deployment-structure&
如果需要禁用Wildfly的欢迎页面,需在项目的WEB-INF目录中,编辑或新增jboss-deployment-structure.xml文件,内容如下:&?xml version="1.0"?&
&jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"&
&deployment&
&exclude-subsystems&
&subsystem name="webservices" /&
&/exclude-subsystems&
&/deployment&
&/jboss-deployment-structure&
指定项目需要使用的URL后缀,即location,需编辑或新增项目中的WEB-INF/jboss-web.xml,内容如下:&?xml version="1.0" encoding="UTF-8"?&
&jboss-web&
&context-root&/test&/context-root&
&/jboss-web&
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
选择支付方式:二次元同好交流新大陆
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
二、启动&两种启动方式:standalone和domain。  在启动domain的时候,会在系统中启动5个进程:3个JBoss AS Server的实例;1个Domain Controller(Domain控制器)进程,这个进程用来集中控制所有属于这个"domain"的server;和一个轻量的Process Controller,负责管理其他的4个进程并监听它们的生命周期。  采用standalone模式会在系统中启动一个进程, 一个单个的 JBoss AS server&的实例。启动命令:cd:&wildfly-[version]/bin$ ./domain.sh 或&$ ./standalone.sh关闭:&$ ./jboss-cli.sh --connect command=:shutdown配置:外网访问方式一:如:&&是无法访问的。因为部署完后,默认只能本地访问(即:只有127.0.0.1/localhost能访问),如果想让其他人也可以访问你的网页,需要修改JBoss的配置文件,即修改standalone.xml,增加本机Web地址的内容。
&interface name="public"&
&inet-address value="${jboss.bind.address:127.0.0.1}"/&
&/interface&将127.0.0.1 改为&,重新启动JBoss,即可外部访问。方式二:&interface name="any"&&any-ipv4-address/&&/interface&&/interfaces&
&socket-binding-group name="standard-sockets" default-interface="any"&&socket-binding name="http" port="8080"/&&socket-binding name="https" port="8443"/&&socket-binding name="jmx-connector-registry" port="1090"/&&socket-binding name="jmx-connector-server" port="1091"/&&socket-binding name="jndi" port="1099"/&&socket-binding name="osgi-http" port="8090"/&&socket-binding name="remoting" port="4447"/&&socket-binding name="txn-recovery-environment" port="4712"/&&socket-binding name="txn-status-manager" port="4713"/&&/socket-binding-group&
根据上面的内容,增加一个interface,并调整socket-binding-group,重新启动standalone.bat,其他机器就可以通过来进行访问了。
阅读(741)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'WildFly8
简易教程',
blogAbstract:'一、项目部署&项目部署在WildFly/&standalone/deployments/&路径下二、启动&两种启动方式:standalone和domain。  在启动domain的时候,会在系统中启动5个进程:3个JBoss AS Server的实例;1个Domain Controller(Domain控制器)进程,这个进程用来集中控制所有属于这个\"domain\"的server;和一个轻量的Process Controller,负责管理其他的4个进程并监听它们的生命周期。',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:2,
publishTime:7,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}Welcome to WildFly Application Server 8
Welcome to WildFly 8
Your WildFly 8 is running.
To replace this page simply deploy your own war with / as its context path.
To disable it, remove "welcome-content" handler for location / in undertow subsystemJBoss WildFly(JBoss8)如何将应用部署到根上下文 - 推酷
JBoss WildFly(JBoss8)如何将应用部署到根上下文
当我们访问 localhost:8080/ 的时候,总会出现JBoss的欢迎页面,如果我们想访问根目录的时候直接转到我们的Web应用,则需要两步,一是在/WEB-INF/ 目录下添加jboss-web.xml文件命令JBoss将应用注册到根上下文,二是取消欢迎页面。而WildFly跟JBoss以前的版本取消欢迎页面的配置又有所不同。
首先在项目目录WEB-INF 下添加jboss-web.xml:
&?xml version=&1.0& encoding=&UTF-8&?&
&jboss-web&
&context-root&/&/context-root&
&/jboss-web&
然后打开 $JBOSS_HOME/standalone/configuration/standalone.xml, 找到以下片断:
&server name=&default-server&&
&http-listener name=&default& socket-binding=&http&/&
&host name=&default-host& alias=&localhost&&
&location name=&/& handler=&welcome-content&/&
&filter-ref name=&server-header&/&
&filter-ref name=&x-powered-by-header&/&
&servlet-container name=&default&&
&jsp-config/&
&/servlet-container&
&handlers&
&file name=&welcome-content& path=&${jboss.home.dir}/welcome-content&/&
&/handlers&
注意看第四行
&location name=&/& handler=&welcome-content&/&
可以猜到就是它让我们在访问 / 的时候跳到JBoss的欢迎页面了。所以,删除这一行即可。
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
没有分页内容
图片无法显示
视频无法显示
与原文不一致wildfly8如何配置热部署_java吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:445,390贴子:
wildfly8如何配置热部署收藏
java吧里的大神,求一个jboss7以上的配置文章,最好能关于热部署的,在这里非常感谢,急求,希望您不吝啬您的知识,感谢!!!!
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或}

我要回帖

更多关于 wildfly 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信