📄 cse-netscape.xtp
字号:
<s1 title="Resin with Netscape"><summarylist/><p>Resin provides a fast servlet runner for Netscape, allowing Netscapeto run servlets, JSP and XTP files.</p><p>To configure Resin with Netscape, you must follow the following steps:</p><ol><li>Compile caucho_nsapi.so<li>Configure Netscape<li>Configure resin.conf<li>Restart Netscape and start srun</ol><s2 title='Compiling caucho_nsapi.so'><p>To compile and install <var/caucho_nsapi/> on Unix, you'll need to run<code/configure/> and then make.</p><p>The argument to --with-netscape is the directory containing the netscapestart and stop scripts, i.e. the parent of the config directory.</p><example>unix> ./configure --with-netscape=/usr/local/netscape/https-your-hostnameunix> make</example><p>If you need finer control over the Netscape configuration, you can usethe following arguments to ./configure. Resin needs<var/netscape-include/> and <var/netscape-conf/>.</p><deftable><tr><td>--with-netscape=dir<td>The Netscape root directory.<tr><td>--with-netscape-include=dir<td>The Netscape include directory.<tr><td>--with-netscape-conf=conf<td>The Netscape obj.conf file</deftable></s2><s2 title='Configuring Netscape by hand'><p>Making caucho_nsapi will automatically change your obj.conf file.For reference, here are the changes:</p><example title=magnus.conf>Init fn="load-modules" shlib="<build-dir>/caucho_nsapi.so" \ funcs="caucho_service,caucho_filter,caucho_status"</example><example title=obj.conf><Object name=default>NameTrans fn="caucho_filter" conf="<resin-home>/resin.conf" name="resin"NameTrans fn="assign-name" from="/caucho-status" name="caucho-status"...</Object><Object name="resin">Service fn="caucho_service"</Object><Object name="caucho-status">Service fn="caucho_status"</Object></example><note>Versions prior to iPlanet 6 put the <var/Init/> in obj.conf. </note><note>The caucho-status is optional and probably should be avoided ina production site. It lets you ask plugin module about theCaucho status, valuable for debugging.</note><p>Restart Netscape. Now browse http://localhost/caucho-status. Itshould return a table indicating that the servlet runner is stopped.</p><p>Browse http://localhost/test.jsp. It should return a message like:</p><results>Cannot connect to Servlet Runner.</results><s3 title='Load Balancing' version='Resin 1.2'><p>In Resin 1.2, you can distribute requests to multiple machines. Allrequests in a session will go to the same host. In addition, if onehost goes down, Resin will send the request to the next available machine.<p/><p>In addition, you can specify backup machines. The backup only will serverequests if all primaries are down.</p><p>See the <a href='http-config.xtp'>http config</a> section for moredetails.</p><example title=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></example></s3></s2><s2 title='Configuring resin.conf'><p>By default, Resin will look in resin1.2/doc for JSP files andresin1.2/doc/WEB-INF/classes for servlets and beans. To tell Resinto use Netscape's document area, you configure the <var/app-dir/>.Change <var/app-dir/> from 'doc' to something like '/usr/local/netscape/doc'.</p><example title='resin.conf'><caucho.com> <http-server app-dir='/usr/local/netscape/docs'> <servlet-mapping url-pattern='/servlets/*' 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></example></s2><s2 title="Netscape's obj.conf"><p>Installing Resin with Netscape modifies Netscape's obj.conf file. For mostusers, the default installation will be fine. More sophisticated userswill need to modify the obj.conf file.</p><example>Init fn=load-types mime-types=mime.types# load resin shared libraryInit fn="load-modules" shlib="/home/resin/libexec/caucho_nsapi.so" \ funcs="caucho_service,caucho_filter,caucho_status"<Object name=default># you can change the conf valueNameTrans fn="caucho_filter" conf="/home/resin/conf/resin.conf" name="resin"# comment out the following in production sitesNameTrans fn="assign-name" from="/caucho-status" name="caucho-status"NameTrans fn=pfx2dir from=/ns-icons dir="/usr/local/src/nes/ns-icons" name="es-internal"NameTrans fn=pfx2dir from=/mc-icons dir="/usr/local/src/nes/ns-icons" name="es-internal"...</Object>...<Object name="resin">Service fn="caucho_service"</Object><Object name="caucho-status">Service fn="caucho_status"</Object></example></s2><s2 title='Testing the servlet engine'><p>Now you need to start the servlet engine.</p><example>> resin2.0/bin/httpd.sh</example><p>Now browse http://localhost/test.jsp. You should get a 'file notfound' message.<p/><p>Create a test file '/usr/local/netscape/htdocs/test.jsp'</p><example>2 + 2 = <%= 2 + 2 %></example><p>Browse http://localhost/test.jsp again. You should now get</p><results>2 + 2 = 4</results></s2><s2 title='Servlet Engine Production'><p>A better way to run the servlet engine in a production environment isto use the start and stop scripts. These scripts add extrareliability to the server. If Resin should ever exit, it willautomatically be restarted.</p><p>To start the servlet runner, use</p><example>unix> resin-2.1.0/bin/httpd.sh start</example><p>To stop it, use</p><example>unix> resin2.0/bin/httpd.sh stop</example></s2><s2 title='Windows'><p>On Windows, the setup program should configure the obj.conf. Except thatyou don't need to compile the plugin on windows, the configuration isidentical.</p></s2></s1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -