################ # resin.conf ################<!-- - Resin 3.0 configuration file. --> <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> <!-- - Logging configuration for the JDK logging API. --> <log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/> <log name='com.caucho.java' level='config' path='stdout:' timestamp='[%H:%M:%S.%s] '/> <log name='com.caucho.loader' level='config' path='stdout:' timestamp='[%H:%M:%S.%s] '/> <!-- - For production sites, change dependency-check-interval to something - like 600s, so it only checks for updates every 10 minutes. --> <dependency-check-interval>2s</dependency-check-interval> <!-- - You can change the compiler to "javac" or jikes. - The default is "internal" only because it's the most - likely to be available. --> <javac compiler="internal" args=""/> <!-- Security providers. - <security-provider> - com.sun.net.ssl.internal.ssl.Provider - </security-provider> --> <!-- - If starting bin/resin as root on Unix, specify the user name - and group name for the web server user. - - <user-name>resin</user-name> - <group-name>resin</group-name> --> <!-- - Configures threads shared among all HTTP and SRUN ports. --> <thread-pool> <!-- Maximum number of threads. --> <thread-max>128</thread-max> <!-- Minimum number of spare connection threads. --> <spare-thread-min>25</spare-thread-min> </thread-pool> <!-- - Configures the minimum free memory allowed before Resin - will force a restart. --> <min-free-memory>1M</min-free-memory> <server> <!-- adds all .jar files under the resin/lib directory --> <class-loader> <tree-loader path="$resin-home/lib"/> </class-loader> <!-- Configures the keepalive --> <keepalive-max>500</keepalive-max> <keepalive-timeout>120s</keepalive-timeout> <!-- The http port --> <http server-id="" host="*" port="8080"/> <!-- - SSL port configuration: - - <http port="8443"> - <openssl> - <certificate-file>keys/gryffindor.crt</certificate-file> - <certificate-key-file>keys/gryffindor.key</certificate-key-file> - <password>test123</password> - </openssl> - </http> --> <!-- - The local cluster, used for load balancing and distributed - backup. --> <cluster> <srun server-id="" host="127.0.0.1" port="6802" index="1"/> </cluster> <!-- - Enables/disables exceptions when the browser closes a connection. --> <ignore-client-disconnect>true</ignore-client-disconnect> <!-- - Enables the cache --> <cache path="cache" memory-size="10M"/> <!-- - Enables periodic checking of the server status. - - With JDK 1.5, this will ask the JDK to check for deadlocks. - All servers can add <url>s to be checked. --> <ping> <!-- <url>http://localhost:8080/test-ping.jsp</url> --> </ping> <!-- - Defaults applied to each web-app. --> <web-app-default> <!-- - Sets timeout values for cacheable pages, e.g. static pages. --> <cache-mapping url-pattern="/" expires="5s"/> <cache-mapping url-pattern="*.gif" expires="60s"/> <cache-mapping url-pattern="*.jpg" expires="60s"/> <!-- - Servlet to use for directory display. --> <servlet servlet-name="directory" servlet-class="com.caucho.servlets.DirectoryServlet"/> </web-app-default> <!-- - Sample database pool configuration - - The JDBC name is java:comp/env/jdbc/test - <database> <jndi-name>jdbc/mysql</jndi-name> <driver type="org.gjt.mm.mysql.Driver"> <url>jdbc:mysql://localhost:3306/test</url> <user></user> <password></password> </driver> <prepared-statement-cache-size>8</prepared-statement-cache-size> <max-connections>20</max-connections> <max-idle-time>30s</max-idle-time> </database> --> <!-- - Default host configuration applied to all virtual hosts. --> <host-default> <class-loader> <compiling-loader path='webapps/WEB-INF/classes'/> <library-loader path='webapps/WEB-INF/lib'/> </class-loader> <!-- - With another web server, like Apache, this can be commented out - because the web server will log this information. --> <access-log path='logs/access.log' format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' rollover-period='1W'/> <!-- creates the webapps directory for .war expansion --> <web-app-deploy path='webapps'/> <!-- creates the deploy directory for .ear expansion --> <ear-deploy path='deploy'> <ear-default> <!-- Configure this for the ejb server - - <ejb-server> - <config-directory>WEB-INF</config-directory> - <data-source>jdbc/test</data-source> - </ejb-server> --> </ear-default> </ear-deploy> <!-- creates the deploy directory for .rar expansion --> <resource-deploy path='deploy'/> <!-- creates a second deploy directory for .war expansion --> <web-app-deploy path='deploy'/> </host-default> <!-- includes the web-app-default for default web-app behavior --> <resin:import path="${resinHome}/conf/app-default.xml"/> <!-- configures the default host, matching any host name --> <host id=''> <document-directory>doc</document-directory> <!-- configures the root web-app --> <web-app id='/'> <!-- adds xsl to the search path --> <class-loader> <simple-loader path="$host-root/xsl"/> </class-loader> <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/> </web-app> </host> </server> </resin>
上面哥哥给的那句放到resin.conf里相应的位置后就起动不了,说配置文件的语法错误。 后来把配置文件里的这句删掉就可以了。 <!-- - Servlet to use for directory display. --> <servlet servlet-name="directory" servlet-class="com.caucho.servlets.DirectoryServlet"/>
# resin.conf
################<!--
- Resin 3.0 configuration file.
-->
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<!--
- Logging configuration for the JDK logging API.
-->
<log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/>
<log name='com.caucho.java' level='config' path='stdout:'
timestamp='[%H:%M:%S.%s] '/>
<log name='com.caucho.loader' level='config' path='stdout:'
timestamp='[%H:%M:%S.%s] '/> <!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
-->
<dependency-check-interval>2s</dependency-check-interval> <!--
- You can change the compiler to "javac" or jikes.
- The default is "internal" only because it's the most
- likely to be available.
-->
<javac compiler="internal" args=""/> <!-- Security providers.
- <security-provider>
- com.sun.net.ssl.internal.ssl.Provider
- </security-provider>
--> <!--
- If starting bin/resin as root on Unix, specify the user name
- and group name for the web server user.
-
- <user-name>resin</user-name>
- <group-name>resin</group-name>
--> <!--
- Configures threads shared among all HTTP and SRUN ports.
-->
<thread-pool>
<!-- Maximum number of threads. -->
<thread-max>128</thread-max> <!-- Minimum number of spare connection threads. -->
<spare-thread-min>25</spare-thread-min>
</thread-pool> <!--
- Configures the minimum free memory allowed before Resin
- will force a restart.
-->
<min-free-memory>1M</min-free-memory> <server>
<!-- adds all .jar files under the resin/lib directory -->
<class-loader>
<tree-loader path="$resin-home/lib"/>
</class-loader> <!-- Configures the keepalive -->
<keepalive-max>500</keepalive-max>
<keepalive-timeout>120s</keepalive-timeout> <!-- The http port -->
<http server-id="" host="*" port="8080"/> <!--
- SSL port configuration:
-
- <http port="8443">
- <openssl>
- <certificate-file>keys/gryffindor.crt</certificate-file>
- <certificate-key-file>keys/gryffindor.key</certificate-key-file>
- <password>test123</password>
- </openssl>
- </http>
--> <!--
- The local cluster, used for load balancing and distributed
- backup.
-->
<cluster>
<srun server-id="" host="127.0.0.1" port="6802" index="1"/>
</cluster> <!--
- Enables/disables exceptions when the browser closes a connection.
-->
<ignore-client-disconnect>true</ignore-client-disconnect> <!--
- Enables the cache
-->
<cache path="cache" memory-size="10M"/> <!--
- Enables periodic checking of the server status.
-
- With JDK 1.5, this will ask the JDK to check for deadlocks.
- All servers can add <url>s to be checked.
-->
<ping>
<!-- <url>http://localhost:8080/test-ping.jsp</url> -->
</ping> <!--
- Defaults applied to each web-app.
-->
<web-app-default>
<!--
- Sets timeout values for cacheable pages, e.g. static pages.
-->
<cache-mapping url-pattern="/" expires="5s"/>
<cache-mapping url-pattern="*.gif" expires="60s"/>
<cache-mapping url-pattern="*.jpg" expires="60s"/> <!--
- Servlet to use for directory display.
-->
<servlet servlet-name="directory"
servlet-class="com.caucho.servlets.DirectoryServlet"/>
</web-app-default> <!--
- Sample database pool configuration
-
- The JDBC name is java:comp/env/jdbc/test
-
<database>
<jndi-name>jdbc/mysql</jndi-name>
<driver type="org.gjt.mm.mysql.Driver">
<url>jdbc:mysql://localhost:3306/test</url>
<user></user>
<password></password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
--> <!--
- Default host configuration applied to all virtual hosts.
-->
<host-default>
<class-loader>
<compiling-loader path='webapps/WEB-INF/classes'/>
<library-loader path='webapps/WEB-INF/lib'/>
</class-loader> <!--
- With another web server, like Apache, this can be commented out
- because the web server will log this information.
-->
<access-log path='logs/access.log'
format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
rollover-period='1W'/> <!-- creates the webapps directory for .war expansion -->
<web-app-deploy path='webapps'/> <!-- creates the deploy directory for .ear expansion -->
<ear-deploy path='deploy'>
<ear-default>
<!-- Configure this for the ejb server
-
- <ejb-server>
- <config-directory>WEB-INF</config-directory>
- <data-source>jdbc/test</data-source>
- </ejb-server>
-->
</ear-default>
</ear-deploy> <!-- creates the deploy directory for .rar expansion -->
<resource-deploy path='deploy'/> <!-- creates a second deploy directory for .war expansion -->
<web-app-deploy path='deploy'/>
</host-default> <!-- includes the web-app-default for default web-app behavior -->
<resin:import path="${resinHome}/conf/app-default.xml"/> <!-- configures the default host, matching any host name -->
<host id=''>
<document-directory>doc</document-directory> <!-- configures the root web-app -->
<web-app id='/'>
<!-- adds xsl to the search path -->
<class-loader>
<simple-loader path="$host-root/xsl"/>
</class-loader> <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
</web-app>
</host>
</server>
</resin>
<web-app id='/'>
<directory-servlet id='false'/>
</web-app>
# app-default.xml
#################<server xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core"><web-app-default>
<!-- configures the default class loader -->
<class-loader>
<compiling-loader path='WEB-INF/classes'/>
<library-loader path='WEB-INF/lib'/>
</class-loader> <servlet servlet-name="file"
servlet-class="com.caucho.servlets.FileServlet"/> <servlet servlet-name="jsp"
servlet-class="com.caucho.jsp.JspServlet">
<load-on-startup/>
</servlet> <servlet servlet-name="jspx"
servlet-class="com.caucho.jsp.JspServlet">
<init>
<xml>true</xml>
</init>
<load-on-startup/>
</servlet> <servlet servlet-name="xtp"
servlet-class="com.caucho.jsp.XtpServlet"/> <servlet-mapping url-pattern="*.jsp" servlet-name="jsp"/>
<servlet-mapping url-pattern="*.jspx" servlet-name="jspx"/>
<servlet-mapping url-pattern="*.xtp" servlet-name="xtp"/> <servlet-mapping url-pattern="/" servlet-name="file"/> <servlet servlet-name="j_security_check"
servlet-class="com.caucho.server.security.FormLoginServlet"/> <login-config>
<auth-method>basic</auth-method>
<realm-name>resin</realm-name>
</login-config> <!-- Configures the special index files to check for directory URLs -->
<welcome-file-list>
<welcome-file>index.xtp</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list> <mime-mapping extension='.html' mime-type='text/html'/>
<mime-mapping extension=".aif" mime-type="audio/x-aiff"/>
<mime-mapping extension=".aiff" mime-type="audio/x-aiff"/>
<mime-mapping extension=".aifc" mime-type="audio/x-aiff"/>
<mime-mapping extension=".ai" mime-type="application/postscript"/>
<mime-mapping extension=".au" mime-type="audio/basic"/>
<mime-mapping extension=".asc" mime-type="text/plain"/>
<mime-mapping extension=".asf" mime-type="video/x-ms-asf"/>
<mime-mapping extension=".asx" mime-type="video/x-ms-asf"/>
<mime-mapping extension=".avi" mime-type="video/x-msvideo"/>
<mime-mapping extension=".bin" mime-type="application/octet-stream"/>
<mime-mapping extension=".bcpio" mime-type="application/x-bcpio"/>
<mime-mapping extension=".bmp" mime-type="image/bmp"/>
<mime-mapping extension=".class" mime-type="application/octet-stream"/>
<mime-mapping extension=".cpt" mime-type="application/mac-compactpro"/>
<mime-mapping extension=".css" mime-type="text/css"/>
<mime-mapping extension=".cpio" mime-type="application/x-cpio"/>
<mime-mapping extension=".csh" mime-type="application/x-csh"/>
<mime-mapping extension=".cdf" mime-type="application/x-netcdf"/>
<mime-mapping extension=".dms" mime-type="application/octet-stream"/>
<mime-mapping extension=".doc" mime-type="application/msword"/>
<mime-mapping extension=".dcr" mime-type="application/x-director"/>
<mime-mapping extension=".dir" mime-type="application/x-director"/>
<mime-mapping extension=".dxr" mime-type="application/x-director"/>
<mime-mapping extension=".dvi" mime-type="application/x-dvi"/>
<mime-mapping extension=".exe" mime-type="application/octet-stream"/>
<mime-mapping extension=".eps" mime-type="application/postscript"/>
<mime-mapping extension=".etx" mime-type="text/x-setext"/>
<mime-mapping extension=".gtar" mime-type="application/x-gtar"/>
<mime-mapping extension=".gif" mime-type="image/gif"/>
<mime-mapping extension=".gz" mime-type="application/octet-stream"/>
<mime-mapping extension=".hdml" mime-type="text/x-hdml"/>
<mime-mapping extension=".hqx" mime-type="application/mac-binhex40"/>
<mime-mapping extension=".html" mime-type="text/html"/>
<mime-mapping extension=".htm" mime-type="text/html"/>
<mime-mapping extension=".hdf" mime-type="application/x-hdf"/>
<mime-mapping extension=".ief" mime-type="image/ief"/>
<mime-mapping extension=".ice" mime-type="x-conference/x-cooltalk"/>
<mime-mapping extension=".js" mime-type="application/x-javascript"/>
<mime-mapping extension=".jpeg" mime-type="image/jpeg"/>
<mime-mapping extension=".jpg" mime-type="image/jpeg"/>
<mime-mapping extension=".jpe" mime-type="image/jpeg"/>
<mime-mapping extension=".kar" mime-type="audio/midi"/>
<mime-mapping extension=".latex" mime-type="application/x-latex"/>
<mime-mapping extension=".lha" mime-type="application/octet-stream"/>
<mime-mapping extension=".lhz" mime-type="application/octet-stream"/>
<mime-mapping extension=".mid" mime-type="audio/midi"/>
<mime-mapping extension=".mpeg" mime-type="video/mpeg"/>
<mime-mapping extension=".mpg" mime-type="video/mpeg"/>
<mime-mapping extension=".mpe" mime-type="video/mpeg"/>
<mime-mapping extension=".mov" mime-type="video/quicktime"/>
<mime-mapping extension=".movie" mime-type="video/x-sgi-movie"/>
<mime-mapping extension=".mpga" mime-type="audio/mpeg"/>
<mime-mapping extension=".mp2" mime-type="audio/mpeg"/>
<mime-mapping extension=".mp3" mime-type="audio/mpeg"/>
<mime-mapping extension=".man" mime-type="application/x-troff-man"/>
<mime-mapping extension=".me" mime-type="application/x-troff-me"/>
<mime-mapping extension=".ms" mime-type="application/x-troff-ms"/>
<mime-mapping extension=".nc" mime-type="application/x-netcdf"/>
<mime-mapping extension=".oda" mime-type="application/oda"/>
<mime-mapping extension=".pdf" mime-type="application/pdf"/>
<mime-mapping extension=".ps" mime-type="application/postscript"/>
<mime-mapping extension=".ppt" mime-type="application/vnd.ms-powerpoint"/>
<mime-mapping extension=".png" mime-type="image/png"/>
<mime-mapping extension=".pgn" mime-type="application/x-chess-pgn"/>
<mime-mapping extension=".pnm" mime-type="image/x-portable-anymap"/>
<mime-mapping extension=".pbm" mime-type="image/x-portable-bitmap"/>
<mime-mapping extension=".pgm" mime-type="image/x-portable-graymap"/>
<mime-mapping extension=".ppm" mime-type="image/x-portable-pixmap"/>
<mime-mapping extension=".qt" mime-type="video/quicktime"/>
<mime-mapping extension=".rtf" mime-type="application/rtf"/>
<mime-mapping extension=".ram" mime-type="audio/x-pn-realaudio"/>
<mime-mapping extension=".rm" mime-type="audio/x-pn-realaudio"/>
<mime-mapping extension=".rpm" mime-type="audio/x-pn-realaudio-plugin"/>
<mime-mapping extension=".ra" mime-type="audio/x-realaudio"/>
<mime-mapping extension=".ras" mime-type="image/x-cmu-raster"/>
<mime-mapping extension=".rgb" mime-type="image/x-rgb"/>
<mime-mapping extension=".rtx" mime-type="text/richtext"/>
<mime-mapping extension=".rtf" mime-type="text/rtf"/>
<mime-mapping extension=".smi" mime-type="application/smil"/>
<mime-mapping extension=".smil" mime-type="application/smil"/>
<mime-mapping extension=".sml" mime-type="application/smil"/>
<mime-mapping extension=".skp" mime-type="application/x-koan"/>
<mime-mapping extension=".skd" mime-type="application/x-koan"/>
<mime-mapping extension=".skt" mime-type="application/x-koan"/>
<mime-mapping extension=".skm" mime-type="application/x-koan"/>
<mime-mapping extension=".src" mime-type="application/x-wais-source"/>
<mime-mapping extension=".sh" mime-type="application/x-sh"/>
<mime-mapping extension=".shar" mime-type="application/x-shar"/>
<mime-mapping extension=".swf" mime-type="application/x-shockwave-flash"/>
<mime-mapping extension=".sit" mime-type="application/x-stuffit"/>
<mime-mapping extension=".spl" mime-type="application/x-futuresplash"/>
<mime-mapping extension=".sv4cpio" mime-type="application/x-sv4cpio"/>
<mime-mapping extension=".sv4crc" mime-type="application/x-sv4crc"/>
<mime-mapping extension=".snd" mime-type="audio/basic"/>
<mime-mapping extension=".sgm" mime-type="text/sgml"/>
<mime-mapping extension=".tgz" mime-type="application/octet-stream"/>
<mime-mapping extension=".tar" mime-type="application/x-tar"/>
<mime-mapping extension=".tcl" mime-type="application/x-tcl"/>
<mime-mapping extension=".tex" mime-type="application/x-tex"/>
<mime-mapping extension=".texinfo" mime-type="application/x-texinfo"/>
<mime-mapping extension=".texi" mime-type="application/x-texinfo"/>
<mime-mapping extension=".t" mime-type="application/x-troff"/>
<mime-mapping extension=".tr" mime-type="application/x-troff"/>
<mime-mapping extension=".roff" mime-type="application/x-troff"/>
<mime-mapping extension=".tiff" mime-type="image/tiff"/>
<mime-mapping extension=".tif" mime-type="image/tiff"/>
<mime-mapping extension=".txt" mime-type="text/plain"/>
<mime-mapping extension=".tsv" mime-type="text/tab-separated-values"/>
<mime-mapping extension=".ustar" mime-type="application/x-ustar"/>
<mime-mapping extension=".vcd" mime-type="application/x-cdlink"/>
<mime-mapping extension=".vrml" mime-type="model/vrml"/>
<mime-mapping extension=".wav" mime-type="audio/x-wav"/>
<mime-mapping extension=".wax" mime-type="audio/x-ms-wax"/>
<mime-mapping extension=".wrl" mime-type="model/vrml"/>
<mime-mapping extension=".wma" mime-type="audio/x-ms-wma"/>
<mime-mapping extension=".wml" mime-type="text/vnd.wap.wml"/>
<mime-mapping extension=".wmls" mime-type="text/vnd.wap.wmlscript"/>
<mime-mapping extension=".wmlc" mime-type="application/vnd.wap.wmlc"/>
<mime-mapping extension=".wmlsc" mime-type="application/vnd.wap.wmlscript"/>
<mime-mapping extension=".wbmp" mime-type="image/vnd.wap.wbmp"/>
<mime-mapping extension=".xls" mime-type="application/vnd.ms-excel"/>
<mime-mapping extension=".xbm" mime-type="image/x-xbitmap"/>
<mime-mapping extension=".xpm" mime-type="image/x-xpixmax"/>
<mime-mapping extension=".xwd" mime-type="image/x-xwindowdump"/>
<mime-mapping extension=".xml" mime-type="text/xml"/>
<mime-mapping extension=".zip" mime-type="application/zip"/>
<mime-mapping extension=".z" mime-type="application/octet-stream"/> <resin:import path="WEB-INF/web.xml" optional="true"/>
<resin:import path="WEB-INF/resin-web.xml" optional="true"/>
</web-app-default></server>
后来把配置文件里的这句删掉就可以了。 <!--
- Servlet to use for directory display.
-->
<servlet servlet-name="directory"
servlet-class="com.caucho.servlets.DirectoryServlet"/>