Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes How to change application url by meaningfull name? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to change application url by meaningfull name?" Watch "How to change application url by meaningfull name?" New topic
Author

How to change application url by meaningfull name?

Yatish Sonkeshariya
Greenhorn

Joined: Sep 28, 2011
Posts: 16

Hi,

I just want to change my Java-Webapp url and webapp deployed in Tomcat-6.0 i.e i want to change webapp-url from http://localhost:8080/mywebapp to http://yatish/mywebapp.

Also i want to authenticate my webapp using Tomcat.



Thanks, Yatish Sonkeshariya
Pune(411001), India
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

There are 2 ways to simplify the URL. One is to modify Tomcat's server.xml to use port 80 rather than its default of 8080 and to install the webapp in place of Tomcat's default root webapp.

The other way is to proxy Tomcat. The Apache HTTP server is often used to do this using either the old mod_jk connector or the newer Apache mod_proxy.

The second way has the advantage of keeping port 80 available for non-Java webapps and it minimizes the amount of customization needed to the Tomcat configuration and app deployment. The price is that you're now running 2 servers instead of 1.

The first way eliminates that expense, but the price is that you cannot just use Tomcat in its "out-of-the-box" configuration.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

As for J2EE (Tomcat) security, the best place to start is any good book on servlets and JSPs. Read up on setting up web.xml for secure transport, security roles, and secured URLs. That will tell you what you need on the application side.

On the Tomcat side you simply deploy with a security Realm configured into the application Context. There are a number of Realm plugins that come with Tomcat, including JDBC, LDAP, and JAAS. There's also a simpler set of MemoryRealms that make testing easier by allowing you to define user IDs, passwords and security roles in an XML file (tomcat-users.xml).
Yatish Sonkeshariya
Greenhorn

Joined: Sep 28, 2011
Posts: 16

Thanks Tim for reply.
Could you explain both way to achieve this goal, step by step?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to change application url by meaningfull name?
 
Similar Threads
c:import problem
Tomcat settings in an production environment?
Custom WebApp servlet url problem
UnpackWAR
Basic doubt