WildFly 曾用名:JBoss Application Server ,红帽公司宣布 JBoss AS 的继任者 WildFly,WildFly 将推动下一代应用服务器技术的发展,这个项目的名字是 JBoss.org 社区成员在 2012 年底投票产生。
WildFly 将继续保留 JBoss 企业应用平台并定位一些关键的中间件技术,包括更灵活和更先进的应用开发,实现开放混合云和 Java EE 7.
实验平台:CentOS 7.2
软件: wildfly-10.0.0.Final.zip jdk-8u77-linux-x64.tar quickstart-10.x.zip apache-maven-3.3.9-bin.zip
步骤:
1.搭建jdk平台
wildfly 10 要求在JDK 8以上平台运行
# tar zxf jdk-8u77-linux-x64.tar.gz && rm -rf jdk-8u77-linux-x64.tar
# mv jdk-1.8.0_77/ /usr/local/jdk
#vim /etc/profile.d/java.sh
JAVA_HOME=/usr/local/jdk
JAVA_BIN=$JAVA_HOME/bin
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
CLASSPATH=$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/jre/lib/charsets.jar
# source /etc/profile.d/java.sh
# java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
2.安装wildfly
上传到linux主机root目录后,解压到/usr/local
#unzip wildfly-10.0.0.Final.zip -d /usr/local/
#cd /usr/local
#mv wildfly-10.0.0.Final wildfly
添加系统管理用户
#cd /usr/local/wildfly/bin
找到add-user.sh
#./add-user.sh
按照提示步骤建立用户:adminwildfly(自定义) 密码:自定义
修改配置文件standalone.xml
#vim /usr/local/wildfly/standalone/configuration/standalone.xml
将文件中的127.0.0.1替换成0.0.0.0
然后启动服务
#./standalone.sh&
查看服务是否启动
# netstat -anput |grep java
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 3475/java
tcp 0 0 0.0.0.0:9990 0.0.0.0:* LISTEN 3475/java
3.安装maven
#unzip apache-maven-3.3.9-bin.zip -d /usr/local
设置环境变量,在/etc/profile 加入以下内容
#vim /etc/profile
export MAVEN_HOME=/usr/local/apache-maven-3.3.9
PATH=$PATH:$MAVEN_HOME/bin
#source /etc/profile
测试安装是否成功
#mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.8.0_77, vendor: Oracle Corporation
Java home: /usr/local/jdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.6", arch: "amd64", family: "unix"
4.快速部署应用(确保wildfly已经启动)
#unzip quickstart-10.x.zip
# cd quickstart-10.x/helloworld
#mvn clean package wildfly:deploy
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:59 min
[INFO] Finished at: 2016-04-06T23:07:24-04:00
[INFO] Final Memory: 25M/266M
[INFO] ------------------------------------------------------------------------
验证是否部署成功:http://localhost:8080/wildfly-helloworld
Hello World!