📄 servlet-library.xtp
字号:
<s1 title="Servlet Library"><s2 title="Admin Servlet"><p>Resin 2.0.5 provides a primitive status servlet /resin-status. It'sdisabled by default to avoid any security issues. The servlet mustbe enabled explicitly, like:</p><example><web-app id='/admin'> <allow-admin>true</allow-admin> <servlet-mapping url-pattern='/resin-status' servlet-name='com.caucho.http.servlet.ResinStatusServlet'> <init-param enable='read'/> </servlet-mapping> <!-- only allow the localhost to use the admin --> <security-constraint> <ip-constraint>127.0.0.1/32</ip-constraint> <web-resource-collection> <url-pattern>/*</url-pattern> </web-resource-collection> </security-constraint></web-app></example><p>The allow-admin also puts a com.caucho.http.admin.ApplicationAdminobject in the servlet context as caucho.admin.</p></s2><s2 title='LoadBalanceServlet'><p>Configures a front-end Resin instance to load-balance requests tobackend Resin instances. Each LoadBalanceServlet instance willdistribute the requests to a configured srun-group.</p><p>The backend Resin instances will need to have separateresin.conf files so they will handle the request instead offorwarding the requests back to themselves.</p><p>If the request already has a session, the backend server maching thatsession will be used, i.e. LoadBalanceServlet supports sticky-sessions.Otherwise, the least busy backend server will be used as counted bynumber of active requests. If several backend servers areequally busy, the selection uses a round-robin to distribute the load.</p><example><caucho.com><http-server> <http id='front' port='8080'/> <srun id='a' srun-group='backend' host='192.168.0.1' port='6802'/> <srun id='b' srun-group='backend' host='192.168.0.2' port='6802'/> <web-app> <servlet servlet-name='com.caucho.http.servlet.LoadBalanceServlet'> <init-param srun-group='backend'/> <servlet-mapping url-pattern='*.jsp' servlet-name='backend'/> <servlet-mapping url-pattern='/remote/*' servlet-name='backend'/> </web-app></http-server></caucho.com></example></s2><s2 title="CGIServlet"><p>Implements CGI calls.</p><example><web-app> <servlet-mapping url-pattern='*.cgi' servlet-name='com.caucho.http.servlet.CGIServlet'/></web-app></example></s2><s2 title='FastCGIServlet'><p>Implements the FastCGI protocol. FastCGI allows some CGI clientslike PHP to run quicker and more efficiently.</p><example><web-app> <servlet-mapping url-pattern='*.php' servlet-name='com.caucho.http.servlet.FastCGIServlet'> <init-param server-address='localhost:6666'/> </servlet-mapping></web-app></example><p>Assuming PHP has been compiled with -fastcgi enabled, you mightstart PHP like:</p><example>unix> /opt/resin/bin/fastcgirunner.pl -port 6666 php</example></s2></s1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -