阿里云服务器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多端口配置、安装、部署的更多相关文章

  1. 阿里云服务器Linux CentOS安装配置(零)目录

    阿里云服务器Linux CentOS安装配置(零)目录 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 阿里云服务器Linux CentOS安装配置(二)yum安装svn 阿里云服 ...

  2. 阿里云服务器Linux CentOS安装配置(九)shell编译、打包、部署

    阿里云服务器Linux CentOS安装配置(九)shell编译.打包.部署 1.查询当前目录以及子目录下所有的java文件,并显示查询结果 find . -name *.java -type f - ...

  3. 阿里云服务器Linux CentOS安装配置(八)nginx安装、配置、域名绑定

    阿里云服务器Linux CentOS安装配置(八)nginx安装.配置.域名绑定 1.安装nginx yum -y install nginx 2.启动nginx service nginx star ...

  4. 阿里云服务器Linux CentOS安装配置(七)域名解析

    阿里云服务器Linux CentOS安装配置(七)域名解析 1.购买域名 登录阿里云,左侧菜单点击[域名],然后[域名注册],完成域名购买.(一般首年45元) 2.添加域名解析 在域名列表里点击你的域 ...

  5. 阿里云服务器Linux CentOS安装配置(五)jetty配置、部署

    阿里云服务器Linux CentOS安装配置(五)jetty配置.部署 1.官网下载jetty:wget http://repo1.maven.org/maven2/org/eclipse/jetty ...

  6. 阿里云服务器Linux CentOS安装配置(四)yum安装tomcat

    阿里云服务器Linux CentOS安装配置(四)yum安装tomcat 1.yum -y install tomcat  执行命令后,会帮你把jdk也安装好 2.tomcat安装目录:/var/li ...

  7. 阿里云服务器Linux CentOS安装配置(三)yum安装mysql

    阿里云服务器Linux CentOS安装配置(三)yum安装mysql 1.执行yum安装mysql命令:yum -y install mysql-server mysql-devel 2.启动mys ...

  8. 阿里云服务器Linux CentOS安装配置(二)yum安装svn

    阿里云服务器Linux CentOS安装配置(二)yum安装svn 1.secureCRT连接服务器 2.先创建一个文件夹,用来按自己的习惯来,用来存放数据 mkdir /data 3.yum安装sv ...

  9. 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器

    阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 我在阿里云购买的服务器配置 CPU:1核 内存:2G 系统盘:40G 公共镜像:CentOS 6.5 64位 公网带宽:1Mbps ...

随机推荐

  1. 【GWAS文献解读】疟原虫青蒿素抗药性的全基因组关联分析

    英文名:Genetic architecture of artemisinin-resistant Plasmodium falciparum 中文名:疟原虫青蒿素抗药性的全基因组关联分析 期刊:Na ...

  2. .NET LINQ查询语法与方法语法

    LINQ 查询语法与方法语法      通过使用 C# 3.0 中引入的声明性查询语法,介绍性 LINQ 文档中的多数查询都被编写为查询表达式. 但是,.NET 公共语言运行时 (CLR) 本身并不具 ...

  3. 【Java EE 学习 25 上】【网上图书商城项目实战】

    一.概述 1.使用的jdk版本:1.6 2.java EE版本:1.6 3.指导老师:传智播客 王建 二.小项目已经实现的功能 普通用户: 1.登陆 2.注册 3.购物 4.浏览 管理员用户(全部管理 ...

  4. SpringMVC学习(三)整合SpringMVC和MyBatis

    工程结构 导入jar包 配置文件 applicationContext-dao.xml---配置数据源.SqlSessionFactory.mapper扫描器 applicationContext-s ...

  5. 第二十六篇:两个SOUI新控件 ---- SListView和SComboView(借用Andorid的设计)

    SOUI原来实现的SListBoxEx的效率一直是我对SOUI不太满意的地方.包括后来网友实现的SListCtrlEx. 这类控件为每一个列表项创建一个SWindow来容纳数据,当数据量比较大(100 ...

  6. codeforces Round#381 div2

    第一题: 按余数分类,1,2,3分别由哪些基数组成 1->[1][2+3][3+3+3] 2->[1+1][2][3+3] 3->[1+1+1][1+2][3] #include&l ...

  7. 数据库错误:check the manual that corresponds to your MySQL server version for the right sy

    检查对应到您的MySQL服务器版本附近使用正确的语法手册 数据库插入的时候出现上述问题,总结了两方面原因: 1.语法错误,这是百度之得到的大部分结果,但是没有解决我的问题 2.仔细观察我的sql语句, ...

  8. Mysql的一些使用

    1.批量执行脚本 source sql路径

  9. 《Invert》开发日志04:工具、资源和服务

    这篇记录一下<Invert>用到的工具.资源和服务.秉承两个原则:一,绝不侵犯版权:二,尽量节省开支. 首先是工具.游戏引擎使用免费的Unity个人版: 编码IDE使用免费的VisualS ...

  10. maven ClassNotFoundException: org.springframework.web.context.ContextLoaderL

    信息: Starting Servlet Engine: Apache Tomcat/6.0.32 2012-3-31 9:39:40 org.apache.catalina.core.Standar ...