<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>lizongbo at 618119.com &#187; Resin</title>
	<atom:link href="http://618119.com/category/webserver/resin/feed" rel="self" type="application/rss+xml" />
	<link>http://618119.com</link>
	<description>工作,生活,java,apache,tomcat,Resin,mina,Hessian,Openfire,XMPP,RPC,Ubuntu</description>
	<lastBuildDate>Wed, 14 Apr 2010 13:15:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>调整resin的resin.conf优化access-log输出日志</title>
		<link>http://618119.com/archives/2009/02/18/135.html</link>
		<comments>http://618119.com/archives/2009/02/18/135.html#comments</comments>
		<pubDate>Tue, 17 Feb 2009 16:25:55 +0000</pubDate>
		<dc:creator>lizongbo</dc:creator>
				<category><![CDATA[Resin]]></category>
		<category><![CDATA[log]]></category>

		<guid isPermaLink="false">http://618119.com/?p=135</guid>
		<description><![CDATA[目前服务器上resin.conf的日志配置一般是：
      《stdout -log path=&#8221;log/stdout.log&#8221; timestamp=&#8221;[%Y-%m-%d %H:%M:%S] &#8221; rollover-size=&#8221;200mb&#8221; /》
      《stderr -log path=&#8221;log/stderr.log&#8221; timestamp=&#8221;[%Y-%m-%d %H:%M:%S] &#8221; rollover-size=&#8221;200mb&#8221; /》
      《access -log path=&#8221;logs/access.log&#8221; rollover-period=&#8221;1D&#8221; rollover-size=&#8221;200mb&#8221;/》
在这种情况下，日志始终是先输出到logs/access.log这样的固定文件里，待文件大小满200M的时候，resin先锁住所有写日志操作，将文件的内容复制到文件名带时间戳的文件里，再清空当前日志文件的内容。
这种情况下，既多增加了磁盘io操作，也因为锁机制导致线程容易满，以至resin被webapp监控重启。
以前出现该问题的时候，只简单的通过关闭access-log绕了过去，而最近web网站的resin也出现了重启，
由于web是lvs负载均衡，因此不能通过关闭accesslog来解决问题。
经过查看resin的源代码分析，结合现在业务的实际情况，可以通过调整日志的配置为按时间周期切割来解决问题。
通过分析和实验，将resin的配置调整后大致为：
      《stdout -log path-format=&#8221;log/stdout.log.%Y%m%d&#8221; timestamp=&#8221;[%Y-%m-%d %H:%M:%S] &#8221; rollover-period=&#8221;1D&#8221; /》
      [...]]]></description>
		<wfw:commentRss>http://618119.com/archives/2009/02/18/135.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>配置独立运行的jsp预编译ant脚本</title>
		<link>http://618119.com/archives/2008/05/08/86.html</link>
		<comments>http://618119.com/archives/2008/05/08/86.html#comments</comments>
		<pubDate>Thu, 08 May 2008 12:23:22 +0000</pubDate>
		<dc:creator>lizongbo</dc:creator>
				<category><![CDATA[JAVA IDE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Resin]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[javac]]></category>
		<category><![CDATA[jspc]]></category>

		<guid isPermaLink="false">http://618119.com/archives/2008/05/08/86.html</guid>
		<description><![CDATA[配置resin开启预编译jsp，在启动时，resin会自动编译jsp，出错信息在 stdout.log中。
[code]
&#60;web-app id="/lizongbo" document-directory="webapps/lizongbo"&#62;
&#60;listener&#62;
&#60;listener-class&#62;com.caucho.jsp.JspPrecompileListener&#60;/listener-class&#62;
&#60;init&#62;
&#60;extension&#62;jsp&#60;/extension&#62;
&#60;extension&#62;jspx&#60;/extension&#62;
&#60;extension&#62;xtp&#60;/extension&#62;
&#60;/init&#62;
&#60;/listener&#62;
&#60;/web-app&#62;
[/code]
在开发过程，经常将页面传到resin上，才发现页面编译失败，浪费了不少时间，因此需要一个在本地预编译进行检查的操作。
resin 3.1以前的版本提供命令行方式进行jsp预编译。
完整的命令例子如下
%JAVA_HOME%\bin\java.exe -classpath %JAVA_HOME%\lib\tools.jar;D:\Java\resin-3.0.19\lib\aopalliance.jar;D:\Java\resin-3.0.19\lib\ejb-20.jar;D:\Java\resin-3.0.19\lib\ejb-30.jar;D:\Java\resin-3.0.19\lib\j2eedeploy.jar;D:\Java\resin-3.0.19\lib\jca-15.jar;D:\Java\resin-3.0.19\lib\jms-11.jar;D:\Java\resin-3.0.19\lib\jmx-12.jar;D:\Java\resin-3.0.19\lib\jsdk-24.jar;D:\Java\resin-3.0.19\lib\jstl-11.jar;D:\Java\resin-3.0.19\lib\jta-101.jar;D:\Java\resin-3.0.19\lib\portlet-10.jar;D:\Java\resin-3.0.19\lib\quercus.jar;D:\Java\resin-3.0.19\lib\resin-jdk15.jar;D:\Java\resin-3.0.19\lib\resin.jar;D:\Java\resin-3.0.19\lib\resinboot.jar;D:\Java\resin-3.0.19\lib\script-10.jar;D:\Java\resin-3.0.19\lib\webutil.jar;D:\Java\resin-3.0.19\plugins\resin-ant.jar com.caucho.jsp.JspCompiler -app-dir  E:\lizongbo\workspace\webapp E:\lizongbo\workspace\webapp
使用起来很不方便。(注意classpath里特意加了%JAVA_HOME%\lib\tools.jar,否则会报错,
出错信息如下：
Exception in thread &#8220;main&#8221; com.caucho.java.JavaCompileException: Resin can&#8217;t loa
d com.sun.tools.javac.Main.  Usually this means that the JDK tools.jar is missin
g from the classpath, possibly because of using a JRE instead of the JDK.  You c
an either add tools.jar to the classpath or change the compiler to an [...]]]></description>
		<wfw:commentRss>http://618119.com/archives/2008/05/08/86.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>开张了。</title>
		<link>http://618119.com/archives/2007/10/15/4.html</link>
		<comments>http://618119.com/archives/2007/10/15/4.html#comments</comments>
		<pubDate>Mon, 15 Oct 2007 14:10:08 +0000</pubDate>
		<dc:creator>lizongbo</dc:creator>
				<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Resin]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://618119.com/archives/4</guid>
		<description><![CDATA[测试一下，首篇开张， apache ,Tomcat,Squid,Tomcat,Lighttpd,resin,memcached,ngnix,Linux,Mina等等。

	Tags: Lighttpd, Linux, nginx, Resin, Squid, Tomcat, Web Server, 数据库

	Related posts
	
	配置WinSCP通过ssh隧道向linux服务器传输文件 (0)
	调整resin的resin.conf优化access-log输出日志 (0)
	神舟笔记本升级安装ubuntu 9.04 64位并编译 multige (0)
	服务器从jdk1.6.0升级到1.6.0_12的过程记录 (0)
	对tomcat cluster集群配置中session复制用法的一个误解 (0)


]]></description>
		<wfw:commentRss>http://618119.com/archives/2007/10/15/4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
