阿里云服务器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

找到下面这段代码,在它下面拷贝一份

  1. <cluster id="app">
  2. <!-- define the servers in the cluster -->
  3. <server-multi id-prefix="app-" address-list="${app_servers}" port="6800"/>
  4.  
  5. <host-default>
  6. <!-- creates the webapps directory for .war expansion -->
  7. <web-app-deploy path="webapps"
  8. expand-preserve-fileset="WEB-INF/work/**"
  9. multiversion-routing="${webapp_multiversion_routing}"
  10. path-suffix="${elastic_webapp?resin.id:''}"/>
  11. </host-default>
  12.  
  13. <!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
  14. <host-deploy path="hosts">
  15. <host-default>
  16. <resin:import path="host.xml" optional="true"/>
  17. </host-default>
  18. </host-deploy>
  19.  
  20. <!-- the default host, matching any host name -->
  21. <host id="" root-directory=".">
  22. <!--
  23. - webapps can be overridden/extended in the resin.xml
  24. -->
  25. <web-app id="/" root-directory="webapps/ROOT"/>
  26.  
  27. </host>
  28.  
  29. <resin:if test="${resin_doc}">
  30. <host id="${resin_doc_host}" root-directory="${resin_doc_host}">
  31. <web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
  32. </host>
  33. </resin:if>
  34. </cluster>

修改为:

  1. <cluster id="llj">
  2. <server-multi id-prefix="llj-" address-list="${llj_servers}" port="6800"/>
  3.  
  4. <host-default>
  5. <web-app-deploy path="webapps"
  6. expand-preserve-fileset="WEB-INF/work/**"
  7. multiversion-routing="${webapp_multiversion_routing}"
  8. path-suffix="${elastic_webapp?resin.id:''}"/>
  9. </host-default>
  10.  
  11. <host-deploy path="hosts">
  12. <host-default>
  13. <resin:import path="host.xml" optional="true"/>
  14. </host-default>
  15. </host-deploy>
  16.  
  17. <host id="" root-directory=".">
  18. <web-app id="/" root-directory="webapps/ROOT"/>
  19. </host>
  20. </cluster>

配置端口:

vi resin.properties,添加下面两个属性

  1. llj.http = 14805
  2. 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. Proj.4库的编译及使用

    Proj.4库的编译及使用 Proj.4是开源GIS最著名的地图投影库,GRASS GIS, MapServer, PostGIS, Thuban, OGDI, Mapnik, TopoCad, GD ...

  2. render()方法是render_to_response

    自django1.3开始:render()方法是render_to_response的一个崭新的快捷方式, 前者会自动使用 RequestContext.而后者必须coding 出来,这是最明显的区别 ...

  3. Java实现JDBC连接数据库实例

    import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sq ...

  4. Android 小笔记

    <!--     xml                --> android:visibility="gone"  可以隐藏 元素 xmlns:bootstrapbu ...

  5. Android杂记:genymotion与eclipse报错问题

    用eclipse启动genymotion时有时候会报 The connection to adb is down, and a severe error has occured. You must r ...

  6. C# 获取时间差状态

    /// <summary> /// 根据时间获取时间状态 /// </summary> /// <param name="dt"></pa ...

  7. Ubuntu16.04安装nginx

    //ubuntu //安装nginxcurl -LJO http://nginx.org/download/nginx-1.10.1.tar.gz tar zxvf nginx-1.10.1.tar. ...

  8. 【转】Java Web 项目获取运行时路径 classpath

    Java Web 项目获取运行时路径 classpath 假设资源文件放在maven工程的 src/main/resources 资源文件夹下,源码文件放在 src/main/java/下, 那么ja ...

  9. 转载:稀疏矩阵存储格式总结+存储效率对比:COO,CSR,DIA,ELL,HYB

    http://www.cnblogs.com/xbinworld/p/4273506.html 稀疏矩阵是指矩阵中的元素大部分是0的矩阵,事实上,实际问题中大规模矩阵基本上都是稀疏矩阵,很多稀疏度在9 ...

  10. TodoMVC中的Backbone+MarionetteJS+RequireJS例子源码分析之三 Views

    这个版本的TodoMVC中的视图组织划分比较细,更加易于理解,这也得益于Marionette为我们带来了丰富的视图选择,原生的backbone只有views,而Marionette则有itemview ...