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