OS:CentOS Linux release 7.5.1804 (Core)html
下载地址:
https://developer.ibm.com/wasdev/downloads/#asset/runtimes-wlp-javaee8java
JDK
官网下载安装jdk1.8linux
Nginx
http://nginx.org/en/download.htmlnginx
安装JDKc++
[root@k14 ~]# rpm -ivh jdk-8u121-linux-x64.rpm Preparing... ################################# [100%] Updating / installing... 1:jdk1.8.0_121-2000:1.8.0_121-fcs ################################# [100%] Unpacking JAR files... tools.jar... plugin.jar... javaws.jar... deploy.jar... rt.jar... jsse.jar... charsets.jar... localedata.jar...
解压下载的Liberty压缩包到安装目录vim
[root@k14 ~]# unzip wlp-javaee8-19.0.0.2.zip -d /usr/local/was
ide
启动默认实例测试
[root@k14 ~]# /usr/local/was/wlp/bin/server start Starting server defaultServer. Server defaultServer started with process ID 2967.
启动成功,可是如今还访问不了,由于默认监听在127.0.0.1 的9080端口,因此须要安装个nginx反向代理代理
下载nginx源码包,编译安装code
先安装依赖
[root@k14 nginx-1.14.2]# yum install -y gcc-c++ pcre-devel zlib-devel
编译安装
[root@k14 nginx-1.14.2]# ./configure --prefix=/usr/local/nginx && make && make install
设置反向代理
[root@k14 nginx-1.14.2]# vim /usr/local/nginx/conf/nginx.conf . location / { root html; index index.html index.htm; #location里面增长一行 proxy_pass http://127.0.0.1:9080; }
启动nginx
[root@k14 was]# /usr/local/nginx/sbin/nginx
打开测试,起来了
这里以jenkins为例
先中止Liberty
[root@k14 was]# /usr/local/was/wlp/bin/server stop
把war包放到defaultServer下的dropins目录下,启动Liberty便可
[root@k14 was]# mv jenkins.war /usr/local/was/wlp/usr/servers/defaultServer/dropins/ [root@k14 was]# /usr/local/was/wlp/bin/server start Starting server defaultServer. Server defaultServer started with process ID 12275.
启动成功,使用http://192.168.1.14/项目名 便可访问
完成