网站数据模版收费网站推广
news/
2025/10/5 21:37:42/
文章来源:
网站数据模版,收费网站推广,网页设计和网站设计的区别,做感恩网站的图片大全为什么80%的码农都做不了架构师#xff1f; 反正每次来做一个不熟悉的东西#xff0c;就是各种的search ,前一次去做过一个apache的东西#xff0c;各种蛋疼#xff0c;各种不能用。好多的东西也是比较旧了的咯。 这次结合前辈的各种东借西拿#xff0c;总… 为什么80%的码农都做不了架构师 反正每次来做一个不熟悉的东西就是各种的search ,前一次去做过一个apache的东西各种蛋疼各种不能用。好多的东西也是比较旧了的咯。 这次结合前辈的各种东借西拿总算是成功了。 如果有些不明白建议先看下一篇因为你的打开方式有些不对。 环境 win7 sp1. jdk1.7 httpd2.4x64 tomcat7.59 我们这里是使用AJP模式来进行集群 sp 0: 首先是安装apache 修改httpd.conf中的一些路径设置各种路径为当前你放置apache-httpd的路径 ServerRoot D:\apache24-tct7\Apache24
//.....省略n多路径配置 sp 1. 配置一下模块打开 LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.soLoadModule speling_module modules/mod_speling.soLoadModule ssl_module modules/mod_ssl.so
#可能还需要这个
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule proxy_html_module modules/mod_proxy_html.so 1.1 配置反向代理 ProxyRequests Off
proxy balancer://clusterBalancerMember ajp://127.0.0.1:9001 loadfactor1 routejvm1BalancerMember ajp://127.0.0.1:9002 loadfactor1 routejvm2BalancerMember ajp://127.0.0.1:9003 loadfactor1 routejvm3
/proxy sp 2. 配置tomcat 2.1改 SHUTDOWN 端口 #同一服务器中必须不一样因为可能冲突 Server port9006 shutdownSHUTDOWN 2.2改http port redirectPort #同一服务器中必须不一样因为可能冲突 Connector port8081 protocolHTTP/1.1 executortomcatThreadPoolconnectionTimeout20000redirectPort9441 / 2.3 改ajp port redirectPort #同一服务器中必须不一样因为可能冲突 Connector port9001 protocolAJP/1.3 redirectPort8441 / 2.4 改 Engine 加上 jvmRoute 需要跟httpd.conf中保持一致 Engine nameCatalina defaultHostlocalhost jvmRoutejvm1 2.5 加上Cluster 具体如下 #其中Receiver port5001 同一服务器下不能一样 Cluster classNameorg.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions6Manager classNameorg.apache.catalina.ha.session.BackupManager expireSessionsOnShutdownfalse notifyListenersOnReplicationtrue mapSendOptions6 /Channel classNameorg.apache.catalina.tribes.group.GroupChannelMembership classNameorg.apache.catalina.tribes.membership.McastService address228.0.0.4 port45564 frequency500 dropTime3000 /Receiver classNameorg.apache.catalina.tribes.transport.nio.NioReceiver addressauto port5001 selectorTimeout100 maxThreads6 /Sender classNameorg.apache.catalina.tribes.transport.ReplicationTransmitterTransport classNameorg.apache.catalina.tribes.transport.nio.PooledParallelSender //SenderInterceptor classNameorg.apache.catalina.tribes.group.interceptors.TcpFailureDetector /Interceptor classNameorg.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor /Interceptor classNameorg.apache.catalina.tribes.group.interceptors.ThroughputInterceptor //ChannelValve classNameorg.apache.catalina.ha.tcp.ReplicationValve filter.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt; /Deployer classNameorg.apache.catalina.ha.deploy.FarmWarDeployer tempDir/tmp/war-temp/ deployDir/tmp/war-deploy/ watchDir/tmp/war-listen/ watchEnabledfalse /ClusterListener classNameorg.apache.catalina.ha.session.ClusterSessionListener //Cluster sp 3. 改项目web.xml 在其中添加 distributable / 节点 放一个完整一点的tomcat的server.xml ?xml version1.0 encodingutf-8?
!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the License); you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an AS IS BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
--
!-- Note: A Server is not itself a Container, so you may notdefine subcomponents such as Valves at this level.Documentation at /docs/config/server.html--
Server port9006 shutdownSHUTDOWNListener classNameorg.apache.catalina.startup.VersionLoggerListener /!-- Security listener. Documentation at /docs/config/listeners.htmlListener classNameorg.apache.catalina.security.SecurityListener /--!--APR library loader. Documentation at /docs/apr.html --Listener classNameorg.apache.catalina.core.AprLifecycleListener SSLEngineon /!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --Listener classNameorg.apache.catalina.core.JasperListener /!-- Prevent memory leaks due to use of particular java/javax APIs--Listener classNameorg.apache.catalina.core.JreMemoryLeakPreventionListener /Listener classNameorg.apache.catalina.mbeans.GlobalResourcesLifecycleListener /Listener classNameorg.apache.catalina.core.ThreadLocalLeakPreventionListener /!-- Global JNDI resourcesDocumentation at /docs/jndi-resources-howto.html--GlobalNamingResources!-- Editable user database that can also be used byUserDatabaseRealm to authenticate users--Resource nameUserDatabase authContainertypeorg.apache.catalina.UserDatabasedescriptionUser database that can be updated and savedfactoryorg.apache.catalina.users.MemoryUserDatabaseFactorypathnameconf/tomcat-users.xml //GlobalNamingResources!-- A Service is a collection of one or more Connectors that sharea single Container Note: A Service is not itself a Container,so you may not define subcomponents such as Valves at this level.Documentation at /docs/config/service.html--Service nameCatalina!--The connectors can use a shared executor, you can define one or more named thread pools--!--Executor nametomcatThreadPool namePrefixcatalina-exec-maxThreads150 minSpareThreads4/--!-- A Connector represents an endpoint by which requests are receivedand responses are returned. Documentation at :Java HTTP Connector: /docs/config/http.html (blocking non-blocking)Java AJP Connector: /docs/config/ajp.htmlAPR (HTTP/AJP) Connector: /docs/apr.htmlDefine a non-SSL HTTP/1.1 Connector on port 8080--Connector port8081 protocolHTTP/1.1 executortomcatThreadPoolconnectionTimeout20000redirectPort9441 /!-- A Connector using the shared thread pool--!--Connector executortomcatThreadPoolport8080 protocolHTTP/1.1connectionTimeout20000redirectPort8443 /--!-- Define a SSL HTTP/1.1 Connector on port 8443This connector uses the BIO implementation that requires the JSSEstyle configuration. When using the APR/native implementation, theOpenSSL style configuration is required as described in the APR/nativedocumentation --!--Connector port8443 protocolorg.apache.coyote.http11.Http11ProtocolmaxThreads150 SSLEnabledtrue schemehttps securetrueclientAuthfalse sslProtocolTLS /--!-- Define an AJP 1.3 Connector on port 8009 --Connector port9001 protocolAJP/1.3 redirectPort8441 /!-- An Engine represents the entry point (within Catalina) that processesevery request. The Engine implementation for Tomcat stand aloneanalyzes the HTTP headers included with the request, and passes themon to the appropriate Host (virtual host).Documentation at /docs/config/engine.html --!-- You should set jvmRoute to support load-balancing via AJP ie :Engine nameCatalina defaultHostlocalhost jvmRoutejvm1Engine nameCatalina defaultHostlocalhost--Engine nameCatalina defaultHostlocalhost jvmRoutejvm1!--For clustering, please take a look at documentation at:/docs/cluster-howto.html (simple how to)/docs/config/cluster.html (reference documentation) --!--Cluster classNameorg.apache.catalina.ha.tcp.SimpleTcpCluster/--Cluster classNameorg.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions6Manager classNameorg.apache.catalina.ha.session.BackupManager expireSessionsOnShutdownfalse notifyListenersOnReplicationtrue mapSendOptions6 /Channel classNameorg.apache.catalina.tribes.group.GroupChannelMembership classNameorg.apache.catalina.tribes.membership.McastService address228.0.0.4 port45564 frequency500 dropTime3000 /Receiver classNameorg.apache.catalina.tribes.transport.nio.NioReceiver addressauto port5001 selectorTimeout100 maxThreads6 /Sender classNameorg.apache.catalina.tribes.transport.ReplicationTransmitterTransport classNameorg.apache.catalina.tribes.transport.nio.PooledParallelSender //SenderInterceptor classNameorg.apache.catalina.tribes.group.interceptors.TcpFailureDetector /Interceptor classNameorg.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor /Interceptor classNameorg.apache.catalina.tribes.group.interceptors.ThroughputInterceptor //ChannelValve classNameorg.apache.catalina.ha.tcp.ReplicationValve filter.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt; /Deployer classNameorg.apache.catalina.ha.deploy.FarmWarDeployer tempDir/tmp/war-temp/ deployDir/tmp/war-deploy/ watchDir/tmp/war-listen/ watchEnabledfalse /ClusterListener classNameorg.apache.catalina.ha.session.ClusterSessionListener //Cluster!-- Use the LockOutRealm to prevent attempts to guess user passwordsvia a brute-force attack --Realm classNameorg.apache.catalina.realm.LockOutRealm!-- This Realm uses the UserDatabase configured in the global JNDIresources under the key UserDatabase. Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm. --Realm classNameorg.apache.catalina.realm.UserDatabaseRealmresourceNameUserDatabase//RealmHost namelocalhost appBasewebappsunpackWARstrue autoDeploytrue!-- SingleSignOn valve, share authentication between web applicationsDocumentation at: /docs/config/valve.html --!--Valve classNameorg.apache.catalina.authenticator.SingleSignOn /--!-- Access log processes all example.Documentation at: /docs/config/valve.htmlNote: The pattern used is equivalent to using patterncommon --Valve classNameorg.apache.catalina.valves.AccessLogValve directorylogsprefixlocalhost_access_log. suffix.txtpattern%h %l %u %t quot;%rquot; %s %b //Host/Engine/Service
/Server 具体根据需求的做法请参考tomcat的文档 http://http://tool.oschina.net/apidocs/apidoc?apitomcat-7.0-doc apache2.4 x64win 下载地址: http://www.apachelounge.com/download/ 其他的应该不用说了吧 测试就是写个jsp,打印下各tomcat下的项目中的session信息以及是哪个tomcat下面的 jvm3 ID 3C5555DBBBE06EEC67B6F9508CAB0520.jvm3
Session 列表a 123 转载于:https://my.oschina.net/rwrwd7/blog/406471
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/928759.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!