Resin with IIS

[face=Arial]Resin provides a fast servlet runner for IIS 4.0 and PWS, allowing IIS to run servlets and JSP files.[/face]
..upload200412711023880585310.gif

To configure Resin with IIS, you must follow the following steps:

1.Configure IIS/PWS
2.Configure resin.conf
3.Start httpd

Configuring IIS/PWS
ISAPI Filter
You should use resin-2.1.0/bin/setup.exe to setup your configuration. If you use setup.exe, you can just skip to the next section.

ISAPI Filter Priority
isapi_srun.dll installs itself as the default priority. Some users may need to set the priority to a higher level, e.g. to override IIS's DAV support.





...





Configuring resin.conf
resin.conf should mirror the configuration of IIS. In other words, you need to configure the document root and any directory aliases.

For many users, you only need to change the app-dir attribute from 'doc' to something like 'd:inetpubwwwroot'. For more complicated configurations, you'll need to add path-mapping attributes.

resin.conf



app-dir='d:inetpubwwwroot'>
servlet-name='invoker'/>

servlet-name='com.caucho.jsp.XtpServlet'/>
servlet-name='com.caucho.jsp.JspServlet'/>





Testing the servlet engine
From the Resin bin folder, you need to start httpd.exe to start the servlet runner.

Now browse http://localhost/test.jsp. You should get a 'file not found' message.

Create a test file 'd:inetpubwwwroot est.jsp'



2 + 2 =


Browse http://localhost/test.jsp again. You should now get

2 + 2 = 4

As a final test, change language to 'java' and refresh the page. Nothing should change.


Command line arguments
The following configuration line arguments are recognized by httpd.exe. When installed as a service, these argument will be used when the service starts.

Argument Meaning
-verbose Write more verbose information to the log file
-resin_home Sets the location of Resin
-java_home Specify the JDK location
-msjava Use Microsoft's JVM
-nojit Disable JIT compilation to help debugging
-classpath Add to the classpath
-J Set a Java command line argument, e.g. -J-nojit.
-X Set a Java -X command line argument, e.g. -Xms128m.
-D Set a Java variable, e.g. -Dresin.home=here.
-install Install as an NT service
-install-as Install as an NT service with the specific name.
-remove Remove as an NT service
-remove-as Remove as an NT service with the specific name.



Memory Configuration
Memory configuration is part of the JVM's arguments. For most JVMs, you can find the full list by starting "java -X".

Memory Configuration


Argument Meaning
-Xms Initial Java heap size, e.g. -Xms32m
-Xmx Maximum Java heap size, e.g. -Xmx128m




Deploying as an NT Service

Once you're comfortable with using Resin with IIS, you can install it as an NT service. As a service, Resin will automatically start when NT reboots. The service will automatically restart Resin if it unexpectedly exits.

To install the service, use

dos> resin-2.1.0/bin/httpd -install




To remove the service, use

dos> resin-2.1.0/bin/httpd -remove




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.


Note: There is a bug in many JDKs which cause the JDK to exit when the administrator logs out. JDK 1.3 and later can avoid that bug if the JDK is started with -Xrs.

dos> resin-2.1.0/bin/httpd -install -Xrs


Load Balancing

Configuring IIS/PWS
ISAPI Filter
ISAPI Filter Priority
Configuring resin.conf
Testing the servlet engine
Command line arguments
Memory Configuration
Deploying as an NT Service
Load Balancing
Manual Configuration
Troubleshooting


Resin provides a fast servlet runner for IIS 4.0 and PWS, allowing IIS to run servlets and JSP files.


To configure Resin with IIS, you must follow the following steps:

Configure IIS/PWS
Configure resin.conf
Start httpd
Configuring IIS/PWS


ISAPI Filter
You should use resin-2.1.0/bin/setup.exe to setup your configuration. If you use setup.exe, you can just skip to the next section.

ISAPI Filter Priority
isapi_srun.dll installs itself as the default priority. Some users may need to set the priority to a higher level, e.g. to override IIS's DAV support.





...







Configuring resin.conf
resin.conf should mirror the configuration of IIS. In other words, you need to configure the document root and any directory aliases.

For many users, you only need to change the app-dir attribute from 'doc' to something like 'd:inetpubwwwroot'. For more complicated configurations, you'll need to add path-mapping attributes.

resin.conf
app-dir='d:inetpubwwwroot'>
servlet-name='invoker'/>

servlet-name='com.caucho.jsp.XtpServlet'/>
servlet-name='com.caucho.jsp.JspServlet'/>






Testing the servlet engine
From the Resin bin folder, you need to start httpd.exe to start the servlet runner.

Now browse http://localhost/test.jsp. You should get a 'file not found' message.

Create a test file 'd:inetpubwwwroot est.jsp'


2 + 2 =




Browse http://localhost/test.jsp again. You should now get

2 + 2 = 4




As a final test, change language to 'java' and refresh the page. Nothing should change.

Command line arguments


The following configuration line arguments are recognized by httpd.exe. When installed as a service, these argument will be used when the service starts.

Argument Meaning
-verbose Write more verbose information to the log file
-resin_home Sets the location of Resin
-java_home Specify the JDK location
-msjava Use Microsoft's JVM
-nojit Disable JIT compilation to help debugging
-classpath Add to the classpath
-J Set a Java command line argument, e.g. -J-nojit.
-X Set a Java -X command line argument, e.g. -Xms128m.
-D Set a Java variable, e.g. -Dresin.home=here.
-install Install as an NT service
-install-as Install as an NT service with the specific name.
-remove Remove as an NT service
-remove-as Remove as an NT service with the specific name.


Memory Configuration
Memory configuration is part of the JVM's arguments. For most JVMs, you can find the full list by starting "java -X".

Memory Configuration Argument Meaning
-Xms Initial Java heap size, e.g. -Xms32m
-Xmx Maximum Java heap size, e.g. -Xmx128m


Deploying as an NT Service


Once you're comfortable with using Resin with IIS, you can install it as an NT service. As a service, Resin will automatically start when NT reboots. The service will automatically restart Resin if it unexpectedly exits.

To install the service, use

dos> resin-2.1.0/bin/httpd -install




To remove the service, use

dos> resin-2.1.0/bin/httpd -remove




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.


Note: There is a bug in many JDKs which cause the JDK to exit when the administrator logs out. JDK 1.3 and later can avoid that bug if the JDK is started with -Xrs.

dos> resin-2.1.0/bin/httpd -install -Xrs




Load Balancing Resin 1.2


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, the IIS filter 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.

resin.conf







...





Manual Configuration
Experts may want to configure Resin/IIS by hand instead of using the setup program. If you need to know the steps involved:

Make sure httpd.exe works
If you have a virtual site, you must have the virtual directory /scripts point to d:inetpubscripts
Copy isapi_srun.dll to the IIS scripts directory, d:inetpubscripts. You may need to run net stop w3svc.
(optional) Create a resin.ini in d:inetpubscripts pointing to the resin.conf.
Configure IIS to load isapi_srun.dll as an ISAPI filter.
Restart IIS (control panel/services) or net stop w3svc followed by net start w3svc.
Browse /servlet/Hello and /foo.jsp. You should see a "cannot connect" error.
Start httpd.exe
Browse /servlet/Hello and /foo.jsp. You should now see the servlet.
Copying isapi_srun.dll to inetpub/scripts directory is relatively straightforward. If you're upgrading to a new version of Resin, you may need to stop IIS (control panel/services) to get permission to overwrite isapi_srun.dll.

The resin.ini is an optional file in inetpub/scripts to override the automatic registry $RESIN_HOME/conf/resin.conf configuration file. If you only have one Resin server, you should not create a resin.ini and let isapi_srun.dll use the registry value set by the setup.exe program.

resin.ini is only needed if you have multiple Resin configuration files for different IIS virtual hosts.

The resin.ini should contain the following line:

CauchoConfigFile d:/resin2.0/conf/resin.conf




Adding an ISAPI filter is accomplished in the IIS manager.

Troubleshooting




Check your configuration with the standalone bin/httpd. In other words, add a block and browse http://localhost:8080.
Check http://localhost/caucho-status. That will tell if the ISAPI filter/extension is properly installed.
Each srun host should be green and the mappings should match your resin.conf.
If caucho-status fails entirely, the problem is in the isapi_srun installation. Try http://localhost/scripts/isapi_srun.dll/caucho-status directly (bypassing the filter). If this fails, IIS can't find isapi_srun.dll.
Check that isapi_srun.dll is in c:inetpubscripts.
Make sure that your IIS host has a mapping from /scripts to c:inetpubscripts and that the /scripts has execute permissions.
If you've created a new IIS web site, you need to create a virtual directory /scripts pointing to the d:inetpubscripts directory.
If caucho-status shows the wrong mappings, there's something wrong with the resin.conf.
If caucho-status shows a red servlet runner, then httpd.exe hasn't properly started.
If you get a "cannot connect to servlet engine", caucho-status will show red, and httpd.exe hasn't started properly.
If httpd.exe doesn't start properly, you should look at the logs in resin2.0/log. You should start httpd.exe -verbose to get more information.
If you get Resin's file not found, the IIS configuration is good but the resin.conf probably points to the wrong directories.
[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9650775/viewspace-921095/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9650775/viewspace-921095/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值