• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Simple html site on localhost/simplewebsite ends up in an error 404

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i was searching the whole web and found dozens of solutions but none of them worked so i will try to find one here.

I have a Tomcat7 server running, which is fine. On localhost/jenkins i run our build server. Jenkins is working just fine. But what i need is to have a simple html website running parallel on localhost/simplewebsite. I just don't get it running

I tried to add:

<Context path="/simplewebsite" docBase="C:/somefolderonmycomputer" debug="0" reloadable="true" crossContext="false"/>

to the server.xml. But the only thing i get is an HTTP Status 404 error. Maybe i put it into the wrong section of the server.xml, i don't know. I know there are topics concerning this subject but i wasted a whole day yesterday without success. So you really make me the happiest man on the planet if you help me out

Thanks in advance
Sean
 
Sean McKenna
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again,

i solved the problem by following the steps described in this thread on stackoverflow:

stackoverflow

i hope that it is helpful for others as well.

Bye
Sean
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Sean!

Actually, neither the StackOverflow question nor the one you posted here provides an extremely critical datum: what URL you were getting the "404" on.

When you deploy an app in Tomcat using a context file in TOMCAT_HOME/conf/Catalina/localhost, the webapp context name you must use in the URL is the name of the Context file and not the context name in the context file. This is very annoying to me, but that's how it works.

If you configure using a META-INF/context.xml in the WAR itself, the context name is going to be taken from the name of the WAR (I think. I'd have to RTFM). I don't recommend adding this item to an already-deployed WAR, though. Add it to the WAR build process.

Note that the conf/Catalina/localhost context will override any context definition done in the WAR itself.
reply
    Bookmark Topic Watch Topic
  • New Topic