IndianWebPortal.com

Something Different In Linux

Home » Tomcat » Access the servlets directly via port 80

Access the servlets directly via port 80

Posted by Rishikesh Vispute Categories: Tomcat

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.


Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...