什么是wildfly

JBoss AS 从8版本起名为wildfly。Wildfly是一个开源的基于JavaEE的轻量级应用服务器。可以在任何商业应用中免费使用。

WildFly是一个灵活的、轻量的、强大管理能力的应用程序服务器。Wildfly是一个管理EJB的容器和服务器,但JBoss核心服务不包括支持servlet/JSP的WEB容器,一般与Tomcat或Jetty绑定使用。

特点

  • 无与伦比的速度:快速启动,无限的网络性能和可扩展性。
  • 非常的轻量级:瘦内存管理,运行时间可定制化。
  • 强大的管理功能:统一的配置和管理。

Wildfly更多特点及与市面上常见的Web服务对比,可参看《热门WEB容器TOMCAT、JETTY、 GLASSFISH、WILDFLY对比》。

下载安装

wildfly下载地址:https://wildfly.org/downloads/

目前,最新版本是18.0.0.Final,选择“Java EE Full & Web Distribution”项对应的ZIP版本,点击下载即可。如果官网下载较慢,可关注微信公众号“程序新视界”,回复“wildfly”获得下载链接。

安装java环境要求Java8或更高版本。

所谓的安装即解压即可。下面看一下该版本的目录结构:

  1. ├── LICENSE.txt
  2. ├── README.txt
  3. ├── appclient
  4. ├── bin
  5. ├── copyright.txt
  6. ├── docs
  7. ├── domain
  8. ├── jboss-modules.jar
  9. ├── modules
  10. ├── standalone
  11. └── welcome-content

standalone目录下存放的应用将单独占用进程,可单独启动和关闭,之间没有关联性。旗下有许多xml文件可供启动时选择。

domain目录下的应用之间有关联性,managing multiple servers from a single control point。

modules目录,jboss采用module加载驱动。

readme及启动命令

重点看一下readme中的内容,提供了启动相关的指导。

关键特性:

  1. Key Features
  2. ------------
  3. * Jakarta EE 8 support
  4. * Fast Startup
  5. * Small Footprint
  6. * Modular Design
  7. * Unified Configuration and Management
  8. * Distributed Domain Management

文档获取,同时也可以看出启动时默认是监听8080端口。

  1. Also, once WildFly is started you can go to http://localhost:8080/
  2. for additional information.

启动命令:

  1. Starting a Standalone Server
  2. ----------------------------
  3. A WildFly standalone server runs a single instance.
  4. <JBOSS_HOME>/bin/standalone.sh (Unix / Linux)
  5. <JBOSS_HOME>\bin\standalone.bat (Windows)

启动脚本位于根目录/bin目录中。Windows为standalone.bat,Linux为standalone.sh。

Wildfly还可以启动一个管理后台来对服务进行管理。

  1. Starting a Managed Domain
  2. -------------------------
  3. A WildFly managed domain allows you to control and configure multiple instances,
  4. potentially across several physical (or virtual) machines. The default
  5. configuration includes a domain controller and a single server group with three
  6. servers (two of which start automatically), all running on the localhost.
  7. <JBOSS_HOME>/bin/domain.sh (Unix / Linux)
  8. <JBOSS_HOME>\bin\domain.bat (Windows)

启动脚本位于根目录/bin目录中。Windows为domain.bat,Linux为domain.sh。

停止服务,可以通过控制台输入Ctrl+c命令来操作。如果服务在后台运行,可执行一下命令进行停止。

  1. <JBOSS_HOME>/bin/jboss-cli.sh --connect --command=:shutdown (Unix / Linux)
  2. <JBOSS_HOME>\bin\jboss-cli.bat --connect --command=:shutdown (Windows)

启动操作

现在启动项目standalone看一下效果。

  1. 19:48:11,234 INFO [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
  2. 19:48:11,234 INFO [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
  3. 19:48:11,296 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
  4. 19:48:11,409 INFO [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0493: EJB subsystem suspension complete
  5. 19:48:11,479 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
  6. 19:48:11,579 INFO [org.jboss.as.patching] (MSC service thread 1-3) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
  7. 19:48:11,596 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-5) WFLYDM0111: Keystore /Users/zzs/tools/wildfly18/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
  8. 19:48:11,606 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-6) WFLYDS0013: Started FileSystemDeploymentService for directory /Users/zzs/tools/wildfly18/standalone/deployments
  9. 19:48:11,746 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
  10. 19:48:11,846 INFO [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3)
  11. 19:48:11,963 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
  12. 19:48:11,965 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
  13. 19:48:11,965 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
  14. 19:48:11,965 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 18.0.0.Final (WildFly Core 10.0.0.Final) started in 3880ms - Started 315 of 577 services (369 services are lazy, passive or on-demand)

通过以上部分日志可以看到,wildfly监听了8080,8443和9990端口。

访问服务器的url为:127.0.0.1:8080,访问管理后台的url为:http://127.0.0.1:9990/。

访问服务器可看到如下页面:

页面内包含文档、快速启动、管理后台等链接。

此时访问后台管理会提示如下内容:

  1. Welcome to WildFly
  2. Your WildFly Application Server is running.
  3. However you have not yet added any users to be able to access the admin console.
  4. To add a new user execute the add-user.sh script within the bin folder of your WildFly installation and enter the requested information.
  5. By default the realm name used by WildFly is "ManagementRealm" this is already selected by default.
  6. After you have added the user follow this link to Try Again.

也就是说启动成功了,但没有配置用户。同tomcat一样,wildfly也有自己的服务管理页面,可以统一管理应用,设置权限用户。执行add-user脚本来添加管理者用户。

  1. bin zzs$ ./add-user.sh
  2. What type of user do you wish to add?
  3. a) Management User (mgmt-users.properties)
  4. b) Application User (application-users.properties)
  5. # 输入a,以添加管理用户
  6. (a): a
  7. Enter the details of the new user to add.
  8. Using realm 'ManagementRealm' as discovered from the existing property files.
  9. # 输入用户名
  10. Username : zzs
  11. Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
  12. - The password should be different from the username
  13. - The password should not be one of the following restricted values {root, admin, administrator}
  14. - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
  15. # 输入用户密码
  16. Password :
  17. # 重新输入密码
  18. Re-enter Password :
  19. # 留空即可或输入ManagementRealm
  20. What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]: ManagementRealm
  21. About to add user 'zzs' for realm 'ManagementRealm'
  22. # 继续则输入yes
  23. Is this correct yes/no? yes
  24. Added user 'zzs' to file '/Users/zzs/tools/wildfly18/standalone/configuration/mgmt-users.properties'
  25. Added user 'zzs' to file '/Users/zzs/tools/wildfly18/domain/configuration/mgmt-users.properties'
  26. Added user 'zzs' with groups ManagementRealm to file '/Users/zzs/tools/wildfly18/standalone/configuration/mgmt-groups.properties'
  27. Added user 'zzs' with groups ManagementRealm to file '/Users/zzs/tools/wildfly18/domain/configuration/mgmt-groups.properties'
  28. Is this new user going to be used for one AS process to connect to another AS process?
  29. e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
  30. # 继续则输入yes
  31. yes/no? yes
  32. 这里需要注意,用户添加完毕后,将回馈给你此用户的secret value,可在domainslave 的通信中用到
  33. To represent the user add the following to the server-identities definition <secret value="MTk4NzEwMjlfUXE=" />

每一步操作都会有对应的提示与选项,按照提示填写即可。

设置完成,再进点击Administration Console或访问http://127.0.0.1:9990/,输入刚刚设置的用户名密码,即可登录管理后台。

原文链接:《wildfly(JBoss AS)应用服务器快速入门

参考文章:《热门WEB容器TOMCAT、JETTY、 GLASSFISH、WILDFLY对比

程序新视界:精彩和成长都不容错过
![程序新视界-微信公众号](https://img2018.cnblogs.com/blog/1742867/201910/1742867-20191013111755842-2090947098.png)

wildfly(JBoss AS)应用服务器快速入门的更多相关文章

  1. spring boot入门教程——Spring Boot快速入门指南

    Spring Boot已成为当今最流行的微服务开发框架,本文是如何使用Spring Boot快速开始Web微服务开发的指南,我们将使创建一个可运行的包含内嵌Web容器(默认使用的是Tomcat)的可运 ...

  2. spring快速入门(二)

    一.在spring快速入门(一)的基础上,我们来了解spring是如何解决对象的创建以及对象之间的依赖关系的问题 (比如client中依赖UserAction的具体实现,UserActionImpl中 ...

  3. quartz-2.2.x 快速入门 (1)

    欢迎来到quartz快速入门教程.阅读本教程,你将会了解: quartz下载 quartz安装 根据你的需要,配置Quartz 开始一个示例应用   当熟悉了quratz调度的基本功能后,可以尝试一些 ...

  4. SpringMvc_快速入门,深入分析

    目录  一.前言二.spring mvc 核心类与接口三.spring mvc 核心流程图 四.spring mvc DispatcherServlet说明 五.spring mvc 父子上下文的说明 ...

  5. Spring MVC 教程,快速入门,深入分析

    http://elf8848.iteye.com/blog/875830/ Spring MVC 教程,快速入门,深入分析 博客分类: SPRING Spring MVC 教程快速入门  资源下载: ...

  6. Spring_MVC_教程_快速入门_深入分析

    Spring MVC 教程,快速入门,深入分析 博客分类: SPRING Spring MVC 教程快速入门  资源下载: Spring_MVC_教程_快速入门_深入分析V1.1.pdf Spring ...

  7. 【个人笔记】002-PHP基础-01-PHP快速入门-02-PHP语言相关介绍输

    002-PHP基础-01-PHP快速入门 02-PHP语言相关介绍 1.PHP是什么 Hypertext Preprocessor超文本预处理器 是一种通用开源脚本语言 Personal Home P ...

  8. Node.js快速入门

    Node.js是什么? Node.js是建立在谷歌Chrome的JavaScript引擎(V8引擎)的Web应用程序框架. 它的最新版本是:v0.12.7(在编写本教程时的版本).Node.js在官方 ...

  9. SuperSocket快速入门(二):启动程序以及相关的配置

    如何快速启动第一个程序 既然是快速入门,所以,对于太深奥的知识点将不做讲解,会在后续的高级应用章节中,会对SS进行拆解.所有的实例90%都是来自SS的实例,外加本人的注释进行讲解. 一般应用而言,你只 ...

随机推荐

  1. Spring Cloud Alibaba | Sentinel:分布式系统的流量防卫兵动态限流规则

    Spring Cloud Alibaba | Sentinel:分布式系统的流量防卫兵动态限流规则 前面几篇文章较为详细的介绍了Sentinel的使用姿势,还没看过的小伙伴可以访问以下链接查看: &l ...

  2. 基于Python的多线程与多进程

    1.I/O密集型与计算密集型 多进程适用于I/O密集型 多进程适用于计算密集型 2.没有sleep(T)的多个死循环只能用多进程 3.模块介绍: 1)threading模块(_thread模块已淘汰) ...

  3. centos安装流量监控软件,并指定端口号监控

    yum install -y iptraf 安装好以后使用进入界面: iptraf-ng enter回车,比如22端口,就是22 22 然后退出 重新登录 ok!

  4. HBase shell scan 模糊查询

    0.进入hbase shell ./hbase shell help help "get" #查看单独的某个命令的帮助 1. 一般命令 status 查看状态 version 查看 ...

  5. web性能优化实践

    一.SQL查询优化 1.循环中有多次查询sql,改为在循环外一次查询后再处理 2.循环多次插入,改为组装好数据后批量插入 3.梳理业务逻辑能一次查完的,绝不分多次查 4.索引用起来 5.分页查询 二. ...

  6. Spring+Mybatis整合的练手小项目(一)项目部署

    声明:教程是网上找的,代码是自己敲的 项目目录大致如下: 1. 首先创建Maven工程,在pom.xml中加入项目所需依赖: <?xml version="1.0" enco ...

  7. Winform去掉标题栏后移动窗体

    第一步:声明全局变量->  private Point _HoverTreePosition; 第二步: #region 隐藏标题栏后移动窗口 private void Form_HoverTr ...

  8. Spring——依赖注入(DI)详解

    声明:本博客仅仅是一个初学者的学习记录.心得总结,其中肯定有许多错误,不具有参考价值,欢迎大佬指正,谢谢!想和我交流.一起学习.一起进步的朋友可以加我微信Liu__66666666 这是简单学习一遍之 ...

  9. MAC sublime常用快捷键(慢慢补)

    1、 FN + 左方向键:向左选择一行 2、FN + 右方向键:向右选择一行 3、FN + 上方向键:跳到页头 4、FN + 下方向键:跳到页尾 5、FN + SHIFT + 左方向键|上方向键:从当 ...

  10. java中String常见问题

    java中String常见问题 1.字符串比较==和equals ==:比较的是对象,判断两个引用的是否为同一内存地址(物理对象) equals:比较的是值 2.通过空白字符拆封字符串 str.spi ...