title: To use JSP and PHP in the same application
body: <p>My application is based on <code>PHP</code>. Now I want to integrate a web-reporter which is written in <code>JSP</code>. So, I have an <code>Apache HTTP Server</code> and an application written in PHP. I even installed <code>Tomcat</code> to serve <code>JSP</code> files and it is running well at 8080 port. I also got mod_jk.so and added a line <code>LoadModule jk_module modules/mod_jk.so</code> to <code>httpd.conf</code> file, but still I can't run <code>JSP</code> files from my application folders (port 80). I guess, there should be extra tuning of <code>httpd.conf</code> file, but I do not know, what exactly should be done.</p>
  
  <p><b>EDIT</b>
  My <code>workers.properties</code> looks exactly like this</p>
  
  <pre><code>JkWorkerProperty worker.list=ajp13w
  JkWorkerProperty worker.ajp13w.type=ajp13
  JkWorkerProperty worker.ajp13w.host=localhost
  JkWorkerProperty worker.ajp13w.port=8009
  </code></pre>
  
  <p>My <code>uriworkermap.properties</code> looks like this</p>
  
  <pre><code>/jsp/*=ajp13w
  </code></pre>
  
  <p>where <code>jsp</code> is a folder in htdocs, containing jsp files</p>
  
  <p>And finally, my <code>httpd.conf</code> now contains</p>
  
  <pre><code>LoadModule proxy_module modules/mod_proxy.so
  LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  LoadModule jk_module modules/mod_jk.so
  
  #AddModule     mod_jk.c
  #JkWorkersFile C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/workers.properties
  #JkMountFile   C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/uriworkermap.properties
  JkLogFile     C:/Apache/logs/mod_jk.log
  JkLogLevel    info
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  </code></pre>
  
  <p>Each commented line makes it impossible to start the server.</p>
  
  <p><b>EDIT</b></p>
  
  <p>I installed a newer version of Tomcat - Tomcat 8.0, but the problem remains unsolved.</p>
  
  <p><b>EDIT</b></p>
  
  <p>Judging by this link <a href="http://mail-archives.apache.org/mod_mbox/httpd-users/200902.mbox/%3Cc09599f40902270431q7269aa15h6550a3c0e979dba8@mail.gmail.com%3E" rel="nofollow">apache.org</a>, the problem can be solved by changing <code>server.xml</code> (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.</p>
  
  <p><b>EDIT</b></p>
  
  <p>I moved one step ahead. The most stupid error which made it impossible to run the server was quotes. So this line in <code>httpd.conf</code> - <code>JkWorkersFile C:/Program Files/Apache Software Foundation/Tomcat 8.0/conf/workers.properties</code> gave me an error, but after three hours of struggle it turned out, that it should be <code>JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 8.0/conf/workers.properties"</code>. So, now it runs. However, when I go to <code>localhost/jsp/index.jsp</code> I now see an <b><code>Apache Tomcat error report</code>: <code>HTTP Status 404 - /jsp/index.jsp</code></b>. This seems to be the last error, but still I do not know how to deel with it.</p>
  
  <p><b>EDIT</b></p>
  
  <p>Now I see it works. Though, I get an unexpected behaviour. I thought I could place <code>JSP</code> files inside htdocs folder, but as it turned out, they should be placed inside tomcat.</p>