使用wildfly部署项目

article/2025/9/25 19:34:25

WildFly部署项目

一、下载

在浏览器地址栏输入https://www.wildfly.org/,打开WildFly官网,点击other versions选择版本,因为开发环境是jdk1.8,部署环境是Windows,所以这里我选择的是 “Java EE Full & Web Distribution”项对应的ZIP版本 ,点击下载即可,如果下载较慢可以用迅雷试试。

在这里插入图片描述
在这里插入图片描述
​ 将下载好的压缩包解压,得到如下目录:

在这里插入图片描述
主要关注bin目录和standalone目录,其中bin目录里有许多和软件相关的脚本,启动脚本也位于其中,standalone目录下有许多xml文件可供启动时选择,而在readme.txt中也有英文文档。

在这里插入图片描述
bin目录下重点关注前缀为add-user和standalone的脚本和配置文件,其中add-user.bat和add-user.sh分别是Windows和Linux下的添加用户的脚本,standalone.bat和standalone.sh分别是Windows和Linux下的启动脚本。

如果服务器中还有其它jdk版本的项目,可以在Stand alone.conf.bat中修改jdk版本,具体操作与Tomcat下修改jdk版本相同。将下图中的两处注释取消,换成自己电脑的jdk路径即可。

在这里插入图片描述

二、安装

打开解压目录下的standalone目录,进入configuration目录,重点关注standalone.xml文件,这个文件主要用于WildFly的配置,类似于Tomcat中的server.xml文件。

在这里插入图片描述
打开standalone.xml文件,拉到最下面

<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

9990是管理后台端口,8080是项目端口。

<socket-binding name="http" port="${jboss.http.port:8080}"/>

双击bin目录下的standalone.bat,启动管理后台

Calling "F:\Desktop\wildfly-14.0.0.Final\bin\standalone.conf.bat"
Setting JAVA property to "G:\Java\jdk1.8.0_211\bin\java"
===============================================================================JBoss Bootstrap EnvironmentJBOSS_HOME: "F:\Desktop\wildfly-14.0.0.Final"JAVA: "G:\Java\jdk1.8.0_211\bin\java"JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman "===============================================================================15:29:33,197 INFO  [org.jboss.modules] (main) JBoss Modules version 1.8.6.Final
15:29:34,094 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.3.Final
15:29:34,106 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.2.Final
15:29:34,242 INFO  [org.jboss.as] (MSC service thread 1-3) WFLYSRV0049: WildFly Full 14.0.0.Final (WildFly Core 6.0.1.Final) starting
15:29:35,154 INFO  [org.wildfly.security] (ServerService Thread Pool -- 4) ELY00001: WildFly Elytron version 1.6.0.Final
15:29:35,583 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
15:29:35,610 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 29) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
15:29:35,661 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
15:29:35,682 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.6.5.Final
15:29:35,694 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.6.5.Final
15:29:35,752 INFO  [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 5.0.8.Final
15:29:35,776 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 41) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
15:29:35,812 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 48) WFLYCLINF0001: Activating Infinispan subsystem.
15:29:35,864 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 49) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
15:29:35,864 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 68) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
15:29:35,870 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 60) WFLYNAM0001: Activating Naming Subsystem
15:29:35,871 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 50) WFLYRS0016: RESTEasy version 3.6.1.Final
15:29:35,871 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 57) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
15:29:35,959 INFO  [org.jboss.as.connector] (MSC service thread 1-5) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.11.Final)
15:29:36,014 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0018: Started Driver service with driver-name = h2
15:29:35,931 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 55) WFLYJSF0007: Activated the following JSF Implementations: [main]
15:29:35,920 INFO  [org.jboss.as.naming] (MSC service thread 1-6) WFLYNAM0003: Starting Naming Service
15:29:35,914 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0003: Undertow 2.0.13.Final starting
15:29:35,913 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default]
15:29:35,900 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 58) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
15:29:35,886 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 59) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
15:29:35,885 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
15:29:35,878 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 70) WFLYWS0002: Activating WebServices Extension
15:29:35,875 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 66) WFLYSEC0002: Activating Security Subsystem
15:29:36,145 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0012: Started server default-server.
15:29:36,096 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
15:29:36,080 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 69) WFLYUT0014: Creating file handler for path 'F:\Desktop\wildfly-14.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
15:29:36,066 INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
15:29:36,062 INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
15:29:36,166 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting
15:29:36,164 INFO  [org.jboss.as.security] (MSC service thread 1-1) WFLYSEC0001: Current PicketBox version=5.0.3.Final
15:29:36,596 INFO  [org.jboss.as.patching] (MSC service thread 1-5) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
15:29:36,609 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-5) WFLYDM0111: Keystore F:\Desktop\wildfly-14.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
15:29:36,616 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory F:\Desktop\wildfly-14.0.0.Final\standalone\deployments
15:29:36,989 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
15:29:37,059 INFO  [org.jboss.as.ejb3] (MSC service thread 1-3) WFLYEJB0493: EJB subsystem suspension complete
15:29:37,120 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
15:29:37,285 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
15:29:37,353 INFO  [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.2.3.Final (Apache CXF 3.2.5.jbossorg-1)
15:29:37,405 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
15:29:37,407 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
15:29:37,407 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
15:29:37,408 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 14.0.0.Final (WildFly Core 6.0.1.Final) started in 4668ms - Started 306 of 527 services (321 services are lazy, passive or on-demand)

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

访问项目的url为:127.0.0.1:8080,访问管理后台的url为:http://127.0.0.1:9990/或http://localhost:9990。访问服务器可看到如下界面:

在这里插入图片描述
​ 在该页面中我们可以看到我的wildfly没有添加用户,这里也给出了添加用户的方法,点击bin目录下的add-user.bat文件即可。

What type of user do you wish to add?a) Management User (mgmt-users.properties)b) Application User (application-users.properties)
# 输入a,以添加管理员用户
(a): aEnter 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 :
WFLYDM0098: The password should be different from the username
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)[  ]: yes
About to add user 'test' for realm 'ManagementRealm'
# 继续则输入yes
Is this correct yes/no? yes
Added user 'test' to file 'F:\Desktop\wildfly-14.0.0.Final\standalone\configuration\mgmt-users.properties'
Added user 'test' to file 'F:\Desktop\wildfly-14.0.0.Final\domain\configuration\mgmt-users.properties'
Added user 'test' with groups yes to file 'F:\Desktop\wildfly-14.0.0.Final\standalone\configuration\mgmt-groups.properties'
Added user 'test' with groups yes to file 'F:\Desktop\wildfly-14.0.0.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="dGVzdA==" />

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

设置完成,刷新页面,输入刚刚设置的用户名密码,即可登录管理后台,登录成功后就可以操作后台部署项目了。

在这里插入图片描述
在这里插入图片描述

三、项目快速部署

​进入项目后台管理界面,点击导航栏上的Deployments或首页Deployments下的start,打开项目部署页面。

在这里插入图片描述
点击Deployment旁边的+号,选择第一项,Upload Deployment上传部署。点击Choose a file or drag it here在本机上选择项目的war包,点击下一步。

在这里插入图片描述
设置项目名称,这里的两个名称最好是一样的,这样可以省去很多麻烦(详细信息参考左上角 ?help),打开Enable,点击Finish,当显示Upload successful时,表示项目已经部署成功了。

在这里插入图片描述
在这里插入图片描述
​在浏览器输入http://localhost:8080/项目名或点击页面上的 Context Root

在这里插入图片描述
在这里插入图片描述
如果要使用IP地址访问项目,则需要修改standalone/configuration目录下的standalone.xml文件,拉到最下面,将interfaces标签里的127.0.0.1改成你的IP地址即可。

在这里插入图片描述


http://chatgpt.dhexx.cn/article/K3jv1s8p.shtml

相关文章

wildfly安装及基本使用

一.wildfly在linux下的安装 1.下载地址 官网下载地址&#xff1a;https://www.wildfly.org/downloads/ 2.目录介绍 下载好后我们解压出来看一下目录结构&#xff1a; *appclient 里面是一些默认的配置、服务器日志配置等 *bin 里面就是一些可执行的脚本文件&#xff0c;有添…

什么是Wildfly?

WildFly 是一个 Java Enterprise Edition 全功能应用服务器&#xff0c;它提供了运行 Java Web 应用程序所需的所有功能。WildFly 由 Red Hat 设计和维护&#xff0c;正式名称为 JBoss AS。 总体而言&#xff0c;WildFly可以缩短开发时间&#xff0c;更有效地管理资源&#xff…

什么是wildfly

文章目录 什么是wildfly特点下载安装readme及启动命令启动操作总结一下具体步骤&#xff08;第一版&#xff09;1.配置环境变量(下载上面有)3、环境变量配好之后&#xff0c;需要为JBOSSt添加用户&#xff0c;调用dos窗口&#xff0c;输入命令2、启动Jboss&#xff0c;在dos窗口…

python3.6 安装MySQLdb

前言 最近做python的项目需要将json对象存储到数据库&#xff0c;在网上查了一下发现使用mysql数据库和MySQLdb模块是可以做到的。结果上网上查的时候发现&#xff0c;很多人说MySQLdb只能支持python2.4-2.7&#xff0c;不支持python3&#xff0c;但是我的其他部分基于python3…

[数据库] mysql

前言 各种知识多而且容易遗忘,还不容易复习。最好的方法当然是自己给自己提问,不断补缺查漏,缺什么补什么。本文将各类知识归类,并将全文知识点浓缩在自问自查中,并且都写好目录,自问自查时可以随时跳转过去,方便大家系统的学习复习知识。 水平有限,有错误敬请指正 食用方法 …

MySQL DataBase

文章目录 DBMSSQL备份数据库数据类型事务视图数据库设计三范式分组查询C# 连接 MySQL字符集存储引擎InnoDB行格式记录头信息 数据页结构B 树索引 DBMS DataBase Management System&#xff0c;数据库管理系统。常见的有 MySQL、Oracle、Microsoft SqlServer SQL Structured …

mysql数据库中求圆的面积_MYSQL数据库

数据库&#xff1a; 数据库就是存储数据的仓库 为了方便数据的存储和管理&#xff0c;它将数据按照特定的规律存储在磁盘上&#xff0c;通过数据库的管理系统&#xff0c;可以有效的管理存储在数据库中的数据&#xff1b; mysql数据库的优点&#xff1a; 1.多语言的支持 2.可以…

【数据库MySQL】

数据库MySQL 数据库设计原则和数据库事务 数据库MySQL数据表的设计原则数据库对象编写建议关于库关于表、列关于索引sql编写 数据库事务存储引擎是否支持事务ACID特性事务的状态 显式事务与隐式事务显式事务隐式事务隐式提交数据的情况 事务隔离级别脏读不可重复性幻读 4种隔离…

Database:MySQL

学习笔记&#xff1a;MySQL Copyright: Jingmin Wei, Pattern Recognition and Intelligent System, School of Artificial and Intelligence, Huazhong University of Science and Technology 前面的SQL代码为数据库通用语言&#xff0c;但是结果都是在MySQL环境下运行的结果…

数据库------MYSQL

目录 数据库 关系型数据库 非关系型数据库 MYSQL 登录 创建数据库 字符集 警告,错误,致命 查看数据库 选中数据库 删除库 数据类型 数值类型 字符串类型 日期类型 表的操作 选定数据库 创建表 多行输入 注释 单行注释: 多行注释 查看表结构 查看表 删除表…

Python之安装MySQLdb

Python连接mysql需要MySQLdb模块 一.环境 系统版本&#xff1a;windows10家庭版 Python版本&#xff1a; python3.7.1 IDE&#xff1a;sublime_text3 二.安装说明 如果是python 2.x版本的&#xff0c;在命令行输入执行&#xff1a;pip install MySQLdb即可安装成功如果是py…

DB SQL mysql

今天我们用10分钟&#xff0c;重点梳理一遍以下几方面&#xff1a; 数据库知识点汇总&#xff1b; 数据库事务特性和隔离级别&#xff1b; 详解关系型数据库、索引与锁机制&#xff1b; 数据库调优与最佳实践&#xff1b; 面试考察点及加分项。 知识点汇总 一、数据库的…

python -MySQLdb的安装与使用

MySQLdb是一款较为底层的&#xff0c;python连接mysql用的模块。和更加高级的&#xff0c;提供ORM的模块不同&#xff0c;MySQLdb主要还是聚焦于如何和数据库进行连接和进行基本的操作&#xff0c;操作的体现形式主要还是进行SQL语句的执行。 在Linux下 pip install MySQL-py…

数据库--mysql

数据库 《高性能Mysql(第三版)》 数据库三大范式、反模式 强调属性的原子性约束&#xff0c;要求属性具有原子性&#xff0c;不可再分解强调记录的唯一性约束&#xff0c;表必须有一个主键&#xff0c;并且没有包含在主键中的列必须完全依赖于主键&#xff0c;而不能只依赖于主…

Python 如何安装 MySQLdb ?

人生苦短 我用python Python 标准数据库接口为 Python DB-API&#xff0c; Python DB-API为开发人员提供了数据库应用编程接口。 Python 数据库接口支持非常多的数据库&#xff0c; 你可以选择适合你项目的数据库&#xff1a; GadFlymSQLMySQLPostgreSQLMicrosoft SQL Serve…

MySQL——数据库

1.什么是数据库&#xff1a; 数据库&#xff08;database&#xff09;&#xff1a;存储数据的“仓库”。它保存了一系列有组织的数据。 2.DSMS数据库管理系统&#xff1a; 数据库管理系统&#xff1a;数据库是通过DBMS创建和操作的容器。 数据库管理系统&#xff08;DBMS&a…

数据库----MySQL

文章目录 常识常见数据库数据库结构SQL语句分类 事务事务的4个特性 ACID隔离级别事务处理**提交** **commit****回滚** **rollback** 常用操作库的常用操作建库删库查库使用库 表的常用操作创建表修改表删除表查看所有表查看表结构/设计表 表记录的常用操作插入记录查询记录修改…

数据库—mysql

提示&#xff1a;以下是本篇文章正文内容 一、InnoDB InnoDB 内部做了很多优化&#xff0c;包括从磁盘读取数据时采用的可预测性读&#xff0c;能够自动在内存中创建 hash 索引以加速读操作的自适应哈希索引&#xff0c;以及能够加速插入操作的插入缓冲区等。 InnoDB 支持真正…

MySQLdb安装与使用

一、MAC系统 1. 安装(使用pip命令) 【1】使用 easy_install pip命令安装pip 【2】安装成功&#xff0c;输入pip显示用法、命令行等信息&#xff1b;命令 which pip 可以查看安装位置 【3】要通过python连接mysql数据库&#xff0c;需要安装MySQLdb模块&#xff0c;该模块其实…

MYSQL 数据库

MySql数据库特点 1、开源数据库&#xff0c;不需要支付额外费用&#xff0c;项目上云首选&#xff1b; 2、关系型数据库&#xff0c;支持多条件场景查询&#xff1b; 3、支持多种存储引擎&#xff1b; MySql数据库语句执行步骤 1&#xff09;创建连接&#xff0c;验证用户…