Andre Warnier wrote: > > Your configuration of mod_jk below looks correct (except a > small detail, see JkMount). > But I must say that it is difficult to believe that the > request is actually forwarded to Tomcat, and that Tomcat then > fails to recognise the file as a JSP page, and returns it as > "text/plain" source.
The content is dynamically delivered by a servlet, not a jsp-file. > Particularly if, as you said earlier, when you access the > same URL on Tomcat directly, via port 8080, the same document > displays correctly. Yes. > > The <Connector>'s in Tomcat (the one for HTTP port 8080, and > the one for AJP on port 8009) are just interfaces that > receive a request in some format, translate it to a common > internal format, and then forward it in that internal format > to the internal Tomcat machinery (which is the same in both > cases). So whether a request is originally received on the > HTTP Connector or on the AJP Connector, should not make a > difference in terms of how Tomcat processes the same URL. > And the result should be returned the same way in both cases. tcpdump shows that the content delivered by httpd has a content-type of text/plain, the content delivered by tomcat has no content-type. > > So something in the symptoms you report does not fit. > > Can you : > - stop Apache > - clear the mod_jk log > - restart Apache > - then issue just one request to "mouseidgenes" through > Apache (port 80) > - then edit the mod_jk log, find the lines specific to that > one request, and paste them here > OK: This should be the beginning of the request forwarded by httpd to tomcat: ... [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] map_uri_to_worker::jk_uri_worker_map.c (682): Attempting to map URI '/mouseidgenes/InputData' from 1 map s [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] find_match::jk_uri_worker_map.c (503): Attempting to map context URI '/mouseidgenes/*=appl01' source 'Jk Mount' [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] find_match::jk_uri_worker_map.c (516): Found a wildchar match '/mouseidgenes/*=appl01' [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] jk_handler::mod_jk.c (2222): Into handler jakarta-servlet worker=appl01 r->proxyreq=0 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] wc_get_worker_for_name::jk_worker.c (115): found a worker appl01 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] wc_maintain::jk_worker.c (323): Maintaining worker appl01 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] wc_get_name_for_type::jk_worker.c (292): Found worker type 'ajp13' [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] init_ws_service::mod_jk.c (888): Service protocol=HTTP/1.1 method=GET host=(null) addr=146.107.135.80 na me=vm53200-12 port=80 auth=(null) user=(null) laddr=146.107.35.101 raddr=146.107.135.80 uri=/mouseidgenes/InputData [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_get_endpoint::jk_ajp_common.c (2587): acquired connection pool slot=0 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_marshal_into_msgb::jk_ajp_common.c (553): ajp marshaling done [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_service::jk_ajp_common.c (2058): processing appl01 with 2 retries [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_send_request::jk_ajp_common.c (1352): (appl01) all endpoints are disconnected, detected by connect c heck (0), cping (0), send (0) [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] jk_open_socket::jk_connect.c (448): socket TCP_NODELAY set to On [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] jk_open_socket::jk_connect.c (548): trying to connect socket 13 to 127.0.0.1:8009 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] jk_open_socket::jk_connect.c (574): socket 13 connected to 127.0.0.1:8009 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connect_to_endpoint::jk_ajp_common.c (878): Connected socket 13 to (127.0.0.1:8009) [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (934): sending to ajp13 pos=4 len=433 max=8192 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (934): 0000 12 34 01 AD 02 02 00 08 48 54 54 50 2F 3 1 2E 31 - .4......HTTP/1.1 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_send_message::jk_ajp_common.c (934): 0010 00 00 17 2F 6D 6F 75 73 65 69 64 67 65 6 E 65 73 - .../mouseidgenes ... And this should be the beginning of the response: ... [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1117): received from ajp13 pos=0 len=10 max=8192 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1117): 0000 04 00 C8 00 02 4F 4B 00 00 00 00 00 00 0 0 00 00 - .....OK......... [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_unmarshal_response::jk_ajp_common.c (608): status = 200 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_unmarshal_response::jk_ajp_common.c (615): Number of headers is = 0 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1117): received from ajp13 pos=0 len=8188 max=8192 [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1117): 0000 03 1F F8 3C 48 65 61 64 3E 3C 74 69 74 6 C 65 3E - ...<Head><title> [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1117): 0010 4D 6F 75 73 65 49 44 47 65 6E 65 73 3C 2 F 74 69 - MouseIDGenes</ti [Wed Jun 01 14:04:31 2011] [26662:405231360] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1117): 0020 74 6C 65 3E 3C 2F 68 65 61 64 3E 0A 0D 0 A 3C 73 - tle></head>...<s ... You see the beginning of the html source code. > > So what I suspect, is that when you look at the mod_jk log, > you see lines that show that indeed mod_jk received the > request URL from Apache, and is trying to match it to one of > its internally mapped URLs. > But you may be missing the line that says, in the end, that > mod_jk could not match the URL, and is returning a response > "declined" to Apache. > > vm53200-12:/etc/apache2 # grep -i decline /var/log/apache2/mod_jk.log vm53200-12:/etc/apache2 # nothing found. Bernd Helmholtz Zentrum München Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH) Ingolstädter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir´in Bärbel Brumme-Bothe Geschäftsführer: Prof. Dr. Günther Wess und Dr. Nikolaus Blum Registergericht: Amtsgericht München HRB 6466 USt-IdNr: DE 129521671