This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Tomcat and the fly likes How to see my own home page instead of the Tomcat one? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to see my own home page instead of the Tomcat one?" Watch "How to see my own home page instead of the Tomcat one?" New topic
Author

How to see my own home page instead of the Tomcat one?

Guos Hu
Greenhorn

Joined: Jan 28, 2002
Posts: 9
I am using Apache1.3.23 and Tomcat3.3.
When I type "Http://localhost:8080" in the URL address, what I see is the tomcat welcome page. When I configured my own app in "apps-myapp.xml" by using
<Context path=""
docBase="webapps/myapp"
crossContent="true"
debug="0"
reloadable="true"
trusted="false">
</Context>
, and type "Http://localhost:8080" again, my file directories under "myapp" are listed. I can only get my home page by typing
"Http://localhost:8080/myapp/jsp/index.jsp".
How to config the tomcat so that I can get my home page just by typing ""Http://localhost:8080"?
Similar problems in Apache1.3.23. When I start apache and type into "local host", I see the apache's default page which told me that the apache web server installed successfully. How to config so that I can see "/myapp/jsp/index.jsp" page when just type "localhost"?
Thanks very much!
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Tomcat displays the index.html file in the ROOT directory under webapps as the default page. Simply change that page to whatever you want. You can override which is the default directory by changing the server.xml file found in the conf directory.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
james edwin
Ranch Hand

Joined: Nov 22, 2001
Posts: 393
Hi,
<your tomcat directory>\webapps\ROOT\index.html
Just do redirect in this index.html page to wherever u want to sent the user.


Regards,
James
Guos Hu
Greenhorn

Joined: Jan 28, 2002
Posts: 9
Thanks all!
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Is there a way to set the default context in server.xml instead of redirecting from index.html file
please let me know
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Take a look at your server.xml file to see how the application in the ROOT directory was configured.

path=""... etc...
Do the same for your app and remove the references to ROOT.

It's been years since I've touched version 3x so I'm not up on the particulars but everything you need should already be in server.xml.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
hi
i got some more issue now.
basically when i type http://localhost:8080 it goes into the manager context and list the files which are located under catalina_home\server\webapps\manager. So what i did was i created a index.jsp page. so that when i type http://localhost:8080 it goes to index.jsp page and from there i redirect it whichever context i want.
i hope this is the best solution.
BTW, i am a bit puzzled why does typing http://localhost:8080 went inside the manager context instead of the regular root context which displays the welcome Catalina page. Moreover when i type is it coz i have loaded tomcat on unix.

Let me know.
Thanks
Rashid
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to see my own home page instead of the Tomcat one?