|
Resin provides a fast servlet runner for Apache, allowing Apache to run servlets and JSP files.
To configure Apache to load the Caucho Server Runner, add the following lines to the Apache httpd.conf file:
Note: The caucho-status is optional and probably should be avoided in a production site. It lets you ask the Caucho Apache module about the Caucho status, valuable for debugging. Alternate Apache ConfigurationYou can also configure Apache directly, instead of letting mod_caucho read the configuration from the resin.conf file. If you use this method, you need ensure the Apache configuration matches the Resin configuration.
Dispatchingmod_caucho selects URLs specified by the servlet-mapping directives to go to Resin. Other URLs stay with Apache. There's a more complete discussion of the URL dispatching in the plugin-dispatch tutorial.
In Resin 1.2, you can distribute requests to multiple machines. All requests in a session will go to the same host. In addition, if one host goes down, Resin will send the request to the next available machine. In addition, you can specify backup machines. The backup only will serve requests if all primaries are down. See the http config section for more details.
When mod_caucho can't reach any JVM, it will send a default error page. Sites can customize the error page with the directive in the resin.conf.
By default, Resin will look in resin-2.1.0/doc for JSP files and resin-2.1.0/doc/WEB-INF/classes for servlets and beans. To tell Resin to use Apache's document area, you configure the . Change from 'doc' to something like '/usr/local/apache/htdocs'.
Now you need to start the servlet engine. From the resin-2.1.0/bin folder, click on srun.
Now browse http://localhost/test.jsp. You should get a 'file not found' message.
Create a test file '/usr/local/apache/htdocs/test.jsp'
Browse http://localhost/test.jsp again. You should now get:
The Servlet Runner can be installed as an NT service. To install the service, use
To remove the service, use
You will either need to reboot the machine or start the service from the Control Panel/Services panel to start the server. On a machine reboot, NT will automatically start the servlet runner.
|