Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Unable to access robots.txt file on tomcat 6 server

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry if i sound silly, but I'm facing a weird problem.

I made a robots.txt file and uploaded it to my Tomacat 6 webapps/ROOT folder, but when I try to access it through http://www.this-is-not-my-real-domain-name.com/robots.txt I get a 404 not found error.
I restarted the server multiple times, without success. I've also checked the mime type on the server's web.xml file.

What am i doing wrong?
Isn't it supposed to be simple.

Please help me out. I would really appreciate it.
 
Bartender
Posts: 20838
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tomcat root application is a little bit different from other webapps. You can't just patch stuff into the default root app the way you could any other deployed app. There are instructions on how to do this in the Tomcat docs at tomcat.apache.org.
 
Tony Ghy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:The Tomcat root application is a little bit different from other webapps. You can't just patch stuff into the default root app the way you could any other deployed app. There are instructions on how to do this in the Tomcat docs at tomcat.apache.org.



I searched the documentation but couldn't find any help.

Can someone please guide me.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My robots.txt works just fine in Tomcat6.

What other files do you have in webapps/ROOT ?

Did you use the default <welcome-file-list> contents?

What do you get for a plain request to "http://yourdomain/" ?

Bill
 
Tony Ghy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

William Brogden wrote:My robots.txt works just fine in Tomcat6.

What other files do you have in webapps/ROOT ?

Did you use the default <welcome-file-list> contents?

What do you get for a plain request to "http://yourdomain/" ?

Bill



My webapps/ROOT contain the following:

META-INF
resources
WEB-INF
index.jsp
robots.txt

My Welcome file list contains:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

A plain request to http://yourdomain/ works fine. My site is in production & working just fine. Only robots.txt file is not accessible.


Please guide.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is really mysterious!

If this was my problem I would be looking for clues in the log files.

I would also try putting a robots.txt file in another web application to see if only the ROOT is affected.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!