title: Configuring Apache Web Server with Tomcat
body: <p>I am trying to configure <code>Apache</code> webserver with <code>Tomcat</code> using <code>AJP</code>, but I am not sure am I doing it right or not. </p>
  
  <p>Here are the steps that I followed:</p>
  
  <p>Enabled <code>requiredModule</code> in <code>httpd.conf</code> file</p>
  
  <pre><code>LoadModule proxy_module modules/mod_proxy.so  
  LoadModule proxy_ajp_module modules/mod_proxy_ajp.so  
  </code></pre>
  
  <p>Added the <code>ifModule</code> condition in <code>httpd.conf</code> file</p>
  
  <pre><code>&lt;IfModule mod_proxy&gt;  
      ProxyPass / ajp://localhost:8009/  
      ProxyPassMatch ^(/photos/.*\.jpg)$!  
  &lt;/IfModule&gt;  
  
  
  Alias /photos "F:\projects\AL\Photos"  
  
  
  &lt;Directory "F:\projects\AL\Photos"&gt;  
      Options Indexes MultiViews  
      AllowOverride None  
      Order allow,deny  
      Allow from all  
  &lt;/Directory&gt; 
  </code></pre>
  
  <p>And finally, added the <code>Connector</code> in the <code>server.xml</code> file for <code>Tomcat</code></p>
  
  <pre><code>&lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt;
  </code></pre>
  
  <p>Now, I am trying to browse to a JSP file at the following location:</p>
  
  <pre><code>http://localhost:8009/examples/jsp/jsp2/el/basic-arithmetic.jsp
  </code></pre>
  
  <p>This works fine, but I want to instead browse the JSP at: </p>
  
  <pre><code>http://localhost/examples/jsp/jsp2/el/basic-arithmetic.jsp. 
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>&lt;IfModule mod_proxy&gt;
  
      ProxyPass / ajp://localhost:8009/
      ProxyPassReverse / ajp://localhost:8009/
      ProxyPassMatch ^(/photos/.*\.jpg)$!
  
      Alias /photos "F:\projects\AL\Photos"
  
      &lt; Directory "F:\projects\AL\Photos"&gt;
          Options Indexes MultiViews
          AllowOverride None
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>and then I tried to browse the following url</p>
  
  <pre><code>http://localhost/examples/jsp/jsp2/el/basic-arithmetic.jsp
  </code></pre>
  
  <p>which also does not work.</p>
  
  <p>Have I done it right or there is something else that I can do? </p>