独立resin的配置

关掉httpd服务:

[root@data-1-1 ~]# killall httpd

[root@data-1-1 ~]# lsof -i :80    ------>httpd服务的80端口已经停掉!

 

配置resin主配置文件修改如下内容:

90       <http address="*" port="80"/>

104       <http address="*" port="80"/>

 

启动服务:

[root@data-1-1 ~]# killall java

[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng start

Resin/3.1.13 started -server 'peng' for watchdog at 127.0.0.1:6921

[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng01 start

Resin/3.1.13 started -server 'peng01' for watchdog at 127.0.0.1:6922

 

查看的80端口是resin开通的:

[root@data-1-1 ~]# lsof -i :80   

COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME

java    27876 root   73u  IPv6 2885724      0t0  TCP *:http (LISTEN)

 

测试(此时是resin独立做web服务)

[root@data-1-1 ~]# curl http://www.peng.cc/test.jsp

99+1=100

[root@data-1-1 ~]# curl http://blog.peng.cc/test.jsp

99+1=100

[root@data-1-1 ~]# curl http://blog.peng.org/test.jsp

1+1=2

[root@data-1-1 ~]# curl http://www.peng.org/test.jsp

1+1=2

resin配置别名功能

  实现Apache前端多个域名对应后端一个或多个resin的域名。

265    <!--Create first virtual hosts at 20160112.-->

266      <host id="www.peng.org" root-directory="/application/resin/webapps">

267        <host-alias>blog.peng.org</host-alias>

        <host-alias>bbs.peng.org</host-alias>

 

resin配置错误页面优雅显示

282               <error-page error-code='404' location='/tips/404.html'/>

提示:以上配置在每个对应的resin host里都要配置。

演示过程如下:

[root@data-1-1 ~]# cd /application/resin/webapps/peng/

[root@data-1-1 peng]# mkdir tips

[root@data-1-1 peng]# echo 'this is 404 error page!' >>tips/404.html

[root@data-1-1 peng]# cat tips/404.html

this is 404 error page!

提示:错误页面配置内容的根目录是resin站点的根目录,例如:/application/resin/webapps/peng

 

访问一个不存在的页面,客户端访问发现已经进行了404错误页面跳转了:

[root@data-1-1 peng]# curl http://www.peng.org/b.jsp    

this is 404 error page!

提示:Windows客户端谷歌支持,IE和搜狗测试支持的不是很好。

resin配置状态信息显示页面

278           <servlet-mapping servlet-class='com.caucho.servlets.ResinStatusServlet'>

279             <url-pattern>/resin-status-peng.org</url-pattern>

280               <init enable="read"/>

281           </servlet-mapping>

 

浏览器输入如下地址,查看显示结果:

http://www.peng.org/resin-status-peng.org

独立resin web服务与整合企业里如何选用?

Apache+resin

1)resin下的80808081端口要不要开启?

  解答:看业务需求!

Apache+resin   ==》提供服务

Resin+http80(内置web服务器)==》提供服务

2)如果开启了,实现了哪些功能?

  解答:resin独立提供web服务。

3)关闭了,又有什么好处呢?

 解答:Apacheresin一起工作,轻松,动静分离。

resin配置管理页面

285       <web-app id="/resin-admin-peng.org" root-directory="${resin.home}/php/admin">

286          <character-encoding>utf8</character-encoding>

287          <prologue>

288             <resin:set var="resin_admin_external" value="true"/>

289             <resin:set var="resin_admin_insecure" value="true"/>

290          </prologue>

291          <security-constraint>

292            <web-resource-collection>

293                  <url-pattern>/*</url-pattern>

294            </web-resource-collection>

295          </security-constraint>

296       </web-app>

操作演示如下:

浏览器上输入地址:http://www.peng.org/resin-admin-peng.org/

出现如下界面:

在标红的地方输入用户名:peng  密码:redhat

出现如下内容:

The digest for user peng in realm resin is Ji1p9d0+6tX5O0iEGgnPMQ==

The following can now be set in the resin.conf file to enable administration functionality.

<resin xmlns="http://caucho.com">

<management path="admin">

<user name="peng" password="Ji1p9d0+6tX5O0iEGgnPMQ=="/>

...

</management>

...

</resin>

By default, access to the administration application is limited to the localhost. The default behaviour can be changed in the resin.conf file. To enable access to clients other than localhost:

<resin:set var="resin_admin_external" value="true"/>

Once the file has been updated, you can continue to the administration area.

When prompted, use the username and password you provided.

修改resin.conf配置文件(增加标黄的内容):

21  <management path="${resin.root}/admin">

22   <user name="peng" password="Ji1p9d0+6tX5O0iEGgnPMQ==" disable="false"/>

23

24      <resin:if test="${resin.professional}">

25        <deploy-service/>

26        <jmx-service/>

27        <log-service/>

28        <xa-log-service/>

29      </resin:if>

30    </management>

重启服务:

[root@data-1-1 ~]# killall java

[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng start

Resin/3.1.13 started -server 'peng' for watchdog at 127.0.0.1:6921

[root@data-1-1 ~]# /application/resin/bin/httpd.sh -server peng01 start

Resin/3.1.13 started -server 'peng01' for watchdog at 127.0.0.1:6922

在浏览器界面填入相关信息点击提交:

resin服务之三---独立resin的配置的更多相关文章

  1. Apached+resin服务搭建

    一.前言 Resin是CAUCHO公司的产品,是一个非常流行的支持servlets 和jsp的引擎,速度非常快.对servlet和JSP提供了良好的支持,性能也比较优良,resin自身采用JAVA语言 ...

  2. resin服务之一---安装及部署

    参考网站: http://caucho.com/ http://www.oschina.net/p/resin http://caucho.com/resin-4.0/admin/starting-r ...

  3. resin服务之二----整合resin+Apache服务

    整合resin+Apache服务 1.为什么要整合Apache和resin? a. 早期的resin,tomcat对httpd服务支持不好. b.  tomcat,resin对rewrite,expi ...

  4. resin服务一直不停重启

    resin服务不断重启. 原因为resin配置文件使用域名.需要到服务上绑定一下域名.

  5. Reporting Service服务SharePoint集成模式安装配置(3、4、安装sharepoint 2010必备组件及产品)

    Reporting Service服务SharePoint集成模式安装配置 第三步和第四部 第三步 安装sharepoint 2010必备组件 1.安装SharePoint2010必备组件,执行Pre ...

  6. SVN1.6服务端和客户端安装配置指导

    本节向大家描述SVN1.6服务端和客户端安装配置步骤,随着SVN的快速发展,版本也进行了升级更新,本节就和大家一起学习一下SVN1.6服务端和客户端安装配置步骤,欢迎大家一起来学习.下面是具体介绍.1 ...

  7. Windows下基于IIS服务的SSL服务器的配置

    Windows下基于IIS服务的SSL服务器的配置 实验环境 Windows Server 2008 R1(CA) Windows Server 2008 R2(web服务器) Windows 7 x ...

  8. paip. java resin 远程 调试 java resin remote debug

    paip. java resin 远程 调试 java resin remote debug 作者Attilax  艾龙,  EMAIL:1466519819@qq.com 来源:attilax的专栏 ...

  9. CAS单点登录(SSO)服务端的部署和配置---连接MySQL进行身份认证

    一.修改系统host,加入 127.0.0.1 server.test.com127.0.0.1 client1.test.com127.0.0.1 client2.test.com 二.安装grad ...

随机推荐

  1. C#基础之IL ,轻松读懂中间代码IL 转载

    [No0000152]C#基础之IL,轻松读懂IL   先说说学IL有什么用,有人可能觉得这玩意平常写代码又用不上,学了有个卵用.到底有没有卵用呢,暂且也不说什么学了可以看看一些语法糖的实现,或对.n ...

  2. idea教程--快速插入依赖

    1.打开pom.xml文件,按下快捷键Alt+insert,弹出Generate框,选择Dependency. 2.搜索所需jar的关键字. 3.点击add.添加jar包成功.如果第二步没有所要jar ...

  3. 洛谷P4322.最佳团体

    题目大意 一个 \(n(1\leq n\leq 2500)\) 个节点的森林,每个点 \(i\) 有权值 \(s_{i},p_{i}(0<s_{i},p_{i}\leq 10^4)\) 以及父亲 ...

  4. MySQL-DB-封装-入门版

    <?php class MysqlDb{ public $host = "127.0.0.1"; public $user = "root"; publi ...

  5. linux定时任务 - crontab定时任务

    crontab 定时任务命令 linux 系统则是由 cron (crond) 这个系统服务来控制的.Linux 系统上面原本就有非常多的计划性工作,因此这个系统服务是默认启动的.另 外, 由于使用者 ...

  6. 七天接手react项目 —— state&事件处理&ref

    state&事件处理&ref 在 react 起步 一文中,我们学习了 react 相关知识:jsx.组件.props.本篇将继续研究 state.事件处理和ref. state St ...

  7. 03 Java的数据类型分为两大类 类型转换 八大基本类型

    数据类型 强类型语言:要求变量的使用要严格符合规定,所有变量都必须先定义后才能使用 Java的数据类型分为两大类 基本类型(primitive type) 数值类型 整数类型 byte占1个字节范围: ...

  8. LGP5664题解

    厉害. 对于每一列选的数最多占一半,我们得设计一个三维 DP.然而状态刚好够,但是转移明显炸了(而且似乎还需要多项式?) 考虑正难则反,DP 不合法的方案数.总方案数很好算. 发现不合法的方案数只有某 ...

  9. 使用socat反向Shell多台机器

    原创:打码日记(微信公众号ID:codelogs),欢迎分享,转载请保留出处. 场景 很多时候,我们需要批量操作多台机器,业界一般使用Ansible来实现,但使用Ansible来操作多台机器的前提是需 ...

  10. 《Mybatis 手撸专栏》第1章:开篇介绍,我要带你撸 Mybatis 啦!

    作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 1. 为甚,撸Mybatis 我就知道,你会忍不住对它下手! 21年带着粉丝伙伴撸了一遍 Sp ...