Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

tomcat redirect localhost

Thread view: 
csteacy - 12 Sep 2006 19:02 GMT
Hello,
I'm working with an application that uses apache tomcat to serve the
website.  I've installed the application and tomcat on a Windows 2003
server and everything is working fine.  I do not have Apache or IIS
installed on the server.  What I was trying to figure out is how to
make events.mydomain.xxx redirect to the localhost/myapp but without
the localhost part.  For instance I want http://events.mydomain.xxx/ to
go to http://events.mydomain.xxx/myapp.

Any ideas how I might do this with apache tomcat would be very helpful
and appreciated.  Thank you in advance.
Manish Pandit - 12 Sep 2006 19:37 GMT
Hi,

Based on what I understood, are you using absolute URLs in your app
instead of relative? If you were refering to root as / instead of
your.app.domain/ the app would have worked fine regardless of the
domain it is installed on. Is this the case?

-cheers,
Manish
csteacy - 12 Sep 2006 19:45 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> -cheers,
> Manish

I'm a bit confused but I'll try to add more info.  My app is installed
under the Tomcat root in the webapps/myapp/ directory.  When I go to
http://localhost/myapp (on the server) it brings up the homepage.  The
app is all preconfigured and I haven't touched tomcat to put in any
URLs or anything.  I'm guessing upon install of the app that the folder
for it under tomcat root was created.  I'm sorry I'm just not
knowledgable enough in this area.  I hope that makes sense.  Thanks
again for all the help.

Christy
bikemh - 12 Sep 2006 20:00 GMT
I think all you want is to write an index.jsp, and put that into
tomcat/webapps/ROOT

the JSP can use response.sendRedirect(string) from HttpServletResponse
(which is an implicit variable addressed in a JSP simply as-->
response)

> I'm a bit confused but I'll try to add more info.  My app is installed
> under the Tomcat root in the webapps/myapp/ directory.  When I go to
[quoted text clipped - 6 lines]
>
> Christy
Manish Pandit - 12 Sep 2006 20:03 GMT
If you want your application to show up as default tomcat app
(localhost instead of locahost/yourapp) , then go to the tomcat's
webapps folder, remove the contents of /ROOT, put your application in
there and give it a try after restarting tomcat. Again - I am not sure
if this is what you want.

-cheers,
Manish

> > Hi,
> >
[quoted text clipped - 16 lines]
>
> Christy
bikemh - 12 Sep 2006 20:19 GMT
> If you want your application to show up as default tomcat app
> (localhost instead of locahost/yourapp) , then go to the tomcat's
> webapps folder, remove the contents of /ROOT, put your application in
> there and give it a try after restarting tomcat. Again - I am not sure
> if this is what you want.

if she wanted to go that route, you could instead just edit server.xml
so that

<Host name="events.mydomain.xxx" appBase="">

       <Context path="/" docBase="tomcat_home/webapps/myapp" />

</Host>

and thus redefine what is normally the ROOT webapp
csteacy - 19 Sep 2006 21:29 GMT
> if she wanted to go that route, you could instead just edit server.xml
> so that
[quoted text clipped - 6 lines]
>
> and thus redefine what is normally the ROOT webapp

I wanted to post back that this did work after a couple of trial and
error situations and remembering that I was working locally and not
publically yet so I had to use .local in the URL when testing instead
of the .com or .edu.  Thank you again for all the advice and help.

-Christy


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.