aspose file tools*
The moose likes Tomcat and the fly likes Simple html site on localhost/simplewebsite ends up in an error 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Simple html site on localhost/simplewebsite ends up in an error 404" Watch "Simple html site on localhost/simplewebsite ends up in an error 404" New topic
Author

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

Sean McKenna
Greenhorn

Joined: Nov 13, 2012
Posts: 2
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

Joined: Nov 13, 2012
Posts: 2
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple html site on localhost/simplewebsite ends up in an error 404