Apache-style single webapp server
From Resin 3.0
(Difference between revisions)
Line 1: | Line 1: | ||
+ | {{Cleanup}} | ||
[[Category: Cookbook]] | [[Category: Cookbook]] | ||
Latest revision as of 15:46, 2 December 2011
This article requires cleanup and may refer to a legacy version of Resin.
Please visit http://www.caucho.com/documentation/ for the most up-to-date documentation. |
Resin can be configured with an Apache-style document root, like /var/www/public-html. The configuration can continue to use .war style deployment or Resin's repository deployment.
- changes to "resin" user from root
- /var/www/public-html is the single root directory
- listens to port 80
- listens to port 8090 for /resin-admin
- enables proxy-cache with 64M memory
resin.xml configuration
<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin"> <log-handler name="" level="all" path="stdout:" timestamp="[%y-%m-%d %H:%M:%S.%s] "/> <logger name="com.caucho" level="info"/> <resin:AdminAuthenticator> <resin:import path="${__DIR__}/admin-users.xml" optional="true"/> </resin:AdminAuthenticator> <cluster id="web-cluster"> <server-default> <http port="80"/> <http port="8090"/> <user-name>resin</user-name> <group-name>resin</group-name> </server-default> <server id="a" address="192.168.1.10" port="6800"/> <resin:import path="${__DIR__}/app-default.xml"/> <development-mode-error-page/> <proxy-cache memory-size="64M"/> <resin:RemoteAdminService/> <resin:DeployService/> <resin:JmxService/> <resin:LogService/> <resin:StatService/> <host id=""> <root-directory>/var/www</root-directory> <access-log path="log/access.log" format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' rollover-period="1W"/> <web-app id="/"> <root-directory>/var/www/public-html</root-directory> <archive-path>/var/www/ROOT.war</archive-path> </web-app> </host> <host id="*:8090"> <web-app id="/resin-admin" root-directory="${resin.root}/doc/admin"> <prologue> <resin:set var="resin_admin_external" value="false"/> <resin:set var="resin_admin_insecure" value="true"/> </prologue> </web-app> </host> </cluster> </resin>
- <log-handler> configures java.util.logging to log all output in ${resin.root}/log
- <logger> sets the logging level for com.caucho to "info".
- <http port="80"/> listens to port 80 for HTTP
- <http port="8090"/> listens to port 8090 for /resin-admin
- <archive-path>/var/www/ROOT.war</archive-path> sets the optional location for ROOT.war deployment
Deployment
Deployment in this configuration is possible in a number of ways
- use /var/www/public-html directly, for example expanding a wordpress application
- deploy /var/www/ROOT.war and let Resin deploy and expand from that file
- use the Resin command line to deploy ROOT.war
- use the /resin-admin deploy form (currently in web-apps) to deploy the ROOT.war
command line deployment
The command line deployment would look like:
unix> java -jar lib/resin.jar deploy -user admin -password xxxx ROOT.war
The user and password are configured in the admin-users.xml. The /resin-admin:9080 page has a form to help create the admin-users.xml file.