さて、友達、私は一種の初心者なので、基本的または比較的簡単な質問に聞こえるかもしれません。私がやろうとしているのは、JSPを使用して小さなアプリケーションを開発し、サーブレットがtomcat5.5.35を使用してネットワーク内のマシンの1つにそれをデプロイしたことだけです。完全に機能し、JSP/サーブレットが期待どおりに実行されているのを確認できました。ここで、残りのページをPHPで開発し、ApacheおよびTomcatコネクタを使用してPHPとJSP/サーブレットを統合することを考えました。
Apacheバージョン-2.2.22win32 x86nossl。Tomcatコネクタ-tomcat-connectors-1.2.36-windows-i386-httpd-2.2.x
I called a php script from PHP Directory and it got displayed as expected.
問題の説明: ApacheはJSPとサーブレットをTomcatに転送していません。
mod_jk.soを/modulesにコピーしました
私はworker.propertiesを作成し、次の内容で\confディレクトリにコピーしました
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
httpd.confを次のように変更しました
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ServerName localhost:80
<ifmodule mod_jk.c>
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel DEBUG
</ifmodule>
LoadModule jk_module "C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_jk.so"
JkWorkersFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/workers.properties"
JkShmFile "C:/Program Files/Apache Software Foundation/Apache2.2/logs/mod_jk.shm"
JkLogFile "C:/Program Files/Apache Software Foundation/Apache2.2/logs/mod_jk.log"
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
<VirtualHost *:80>
DocumentRoot "C:/Program Files/apache-tomcat-5.5.35/webapps/automationutil"
SetEnvIf Request_URI \.php no-jk
SetEnvIf Request_URI \.cgi no-jk
JkMount /* worker1
JkMount /*.jsp worker1
</VirtualHost>
Tomcatのserver.xml
以下のmod_jk.logsを見ることができますが、tomcatログにはエラーが表示されません。
1:06:16 2012] [5580:3828] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/loginrelated.html' from 0 maps
[Wed May 16 21:06:16 2012] [5580:3828] [debug] jk_translate::mod_jk.c (3723): no match for /automationutil/pages/loginrelated.html found
[Wed May 16 21:06:16 2012] [5580:3828] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/loginrelated.html' from 0 maps
[Wed May 16 21:06:16 2012] [5580:3828] [debug] jk_map_to_storage::mod_jk.c (3798): no match for /automationutil/pages/loginrelated.html found
[Wed May 16 21:06:16 2012] [5580:3828] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/loginfooter.html' from 0 maps
[Wed May 16 21:06:16 2012] [5580:3828] [debug] jk_translate::mod_jk.c (3723): no match for /automationutil/pages/loginfooter.html found
[Wed May 16 21:06:16 2012] [5580:3828] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/loginfooter.html' from 0 maps
[Wed May 16 21:06:16 2012] [5580:3828] [debug] jk_map_to_storage::mod_jk.c (3798): no match for /automationutil/pages/loginfooter.html found
[Wed May 16 21:06:16 2012] [5580:4996] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/index_settings.jpg' from 0 maps
[Wed May 16 21:06:16 2012] [5580:4996] [debug] jk_translate::mod_jk.c (3723): no match for /automationutil/pages/index_settings.jpg found
[Wed May 16 21:06:16 2012] [5580:4996] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/index_settings.jpg' from 0 maps
[Wed May 16 21:06:16 2012] [5580:4996] [debug] jk_map_to_storage::mod_jk.c (3798): no match for /automationutil/pages/index_settings.jpg found
[Wed May 16 21:06:23 2012] [5580:4996] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/helppage.jsp' from 0 maps
[Wed May 16 21:06:23 2012] [5580:4996] [debug] jk_translate::mod_jk.c (3723): no match for /automationutil/pages/helppage.jsp found
[Wed May 16 21:06:23 2012] [5580:4996] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/pages/helppage.jsp' from 0 maps
[Wed May 16 21:06:23 2012] [5580:4996] [debug] jk_map_to_storage::mod_jk.c (3798): no match for /automationutil/pages/helppage.jsp found
[Wed May 16 21:06:32 2012] [5580:4996] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/LoginApp' from 0 maps
[Wed May 16 21:06:32 2012] [5580:4996] [debug] jk_translate::mod_jk.c (3723): no match for /automationutil/LoginApp found
[Wed May 16 21:06:32 2012] [5580:4996] [debug] map_uri_to_worker_ext::jk_uri_worker_map.c (1131): Attempting to map URI '/automationutil/LoginApp' from 0 maps
[Wed May 16 21:06:32 2012] [5580:4996] [debug] jk_map_to_storage::mod_jk.c (3798): no match for /automationutil/LoginApp found
web.xmlにサーブレットのマッピングがあり、Tomcatで正常に動作します。しかし、なぜapacheがそれらを正しく処理していないのかわかりません:(。JSPのマッピングも必要ですか?
非常に感謝し、私を動かすことができるどんな助けにも感謝します。過去数日間ネットを検索しましたが、利益はありません。