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/項目名 便可訪問
完成