阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署
阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署
1、下载resin包
http://caucho.com/download/resin-4.0.48.zip
2、解压
unzip resin-4.0.48.zip -d /etc/
3、启动resin
/etc/resin-4.0.48/bin/resin.sh start
4、访问测试
curl 127.0.0.1:8080
5、探索resin启动
cd /etc/resin-4.0.48/
重启:bin/resin.sh restart 没问题
cd bin
再重启:./resin.sh restart 提示错误:Error: Unable to access jarfile ./../lib/resin.jar
开始探索:
1、注释掉resin.sh的最后一行,并加入下面两行代码
echo `pwd`(输出当前所在目录)
echo $JAVA_EXE -jar ${RESIN_HOME}/lib/resin.jar $*
2、执行命令:./resin.sh start
输出:
/etc/resin-4.0.48(当前所在目录)
java -jar ./../lib/resin.jar start
3、结论:
./../lib/resin.jar = /etc/lib/resin.jar
而resin.jar的实际路径是:/etc/resin-4.0.48/lib/resin.jar,所有才有:Error: Unable to access jarfile ./../lib/resin.jar
4、返回到/etc/resin-4.0.48目录,执行bin/resin.sh start
输出:
java -jar bin/../lib/resin.jar start
/etc/resin-4.0.48
这次:bin/../lib/resin.jar = /etc/resin-4.0.48/lib/resin.jar(看出来没有,这次指向的resin.jar的路径是正确的,所以能正常启动)
5、探索完毕,还原resin.sh
// 上面的配置已经足够部署项目了,下面我们来安装一个resin启动目录
6、依次执行下面的命令
cd /etc/resin-4.0.48/
不指定jdk时:./configure --prefix=/opt/resin(安装目录)
指定jdk时:./configure --prefix=/opt/resin --with-java-home=/usr/lib/jvm/java-1.7.0 --enable-64bit
make
make install
7、启动
先停止前面启动的服务:/etc/resin-4.0.48/bin/resin.sh stop
启动resin:service resin start(安装后就可以这么启动了)
访问下试试:http://ip:8080
查看启动参数配置:cat -n /etc/init.d/resin
8、添加一个14805端口
进入配置目录 cd /opt/resin/conf
vi resin.xml
找到下面这段代码,在它下面拷贝一份
<cluster id="app">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="${app_servers}" port="6800"/> <host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}"
path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default> <!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy> <!-- the default host, matching any host name -->
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="webapps/ROOT"/> </host> <resin:if test="${resin_doc}">
<host id="${resin_doc_host}" root-directory="${resin_doc_host}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
</host>
</resin:if>
</cluster>
修改为:
<cluster id="llj">
<server-multi id-prefix="llj-" address-list="${llj_servers}" port="6800"/> <host-default>
<web-app-deploy path="webapps"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}"
path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default> <host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy> <host id="" root-directory=".">
<web-app id="/" root-directory="webapps/ROOT"/>
</host>
</cluster>
配置端口:
vi resin.properties,添加下面两个属性
llj.http = 14805
llj_servers = 127.0.0.1:6801
启动服务:/opt/resin/bin/resin.sh --server llj-0 start
访问下试试:curl 127.0.0.1:14805
到现在为止,resin上两个端口8080、14805都启动好了。它们指向的是同一个应用目录,你也可以为它们指定不同的应用目录
9、部署项目
将一个.war文件拷贝到/opt/resin/webapps目录下,再访问下两个端口的服务,显示的是你项目的首页,表示部署成功
10、这里只是简单的配置、部署,集群配置详细后续再讲,打完收工
阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署的更多相关文章
- 阿里云服务器Linux CentOS安装配置(零)目录
阿里云服务器Linux CentOS安装配置(零)目录 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 阿里云服务器Linux CentOS安装配置(二)yum安装svn 阿里云服 ...
- 阿里云服务器Linux CentOS安装配置(九)shell编译、打包、部署
阿里云服务器Linux CentOS安装配置(九)shell编译.打包.部署 1.查询当前目录以及子目录下所有的java文件,并显示查询结果 find . -name *.java -type f - ...
- 阿里云服务器Linux CentOS安装配置(八)nginx安装、配置、域名绑定
阿里云服务器Linux CentOS安装配置(八)nginx安装.配置.域名绑定 1.安装nginx yum -y install nginx 2.启动nginx service nginx star ...
- 阿里云服务器Linux CentOS安装配置(七)域名解析
阿里云服务器Linux CentOS安装配置(七)域名解析 1.购买域名 登录阿里云,左侧菜单点击[域名],然后[域名注册],完成域名购买.(一般首年45元) 2.添加域名解析 在域名列表里点击你的域 ...
- 阿里云服务器Linux CentOS安装配置(五)jetty配置、部署
阿里云服务器Linux CentOS安装配置(五)jetty配置.部署 1.官网下载jetty:wget http://repo1.maven.org/maven2/org/eclipse/jetty ...
- 阿里云服务器Linux CentOS安装配置(四)yum安装tomcat
阿里云服务器Linux CentOS安装配置(四)yum安装tomcat 1.yum -y install tomcat 执行命令后,会帮你把jdk也安装好 2.tomcat安装目录:/var/li ...
- 阿里云服务器Linux CentOS安装配置(三)yum安装mysql
阿里云服务器Linux CentOS安装配置(三)yum安装mysql 1.执行yum安装mysql命令:yum -y install mysql-server mysql-devel 2.启动mys ...
- 阿里云服务器Linux CentOS安装配置(二)yum安装svn
阿里云服务器Linux CentOS安装配置(二)yum安装svn 1.secureCRT连接服务器 2.先创建一个文件夹,用来按自己的习惯来,用来存放数据 mkdir /data 3.yum安装sv ...
- 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器
阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 我在阿里云购买的服务器配置 CPU:1核 内存:2G 系统盘:40G 公共镜像:CentOS 6.5 64位 公网带宽:1Mbps ...
随机推荐
- xmind portable
portable : http://dl2.xmind.cn/xmind-7.5-update1-portable.zip
- Mac键盘图标与对应快捷按键标志汇总
Mac键盘图标与对应快捷按键 ⌘--Command () win键 ⌃ --Control ctrl键 ⌥--Option (alt) ⇧--Shift ⇪--Caps Lock fn--功能键就是 ...
- log4cxx
1.简介 (1)Apache log4cxx当前是由Apache软件基金会进行维护.它是java中著名开源项目Apache log4j在c++中对应的日志框架.它是借助于APR(Apache Port ...
- sys/types.h fcntl.h unistd.h sys/stat.h
sys/types.h 是Unix/Linux系统的基本系统数据类型的头文件,含有size_t,time_t,pid_t等类型. 在应用程序源文件中包含 <sys/types.h> 以访问 ...
- xcode 常见错误报错问题!
1:module file '/Users/shaka/Library/Developer/Xcode/DerivedData/ModuleCache/92IKIZLYISUT/Darwin-2OA ...
- php总结二篇
PHP的网站主要攻击方式: 1.命令注入(Command Injection) 2.eval注入(Eval Injection) 3.客户端脚本攻击(Script Insertion) 4.跨网站脚本 ...
- chrome 不支持window.webkitNotifications.createNotification消息通知API了
今天惊奇的发现,chrome22里已经不支持window.webkitNotifications.createHTMLNotification方法了: 但是,在chrome extension里还可以 ...
- 【leetcode】Factorial Trailing Zeroes
题目描述: Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be ...
- 2016 ACM/ICPC Asia Regional Dalian Online(更新到五道题)
1006 Football Games 这道题输入也很阴险!!! 这道题过题姿势最优雅的,不是if else if else if.那样很容易wa的. 如果没有平手选项, 赢得加一分的话, 可以用La ...
- iOS 从git拷贝Xcode的snippets
do following things in terminal 1. check out the project using: git clone gitAddress 2. cd the proje ...