我有一个apache 2.2.15前端尝试使用mod_proxy将代码传递给tomcat7以触发具有不同基本路径的两个不同的webapp。我想我已经接近了,但我仍然没有回复网页。我没有获得404请求的资源。我肯定希望这是一件简单的事情,但是经过一个半星期的撞击这堵墙之后,我已经成了原木盲人。发布希望有人可以看到我能做什么,或者可以纠正一些我可能会对这如何发挥作用的基本误解。
BMC Remedy arsys with http://rmdy-mtr-p1.domain.com/arsys/ 端口8080. webapp base位于/ opt / local / bmc / ARSystem / midtier /
http://rmd-mtr-p1.domain.com/kinetic/,基地位于:/opt/apache/tomcat7.0/webapps/kinetic/ port 8009。
的httpd.conf:
PidFile run/httpd.pid
Timeout 5400
ProxyTimeout 5400
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
Listen 80
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
Include conf.d/*.conf
User apache
Group apache
### Section 2: 'Main' server configuration
ServerAdmin root@localhost
UseCanonicalName Off
<Directory />
Options FollowSymLinks
AllowOverride None
order deny,allow
Allow from all
</Directory>
<Directory "/var/www/html">
Options Indexes
Options +Indexes
AllowOverride None
Order deny,allow
Allow from all
</Directory>
HostnameLookups Off
ErrorLog logs/error_log
LogLevel debug
<IfModule mod_proxy.c>
ProxyRequests On
<Proxy *>
Order deny,allow
Deny from all
Allow from .sandia.gov
</Proxy>
<VirtualHost *:80>
ServerName rmdy-mtr-p1.domain.com
ServerAlias rmdy-mtr-p1
ProxyRequests off
ProxyPreserveHost on
ProxyPass /arsys/ ajp://localhost:8080/opt/local/bmc/ARSystem/midtier/ retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse /arsys/ ajp://localhost:80/opt/local/bmc/ARSystem/midtier/
ProxyPass /kinetic/ ajp://localhost:8009/opt/apache/tomcat7.0/webapps/kinetic/ retry=1 acquire=3000 timeout=600 Keepalive=On
ProxyPassReverse /kinetic/ ajp://localhost:80/opt/apache/tomcat7.0/webapps/kinetic/
</VirtualHost>
server.xml文件:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Server port="8006" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<Resource auth="Container" description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
name="UserDatabase"
pathname="conf/tomcat-users.xml"
type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Catalina">
<Connector port="8080" maxHttpHeaderSize="65000" URIEncoding="UTF-8"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" protocol="AJP/1.3" redirectPort="8080" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="false" />
<!-- Define a non-SSL HTTP/1.1 Connector on port 8009 -->
<Connector port="8009" maxHttpHeaderSize="65000" URIEncoding="UTF-8"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" protocol="AJP/1.3" redirectPort="8009" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="false" />
在我的catalina.out日志中,我看到了几个不同的问题。我相信:
11 May 2015 09:17:44 - Connects to rmdy-ars-p1:2222 through Java Rpc failed with: ERROR (90): Cannot establish a network connection to the AR System server; Connection timed out rmdy-ars-p1:2222
是因为midtier和ars服务器之间的连接尚未设置。自从我今天早上重新开始并再次测试后的整个日志是:
May 11, 2015 8:51:57 AM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxHttpHeaderSize' to '65000' did not find a matching property.
May 11, 2015 8:51:57 AM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '75' did not find a matching property.
May 11, 2015 8:51:57 AM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'disableUploadTimeout' to 'false' did not find a matching property.
May 11, 2015 8:51:57 AM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxHttpHeaderSize' to '65000' did not find a matching property.
May 11, 2015 8:51:57 AM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '75' did not find a matching property.
May 11, 2015 8:51:57 AM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'disableUploadTimeout' to 'false' did not find a matching property.
May 11, 2015 8:51:58 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlNamespaceAware' to 'false' did not find a matching property.
May 11, 2015 8:51:58 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlValidation' to 'false' did not find a matching property.
May 11, 2015 8:51:58 AM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'deployOnStartup' to 'true' did not find a matching property.
-------------------------- Last shutdown state was :{STATE=VIEWSTAT_COMPLETED, CACHE_TIMESTAMP=1431027208192}
Validating cache.....
Valid cache is found in path: /opt/local/bmc/ARSystem/midtier/cache/1431027208192
11 May 2015 08:52:27 - Root WebApplicationContext: initialization started
11 May 2015 08:52:27 - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@2f035cf2: display name [Root WebApplicationContext]; startup date [Mon May 11 08:52:27 MDT 2015]; root of context hierarchy
11 May 2015 08:52:27 - Loading XML bean definitions from class path resource [META-INF/applicationContext.xml]
11 May 2015 08:52:28 - Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@2f035cf2]: org.springframework.beans.factory.support.DefaultListableBeanFactory@27aaa0d4
11 May 2015 08:52:28 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@27aaa0d4: defining beans [proxyTemplate,configuration,formCache,fieldmapCache,formfieldCache,goatfiel MapCache,activelinkCache,fieldgraphCache,htmlDataCache,jsDataCache,vfhtmlDataCache,vfjsDataCache,arUserPreferencesCache,arUserSearchesCache,skinDefCache,skinsCache,IFormServiceCacheAspect,IFormFieldServiceCacheAspect,IFieldMapServiceCacheAspect,IGoatFieldMapServiceCacheAspect,IActiveLinkServiceCacheAspect,IFieldGraphServiceCacheAspect,IDHTMLServiceCacheAspect,IARUserPreferencesServiceCacheAspect,IARUserSearchesServiceCacheAspect,ISkinServiceCacheAspect,ControlFieldAspect,TrimFieldAspect,PanelFieldAspect,DataFieldAspect,VertNavBarAspect,ViewInfoAspect,ViewFieldAspect,AttachmentFieldAspect,TableFieldAspect,AppListAspect,formService,fieldMapService,formFieldService,goatfieldFactory,goatfieldMapService,goatfieldService,emitterFactory,fieldgraphService,skinService,activelinkService,arUserPreferencesService,arUserSearchesService,dhtmlService,dhtmlRequestService,com.remedy.arsys.goat.Form#0,com.remedy.arsys.goat.Form#1,com.remedy.arsys.goat.field.GoatField#0,com.remedy.arsys.goat.field.FieldGraph#0,com.remedy.arsys.goat.ActiveLink#0,com.remedy.arsys.stubs.GoatServlet#0,com.remedy.arsys.stubs.GoatServlet#1]; root of factory hierarchy
11 May 2015 08:52:28 - Trying to load configuration arsys_api.xml
11 May 2015 08:52:28 - Could not load optional configuration arsys_api.xml
11 May 2015 08:52:28 - Trying to load configuration default.xml
11 May 2015 08:52:28 - jrpcMode: true
11 May 2015 08:52:28 - jniLoadMode: 1
11 May 2015 08:52:28 - apiRecordingMode: 0
11 May 2015 08:52:28 - apiRecordingLogDir:
11 May 2015 08:52:28 - useConnectionPooling: true
11 May 2015 08:52:28 - maxProxiesPerServer: 80
11 May 2015 08:52:28 - idleConnectionsPerServer: 5
11 May 2015 08:52:28 - connectionTimeout: 0
11 May 2015 08:52:28 - connectionLifespan: 0
11 May 2015 08:52:28 - timeUnit: MINUTES
11 May 2015 08:52:28 - minimumSupportedServerRpcVersion: 12
11 May 2015 08:52:28 - connectionMaxRetries: 1
11 May 2015 08:52:28 - timeLagBetweenRetriesMillSec: 100
11 May 2015 08:52:28 - stringizeFieldAssignments: false
11 May 2015 08:52:28 - stringizeSetIfQualification: false
11 May 2015 08:52:28 - useLegacyQualParser: false
11 May 2015 08:52:28 - useLegacyAssignParser: false
11 May 2015 08:52:28 - useLegacyQualFormatter: false
11 May 2015 08:52:28 - useLegacyAssignFormatter: false
11 May 2015 08:52:28 - UsePooling: true
11 May 2015 08:52:28 - , Pool setting info: , # maxProxyPerServer- 80, # idleConnectionsPerServer- 5, connectionTimeout setting- 00:00:00, connectionLifespan setting- 00:00:00
11 May 2015 08:52:28 - Currently, connection pooling true
11 May 2015 08:52:28 - Client adjusts connection variables maximumPoolSize = 80 minIdleProxySize = 5 connectionTimeout = 0 timeUnit = null
11 May 2015 08:52:28 - Client sets useConnectionPooling to : true
11 May 2015 08:52:29 - Root WebApplicationContext: initialization completed in 1338 ms
11 May 2015 08:52:29 - Currently, connection pooling true
11 May 2015 08:52:29 - Client sets connection limits per server to :80
11 May 2015 08:52:29 - UsePooling: true
11 May 2015 08:52:29 - , Pool setting info: , # maxProxyPerServer- 80, # idleConnectionsPerServer- 5, connectionTimeout setting- 00:00:00, connectionLifespan setting- 00:00:00
11 May 2015 08:52:29 - Client sets useConnectionPooling to : true
11 May 2015 08:52:29 - APITIMEOUT from system property : null
11 May 2015 08:52:29 - APITIMEOUT from Environment : null
11 May 2015 08:52:29 - AROVERLAYGROUPS from system property : null
11 May 2015 08:52:29 - AROVERLAYGROUPS from Environment : null
11 May 2015 08:52:29 - fipsProviderJsafeJCE installed = false
11 May 2015 08:54:36 - Trying to load configuration arsys_api.xml
11 May 2015 08:54:36 - Could not load optional configuration arsys_api.xml
11 May 2015 08:54:36 - Trying to load configuration default.xml
11 May 2015 08:54:37 - Connects to rmdy-ars-p1:2222 through Java Rpc failed with: ERROR (90): Cannot establish a network connection to the AR System server; Connection timed out rmdy-ars-p1:2222
11 May 2015 08:54:37 - Running on Mid Tier version 8.1.02 201408260235
11 May 2015 08:56:43 - Connects to rmdy-ars-p1:2222 through Java Rpc failed with: ERROR (90): Cannot establish a network connection to the AR System server; Connection timed out rmdy-ars-p1:2222
11 May 2015 09:00:56 - Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
May 11, 2015 9:01:08 AM com.sun.xml.ws.transport.http.DeploymentDescriptorParser parseAdapters
WARNING: WSSERVLET17: duplicate endpoint name
May 11, 2015 9:01:09 AM org.glassfish.gmbal.impl.JMXRegistrationManager resumeRegistration
2015-05-11 09:01:09,156 INFO [localhost-startStop-1 ] - Starting up Kinetic Task.
2015-05-11 09:01:09,167 INFO [localhost-startStop-1 ] - Preparing Kinetic Task Engine runtime.
2015-05-11 09:01:15,167 INFO [localhost-startStop-1 ] - Preparing the Remedy API.
2015-05-11 09:01:16,514 INFO [localhost-startStop-1 ] - Loading the Configuration Manager using data directory: /opt/apache/tomcat7.0/webapps/kineticTask/WEB-INF/data
2015-05-11 09:01:16,533 DEBUG [localhost-startStop-1 ] - Loading properties file: /opt/apache/tomcat7.0/webapps/kineticTask/WEB-INF/data/config.properties
2015-05-11 09:01:16,533 WARN [localhost-startStop-1 ] - The properties file does not exist: /opt/apache/tomcat7.0/webapps/kineticTask/WEB-INF/data/config.properties
2015-05-11 09:01:16,537 INFO [localhost-startStop-1 ] - This web application instance has not yet been configured.
Could not create log file null
Created default console logger
Skipping cache initialization in SurveyInit.
LoadError: no such file to load -- file:/opt/apache/tomcat7.0/webapps/kinetic/WEB-INF/lib/kinetic-cloner-lib.jar!/lib/kinetic_cloner/cloner
require at org/jruby/RubyKernel.java:1038
require at file:/opt/apache/tomcat7.0/webapps/kinetic/WEB-INF/lib/jruby-complete-1.6.5.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36
__file__ at lib/kinetic_cloner.rb:15
each at org/jruby/RubyArray.java:1612
(root) at lib/kinetic_cloner.rb:14
require at org/jruby/RubyKernel.java:1038
(root) at file:/opt/apache/tomcat7.0/webapps/kinetic/WEB-INF/lib/kinetic-cloner-lib.jar!/kinetic-cloner.rb:1
require at org/jruby/RubyKernel.java:1038
(root) at file:/opt/apache/tomcat7.0/webapps/kinetic/WEB-INF/lib/kinetic-cloner-lib.jar!/kinetic-cloner.rb:1
11 May 2015 09:03:01 - Connects to rmdy-ars-p1:2222 through Java Rpc failed with: ERROR (90): Cannot establish a network connection to the AR System server; Connection timed out rmdy-ars-p1:2222
ARERR [90] Cannot establish a network connection to the AR System server : Connection timed out rmdy-ars-p1:2222
at com.remedy.arsys.stubs.ServerLogin.<init>(ServerLogin.java:297)
at com.remedy.arsys.stubs.ServerLogin.get(ServerLogin.java:135)
at com.remedy.arsys.stubs.ServerLogin.getAdmin(ServerLogin.java:167)
at com.remedy.arsys.stubs.ServerLogin.getAdmin(ServerLogin.java:148)
at com.remedy.arsys.share.ServerInfo.get(ServerInfo.java:352)
at com.remedy.arsys.share.Cache$ServerReaper$1.run(Cache.java:850)
Caused by: ERROR (90): Cannot establish a network connection to the AR System server; Connection timed out rmdy-ars-p1:2222
at com.bmc.arsys.apitransport.ApiProxyJRpcBase.connectionTry(Unknown Source)
at com.bmc.arsys.api.ProxyJRpc.getRpcClient(Unknown Source)
at com.bmc.arsys.api.ProxyJRpc.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.bmc.arsys.apitransport.connection.c.a(Unknown Source)
at com.bmc.arsys.apitransport.connection.c.createProxy(Unknown Source)
at com.bmc.arsys.api.ProxyManager.createProxy(Unknown Source)
at com.bmc.arsys.api.ProxyPool.createProxy(Unknown Source)
at com.bmc.arsys.apitransport.connection.a.get(Unknown Source)
at com.bmc.arsys.apitransport.connection.b.getProxy(Unknown Source)
at com.bmc.arsys.api.PoolingProxyManager.getProxy(Unknown Source)
at com.bmc.arsys.apitransport.connection.b.getProxy(Unknown Source)
at com.bmc.arsys.api.ARServerUser.usePrivateRpcQueue(Unknown Source)
at com.remedy.arsys.stubs.ServerLogin.<init>(ServerLogin.java:279)
... 5 more
11 May 2015 09:17:44 - Connects to rmdy-ars-p1:2222 through Java Rpc failed with: ERROR (90): Cannot establish a network connection to the AR System server; Connection timed out rmdy-ars-p1:2222
我尝试了很多东西。我首先尝试使用mod_ajp,因为我已经习惯了它。但它更适合app1.company.com和app2.company.com以及not company.com/app1和company.com/app2等情况。我可以做任何一项工作,但不是两三次(我的最终目标)。
说到情况,部署在该webapps文件夹中的第三个Web应用程序是kineticTask,当我在当前配置中没有提到它时,我不知道为什么它会在日志文件中启动。我想让这两个先工作然后再添加....所以我不知道为什么会出现这种情况。
/var/log/httpd/error.log:
[Mon May 11 10:24:00 2015] [debug] mod_proxy_ajp.c(45): proxy: AJP: canonicalising URL //localhost:8080/opt/local/bmc/ARSystem/midtier/
[Mon May 11 10:24:00 2015] [debug] proxy_util.c(1521): [client 134.253.176.154] proxy: ajp: found worker ajp://localhost:8080/opt/local/bmc/ARSystem/midtier/ for ajp://localhost:8080/opt/local/bmc/ARSystem/midtier/
[Mon May 11 10:24:00 2015] [debug] mod_proxy.c(1020): Running scheme ajp handler (attempt 0)
[Mon May 11 10:24:00 2015] [debug] mod_proxy_http.c(1957): proxy: HTTP: declining URL ajp://localhost:8080/opt/local/bmc/ARSystem/midtier/
[Mon May 11 10:24:00 2015] [debug] mod_proxy_ajp.c(709): proxy: AJP: serving URL ajp://localhost:8080/opt/local/bmc/ARSystem/midtier/
[Mon May 11 10:24:00 2015] [debug] proxy_util.c(2026): proxy: AJP: has acquired connection for (localhost)
[Mon May 11 10:24:00 2015] [debug] proxy_util.c(2082): proxy: connecting ajp://localhost:8080/opt/local/bmc/ARSystem/midtier/ to localhost:8080
[Mon May 11 10:24:00 2015] [debug] proxy_util.c(2209): proxy: connected /opt/local/bmc/ARSystem/midtier/ to localhost:8080
[Mon May 11 10:24:00 2015] [debug] proxy_util.c(2460): proxy: AJP: fam 10 socket created to connect to localhost
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(224): Into ajp_marshal_into_msgb
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[0] [Accept] = [text/html, application/xhtml+xml, */*]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[1] [Accept-Language] = [en-US]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[2] [User-Agent] = [Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[3] [Accept-Encoding] = [gzip, deflate]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[4] [Host] = [rmdy-mtr-p1.sandia.gov]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[5] [DNT] = [1]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[6] [Connection] = [Keep-Alive]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(450): ajp_marshal_into_msgb: Done
[Mon May 11 10:24:00 2015] [debug] mod_proxy_ajp.c(269): proxy: APR_BUCKET_IS_EOS
[Mon May 11 10:24:00 2015] [debug] mod_proxy_ajp.c(274): proxy: data to read (max 8186 at 4)
[Mon May 11 10:24:00 2015] [debug] mod_proxy_ajp.c(289): proxy: got 0 bytes of data
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(687): ajp_read_header: ajp_ilink_received 04
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(697): ajp_parse_type: got 04
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(516): ajp_unmarshal_response: status = 404
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(537): ajp_unmarshal_response: Number of headers is = 3
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(599): ajp_unmarshal_response: Header[0] [Content-Type] = [text/html;charset=utf-8]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(609): ajp_unmarshal_response: ap_set_content_type done
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(599): ajp_unmarshal_response: Header[1] [Content-Language] = [en]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(599): ajp_unmarshal_response: Header[2] [Content-Length] = [1013]
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(687): ajp_read_header: ajp_ilink_received 03
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(697): ajp_parse_type: got 03
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(687): ajp_read_header: ajp_ilink_received 05
[Mon May 11 10:24:00 2015] [debug] ajp_header.c(697): ajp_parse_type: got 05
[Mon May 11 10:24:00 2015] [debug] mod_proxy_ajp.c(616): proxy: got response from (null) (localhost)
[Mon May 11 10:24:00 2015] [debug] proxy_util.c(2044): proxy: AJP: has released connection for (localhost)
[Mon May 11 10:24:07 2015] [debug] mod_proxy_ajp.c(45): proxy: AJP: canonicalising URL //localhost:8009/opt/apache/tomcat7.0/webapps/kinetic/
[Mon May 11 10:24:07 2015] [debug] proxy_util.c(1521): [client 134.253.176.154] proxy: ajp: found worker ajp://localhost:8009/opt/apache/tomcat7.0/webapps/kinetic/ for ajp://localhost:8009/opt/apache/tomcat7.0/webapps/kinetic/
[Mon May 11 10:24:07 2015] [debug] mod_proxy.c(1020): Running scheme ajp handler (attempt 0)
[Mon May 11 10:24:07 2015] [debug] mod_proxy_http.c(1957): proxy: HTTP: declining URL ajp://localhost:8009/opt/apache/tomcat7.0/webapps/kinetic/
[Mon May 11 10:24:07 2015] [debug] mod_proxy_ajp.c(709): proxy: AJP: serving URL ajp://localhost:8009/opt/apache/tomcat7.0/webapps/kinetic/
[Mon May 11 10:24:07 2015] [debug] proxy_util.c(2026): proxy: AJP: has acquired connection for (localhost)
[Mon May 11 10:24:07 2015] [debug] proxy_util.c(2082): proxy: connecting ajp://localhost:8009/opt/apache/tomcat7.0/webapps/kinetic/ to localhost:8009
[Mon May 11 10:24:07 2015] [debug] proxy_util.c(2209): proxy: connected /opt/apache/tomcat7.0/webapps/kinetic/ to localhost:8009
[Mon May 11 10:24:07 2015] [debug] proxy_util.c(2460): proxy: AJP: fam 10 socket created to connect to localhost
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(224): Into ajp_marshal_into_msgb
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[0] [Accept] = [text/html, application/xhtml+xml, */*]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[1] [Accept-Language] = [en-US]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[2] [User-Agent] = [Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[3] [Accept-Encoding] = [gzip, deflate]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[4] [Host] = [rmdy-mtr-p1.sandia.gov]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[5] [DNT] = [1]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(290): ajp_marshal_into_msgb: Header[6] [Connection] = [Keep-Alive]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(450): ajp_marshal_into_msgb: Done
[Mon May 11 10:24:07 2015] [debug] mod_proxy_ajp.c(269): proxy: APR_BUCKET_IS_EOS
[Mon May 11 10:24:07 2015] [debug] mod_proxy_ajp.c(274): proxy: data to read (max 8186 at 4)
[Mon May 11 10:24:07 2015] [debug] mod_proxy_ajp.c(289): proxy: got 0 bytes of data
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(687): ajp_read_header: ajp_ilink_received 04
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(697): ajp_parse_type: got 04
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(516): ajp_unmarshal_response: status = 404
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(537): ajp_unmarshal_response: Number of headers is = 3
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(599): ajp_unmarshal_response: Header[0] [Content-Type] = [text/html;charset=utf-8]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(609): ajp_unmarshal_response: ap_set_content_type done
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(599): ajp_unmarshal_response: Header[1] [Content-Language] = [en]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(599): ajp_unmarshal_response: Header[2] [Content-Length] = [1025]
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(687): ajp_read_header: ajp_ilink_received 03
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(697): ajp_parse_type: got 03
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(687): ajp_read_header: ajp_ilink_received 05
[Mon May 11 10:24:07 2015] [debug] ajp_header.c(697): ajp_parse_type: got 05
[Mon May 11 10:24:07 2015] [debug] mod_proxy_ajp.c(616): proxy: got response from (null) (localhost)
[Mon May 11 10:24:07 2015] [debug] proxy_util.c(2044): proxy: AJP: has released connection for (localhost)
答案 0 :(得分:0)
所以使用Mod_jk我保持简单。 httpd.conf文件只需要重定向命令来调用Tomcat来完成所有工作。使用虚拟主机条目只会混淆问题。 Apache将使用的虚拟主机部分中的任何内容。任何使用JKMount的东西都会直接进入Tomcat。所以httpd.conf需要看的是:
LoadModule jk_module /etc/httpd/modules/mod_jk_apache_2.2.Linux_64.so
JkWorkersFile /opt/apache/tomcat7.0/conf/worker.properties
JkLogFile /etc/httpd/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardURIEscaped +ForwardURICompatUnparsed
JKMountCopy On
JkMount /arsys/* Worker1
JkMount /kinetic/* Worker2
JkMount /kineticTask/* Worker3
因此,如果你点击webserver.com/arsys/,就会点击httpd.conf,它会看到这个JKMount命令。它重定向到Worker.properties中的Worker1属性,如下所示:
worker.list=Worker1
worker.Worker1.port=8009
worker.Worker1.host=localhost
worker.Worker1.type=ajp13
请记住,一切都必须在不同的端口以避免冲突,所以其他两个是:
worker.list=Worker2
worker.Worker1.port=8019
worker.Worker1.host=localhost
worker.Worker1.type=ajp13
worker.list=Worker3
worker.Worker1.port=8099
worker.Worker1.host=localhost
worker.Worker1.type=ajp13
因此请求将在此处查看并看到Worker应该在Tomcat中侦听端口8009。注意:我最初认为每个Worker属性都需要反映Worker#(1,2,3等等)我认为例如worker.Worker1.port = 8099应该是worker.Worker3,但它没有&#39似乎很重要。
因此,您在server.xml中所要做的就是打开这些端口。吻...保持简单:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" URIEncoding="UTF-8" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!-- Define an AJP 1.3 Connector on port 8019 -->
<Connector port="8019" URIEncoding="UTF-8" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!-- Define an AJP 1.3 Connector on port 8099 -->
<Connector port="8099" URIEncoding="UTF-8" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
如果其webapp文件夹中有war文件,Tomcat将完成剩下的工作。
redirectPort把我扔了。它会永远留在&#34; 8443&#34;即使你不使用SSL。它不应该自行循环,即连接器端口=&#34; 8099&#34; redirectPort =&#34; 8099&#34;很糟糕。
这让我工作了。