![]() | ||||||||||
| documentation examples changes overview quick start installation command-line configuration guide: admin admin amber bam caching clustering database deployment ejb 3.0 embedding filters hessian ioc jsf jsp logging messaging performance quercus/php remoting scheduled tasks security server push servlets third-party troubleshooting virtual hosting watchdog webapp xml and xslt | user guide: administration
Overview and introduction to Resin from an administration perspective.
![]() In the previous figure:
All HTTP content in Resin is ultimately handled by a servlet. If
Resin can't find a servlet for a URL, it will return
a To match up the URL to its final servlet and the content, you need all of the following properly configured:
Based on Resin's dispatching flow, here's a minimal
resin.xml to serve some content out of The following resin.xml specifies an Apache-style structure where
all content is served from the Example: minimal /etc/resin/resin.xml for HTTP
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<cluster id="app-tier">
<development-mode-error-page/>
<server id="" address="127.0.0.1" port="6800">
<http port="8080"/>
</server>
<resin:import path="/etc/resin/app-default.xml"/>
<host id="">
<web-app id="">
<root-directory>/var/www/htdocs</root-directory>
</web-app>
</host>
</cluster>
</resin>
rewrite-dispatch replaces mod_rewriteFor many applications like Drupal and Mediawiki, it's important to rewrite a user-friendly URL to an internal servlet or PHP URL. Resin's <rewrite-dispatch> replaces the capabilities of mod_rewrite for Apache. Example: WEB-INF/resin-web.xml Drupal rewriting
<web-app xmlns="http://caucho.com/ns/resin">
<rewrite-dispatch>
<dispatch regexp="\.(php|gif|css|jpg|png|ico|js|htm|html)"/>
<forward regexp="^/" target="/index.php?q="/>
</rewrite-dispatch>
</web-app>
![]() Because the Resin server is started as a child of the watchdog
process, its own JVM arguments come from the resin.xml,
not from the command-line of Resin's configuration allows for great flexibility in choosing a directory structure for your site, or adapting Resin to your existing site configuration if you're upgrading from Apache/PHP for a Drupal or MediaWiki site. There are three main directory styles:
Dynamic Virtual HostIn the dynamic virtual host configuration, your content is placed
in Adding a new virtual host is easy just by adding a new
Deploying a web-application is also straightforward by adding
a .war file to In a standard Unix deployment, your configuration files go in
The Resin jars, JNI libraries and licenses go in
Example: Unix dynamic virtual host
/etc/resin/
resin.xml - main Resin configuration file
app-default.xml - default servlet configuration
admin-users.xml - /resin-admin users
/etc/init.d/resin - startup script
/usr/lib/resin/ - ${resin.home}
lib/*.jar - Resin's Java classes
libexec/*.so - native JNI libraries
libexec64/*.so - JNI for 64-bit systems
licenses/* - Resin Pro licenses
win32/*.dll - Win32 JNI
win64/*.dll - Win64 JNI
/var/www/ - ${resin.root}
admin/ - Resin database and cache storage
doc/admin/ - /resin-admin source
ivy2/ - ivy2 jar repository
lib/ - Shared application jars
log/ - watchdog and Resin debug logging
hosts/foo.com/ - dynamic host contents
log/ - access logging per virtual host
host.xml - optional host-specific configuration
webapps/ROOT/ - web-app content
index.php - web-app content
WEB-INF/ - web-app classes and configuration
web.xml - servlet-standard configuration
resin-web.xml - Resin-specific configuration
lib/*.jar - application jars
classes/**/*.class - application classes
work/ - work directory for JSP, PHP, etc.
Example: /etc/resin/resin.xml
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<root-directory>/var/www</root-directory>
<cluster id="">
<server id="" address="127.0.0.1" port="6800">
<http port="8080"/>
</server>
<resin:import path="/etc/resin/app-default.xml"/>
<host-default>
<resin:import path="host.xml" optional="true"/>
<web-app-deploy path="webapps"/>
</host-default>
<host-deploy path="hosts"/>
</cluster>
</resin>
Apache UpgradeIn an Apache upgrade, you have an existing site that you're
upgrading to use Quercus or just evaluating the performance
improvement for an existing side. The content is placed
in For Apache-style sites with multiple virtual hosts, you can add new <host> tags for each host, and add a <root-directory> to set the host's root. Example: Unix Apache upgrade
/etc/resin/
resin.xml - main Resin configuration file
app-default.xml - default servlet configuration
/etc/init.d/resin - startup script
/usr/local/share/resin/ - ${resin.home}
lib/*.jar - Resin's Java classes
...
/var/www/ - ${resin.root}
admin/ - Resin database and cache storage
log/ - watchdog and Resin debug logging
logs/ - HTTP access logging
htdocs/
index.php - web-app content
WEB-INF/ - web-app classes and configuration
resin-web.xml - Resin-specific configuration
lib/*.jar - application jars
classes/**/*.class - application classes
work/ - work directory for JSP, PHP, etc.
Example: /etc/resin/resin.xml
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<root-directory>/var/www</root-directory>
<cluster id="">
<server id="" address="127.0.0.1" port="6800">
<http port="8080"/>
</server>
<resin:import path="/etc/resin/app-default.xml"/>
<host id="">
<web-app id="" root-directory="htdocs"/>
</host>
</cluster>
</resin>
Java App-Server directory structureA common Java app-server deployment structure looks like a
mixture of the full dynamic host configuration and the Apache-style
static configuration. The virtual hosts are configured statically
like Apache, but webapps are created dynamically by dropping .war
files in a Example: Java app-server structure
/etc/resin/
resin.xml - main Resin configuration file
app-default.xml - default servlet configuration
/etc/init.d/resin - startup script
/usr/local/share/resin/ - ${resin.home}
lib/*.jar - Resin's Java classes
...
/var/www/ - ${resin.root}
admin/ - Resin database and cache storage
log/ - watchdog and Resin debug logging
logs/ - HTTP access logging
webapps/
ROOT/ - web-app for "/"
index.php - web-app content
WEB-INF/ - web-app classes and configuration
resin-web.xml - Resin-specific configuration
lib/*.jar - application jars
classes/**/*.class - application classes
work/ - work directory for JSP, PHP, etc.
wiki/ - web-app for "/wiki"
...
drupal/ - web-app for "/wiki"
index.php
Example: /etc/resin/resin.xml
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">
<root-directory>/var/www</root-directory>
<cluster id="">
<server id="" address="127.0.0.1" port="6800">
<http port="8080"/>
</server>
<resin:import path="/etc/resin/app-default.xml"/>
<host id="">
<web-app-deploy path="webapps"/>
</host>
</cluster>
</resin>
A Resin server needs to have enough memory, threads, and sockets to handle the user load. For the most part, the defaults provide a good starting point, but it's a good idea to become familiar with the primary resources.
MemoryMemory is the most important configuration item for the machine.
You need enough virtual memory to handle heap, stack, and permanent
memory, and enough physical memory to avoid swapping. If the JVM
runs out of memory, it may throw
Resin can notify you by email when it detects something wrong with the server. The main mechanism is adding a new logging handler sending mail for warning and severe messages. When a log entry is added at the WARNING or SEVERE level, Resin will send a mail containing the log information. You can then look at the administration console to debug any problems. The configuration is described in the logging configuration section. Example: resin.xml with mail logging
<resin xmlns="http://caucho.com/ns/resin">
<log-handler name="" level="warning" uri="mail:">
<init>
<to>admin@foo.com</to>
<properties>
mail.smtp.host=127.0.0.1
mail.smtp.port=25
</properties>
</init>
</log-handler>
</resin>
| |||||||||