分享
 
 
 

Resin with IIS

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

[face=Arial]Resin PRovides a fast servlet runner for IIS 4.0 and PWS, allowing IIS to run servlets and jsp files.[/face]

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.

<caUCho.com>

<iis priority='high'/>

<http-server>

...

</http-server>

<caucho.com>

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:\inetpub\wwwroot'. For more complicated configurations, you'll need to add path-mapping attributes.

resin.conf

<caucho.com>

<http-server

app-dir='d:\inetpub\wwwroot'>

<servlet-mapping url-pattern='/servlet/*'

servlet-name='invoker'/>

<servlet-mapping url-pattern='*.xtp'

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

<servlet-mapping url-pattern='*.jsp'

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

</http-server>

</caucho.com>

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:\inetpub\wwwroot\test.jsp'

<%@ page language=javascript %>

2 + 2 = <%= 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 <path> Sets the location of Resin

-java_home <path> Specify the JDK location

-msjava Use Microsoft's JVM

-nojit Disable JIT compilation to help debugging

-classpath <cp> Add to the classpath

-J<arg> Set a Java command line argument, e.g. -J-nojit.

-X<arg> Set a Java -X command line argument, e.g. -Xms128m.

-D<foo=bar> Set a Java variable, e.g. -Dresin.home=here.

-install Install as an NT service

-install-as <name> Install as an NT service with the specific name.

-remove Remove as an NT service

-remove-as <name> 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<size> Initial Java heap size, e.g. -Xms32m

-Xmx<size> 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.

<caucho.com>

<iis priority='high'/>

<http-server>

...

</http-server>

<caucho.com>

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:\inetpub\wwwroot'. For more complicated configurations, you'll need to add path-mapping attributes.

resin.conf <caucho.com>

<http-server

app-dir='d:\inetpub\wwwroot'>

<servlet-mapping url-pattern='/servlet/*'

servlet-name='invoker'/>

<servlet-mapping url-pattern='*.xtp'

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

<servlet-mapping url-pattern='*.jsp'

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

</http-server>

</caucho.com>

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:\inetpub\wwwroot\test.jsp'

<%@ page language=Javascript %>

2 + 2 = <%= 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 <path> Sets the location of Resin

-java_home <path> Specify the JDK location

-msjava Use Microsoft's JVM

-nojit Disable JIT compilation to help debugging

-classpath <cp> Add to the classpath

-J<arg> Set a Java command line argument, e.g. -J-nojit.

-X<arg> Set a Java -X command line argument, e.g. -Xms128m.

-D<foo=bar> Set a Java variable, e.g. -Dresin.home=here.

-install Install as an NT service

-install-as <name> Install as an NT service with the specific name.

-remove Remove as an NT service

-remove-as <name> 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<size> Initial Java heap size, e.g. -Xms32m

-Xmx<size> 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

<caucho.com>

<http-server>

<srun id="a" host='host1' port='6802'/>

<srun id="b" host='host2' port='6802'/>

<srun-backup id="c" host='backup' port='6802'/>

...

</http-server>

</caucho.com>

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:\inetpub\scripts

Copy isapi_srun.dll to the IIS scripts directory, d:\inetpub\scripts. You may need to run net stop w3svc.

(optional) Create a resin.ini in d:\inetpub\scripts 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 <http port='8080'/> 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:\inetpub\scripts.

Make sure that your IIS host has a mapping from /scripts to c:\inetpub\scripts 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:\inetpub\scripts 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.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有