2014-01-03 18:52
浏览 50


My application is based on PHP. Now I want to integrate a web-reporter which is written in JSP. So, I have an Apache HTTP Server and an application written in PHP. I even installed Tomcat to serve JSP files and it is running well at 8080 port. I also got and added a line LoadModule jk_module modules/ to httpd.conf file, but still I can't run JSP files from my application folders (port 80). I guess, there should be extra tuning of httpd.conf file, but I do not know, what exactly should be done.

EDIT My looks exactly like this

JkWorkerProperty worker.list=ajp13w
JkWorkerProperty worker.ajp13w.type=ajp13
JkWorkerProperty worker.ajp13w.port=8009

My looks like this


where jsp is a folder in htdocs, containing jsp files

And finally, my httpd.conf now contains

LoadModule proxy_module modules/
LoadModule proxy_ajp_module modules/
LoadModule jk_module modules/

#AddModule     mod_jk.c
#JkWorkersFile C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/
#JkMountFile   C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/
JkLogFile     C:/Apache/logs/mod_jk.log
JkLogLevel    info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

Each commented line makes it impossible to start the server.


I installed a newer version of Tomcat - Tomcat 8.0, but the problem remains unsolved.


Judging by this link, the problem can be solved by changing server.xml (of tomcat) and some changes of httpd.conf (concerning virtual host). But as allways in this world, this article does not provide any concrete examples.


I moved one step ahead. The most stupid error which made it impossible to run the server was quotes. So this line in httpd.conf - JkWorkersFile C:/Program Files/Apache Software Foundation/Tomcat 8.0/conf/ gave me an error, but after three hours of struggle it turned out, that it should be JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 8.0/conf/". So, now it runs. However, when I go to localhost/jsp/index.jsp I now see an Apache Tomcat error report: HTTP Status 404 - /jsp/index.jsp. This seems to be the last error, but still I do not know how to deel with it.


Now I see it works. Though, I get an unexpected behaviour. I thought I could place JSP files inside htdocs folder, but as it turned out, they should be placed inside tomcat.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新