Access the servlets directly via port 80

What if I like to access the servlets directly via port 80 instead of using :portnumber on my URL?
You can do a trick, Edit apache virtual host entry and add the JkMount directive.
For example: I wanted to access a servlet which was under seed directory of my document root. I was able to access the servlet at http://domainname.com:8080/seed/servlet/<ServletNAME>
All I wanted to do is to simplify the above URL to look like :
http://domainname.com/seed/servlet/<ServletNAME>
This is not possible as appBase and DocBase are set to my domains Document root.
Hence I had make use of JkMount directive in VirtulHost entry as follows to change the appBase for the servler URI as follows :
<IfModule mod_jk.c>
JkMount /*.do ajp13
JkMount /*.jsp ajp13
JkMount /seed/servlet/* ajp13
JkMount /seed/servlets/* ajp13
JkMount /manager/* ajp13
</IfModule>
Now my URL works as needed.

Leave a Comment