1、安装jdk1.8
地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
安装包:jdk-8u181-linux-x64.tar.gz
解压到/usr/local/
$sudo tar xvf jdk-8u181-linux-x64.tar.gz -C /usr/local/
配置环境变量
$sudo vim /etc/profile
#在最后加入
#set Java environment
export JAVA_HOME=/usr/local/jdk1.8.0_181
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
测试jdk是否安装成功
$source /etc/profile
$java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
2、安装WildFly 14
地址:http://wildfly.org/downloads/
安装包:wildfly-14.0.1.Final.zip
解压到/usr/local/wildfly14
$sudo mkdir /usr/local/wildfly14
$sudo tar xvf wildfly-14.0.1.Final.zip -C /usr/local/wildfly14
配置环境变量
$sudo vim /etc/profile
#在最后加入
export JBOSS_HOME=/usr/local/wildfly14
export PATH=$JBOSS_HOME/bin:$PATH
#加载新的环境变量
$source /etc/profile
增加管理员用户
进入/usr/local/wildfly14目录,运行下面命令,然后按提示增加管理员用户,并设置密码
#./add-user.sh
注:如果使用的是云服务器,修改/usr/local/wildfly14/standalone/configuration/standalone.xml文件,使其可以在任何外网访问贪wildfly后面管理,如下:
找到下面三行,看到是要访问public(8080端口的)和management的interface,将interface中的127.0.0.1改为0.0.0.0即可。
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"><socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management"port="${jboss.management.https.port:9993}"/>
修改后为:
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
启动服务:
#standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/local/wildfly14
JAVA: /usr/local/jdk1.8.0_181/bin/java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSiz e=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byt eman -Djava.awt.headless=true
在浏览器中,打开例如:http://127.0.0.1:9990
如果是云服务器,没有桌面,直接把127.0.0.1改为云服务器地址访问。
3、安装mysql
$sudo apt-get install mysql-server
启动、查看状态、测试、停止
#启动
$sudo service mysql start
#查看状态
$sudo service mysql status
#测试
$mysql -uroot -pxxxxxxx
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.7.23-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>exit
#停止
$sudo service mysql stop
mysql 8.0以上的版本,增加用户,并且授权远程登陆,特别注意,不然后续远程连接会失败。
mysql>create user 'likai'@'%' identified by 'Likai123@likai';
mysql>alter user 'likai'@'%' identified by 'Likai123@likai';
mysql>flush privileges;