Chinaunix首页 | 论坛 | 博客
  • 博客访问: 134968
  • 博文数量: 22
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 494
  • 用 户 组: 普通用户
  • 注册时间: 2013-03-29 09:06
文章分类

全部博文(22)

文章存档

2015年(3)

2014年(14)

2013年(5)

我的朋友

分类: LINUX

2015-05-20 11:24:47

因为tomcat性能不好。并发超过五百就连接堵塞。换resin

安装resin
安装resin之前需要安装jdk
  1. [root@primary src]# yum install gcc* openssl
  2. [root@primary src]# tar xf resin-pro-4.0.41.tar.gz
  3. [root@primary src]# cd resin-pro-4.0.41
  4. [root@primary resin-pro-4.0.41]# ./configure --prefix=/usr/local/resin
  5. [root@primary resin-pro-4.0.41]# make
  6. [root@primary resin-pro-4.0.41]# make install
  7. [root@localhost resin]# ls
  8. app-inf  bin conf doc endorsed lib libexec log project-jars resin-data resin-inf watchdog-data webapp-jars webapps
 [root@localhost resin]# cd conf/
 [root@localhost conf]# vim resin.properties 
#修改resin端口
app.http          : 25005

[root@localhost conf]# vim resin.xml    #发布目录
 

war包放在webapps中,项目配置文件目录就放在resin下就可以了。和webapps同级。

曾经遇到苦恼,log日志太多。访问日志也多

[root@localhost conf]# vim cluster-default.xml 
  1. <!--
  2.        - Default host configuration applied to all virtual hosts.
  3.       -->
  4.     <host-default>
  5.       <access-log path="log/access.log"
  6.                  format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
  7.                  rollover-period="1D"       //按天轮询
  8.                 rollover-size="11mb"        //超过11M轮询
  9.                 rollover-count="2"
  10. />

将jvm日志关掉
[root@localhost conf]# vim resin.xml 
  1. <!-- Logging configuration for the JDK logging API -->
  2.   <log-handler name="" level="off" path="stdout:"
  3.                timestamp="[%y-%m-%d %H:%M:%S.%s]"
  4.                format=" {${thread}} ${log.message}"/>
日志级别:off - disable logging
                severe - severe errors only
                warning - warnings
                info - information
                config - configuration
                fine - fine debugging
                finer - finer debugging
                finest - finest debugging
                all - all debugging

安装resin脚本

  1. #!/bin/bash
  2. # install resin
  3. #call ./resin.sh resin-pro-4.0.41.tar.gz
  4.     install_path=/usr/local/resin
  5.     pro_dir=/usr/local/resin/lib
  6.     soft_dir=/usr/local/src
  7.     soft=`ls -lh $soft_dir |grep "resin.*gz" |awk '{print $8}'`
  8.     
  9.     [ -d resin-pro-4.0.41 ]&& rm -rf resin-pro-4.0.41
  10.     [ -d $install_path ] && rm -rf $install_path
  11.     /bin/tar xf $1
  12.     cd /$soft_dir/resin-pro-4.0.41
  13. #install
  14.     ./configure --prefix=$install_path
  15.     make
  16.     make install
  17. #change file
  18.     [ -f $pro_dir/pro.jar ] && rm -rf $pro_dir/pro.jar && cp $soft_dir/pro.jar $pro_dir
  19. #modify resin.properties
  20.     echo "please input a port:"
  21.     read port
  22.     sed -i '/app\.http/s/8080/'$port'/; /jvm/s/^#//g; 98,101s/^#//g ' $install_path/conf/resin.properties
  23.     sed -i '104s/\//\/file/; 104s/webapps\/ROOT/\/home\/sxhl\/file/' $install_path/conf/resin.xml
  24. #access-log
  25.     sed -i '/rollover-period/s/1W/1D/; /rollover-period/i rollover-size="11mb"\n rollover-count="2"' $install_path/conf/cluster-default.xml
  26.     
  27. #web-app
  28.     $install_path/bin/resin.sh start



阅读(1745) | 评论(0) | 转发(0) |
0

上一篇:Linux Shell常用技巧

下一篇:没有了

给主人留下些什么吧!~~