Found one hack solutions: create a soft link from other folder to ROOT
Sent from my iPhone > 在 2015年9月7日,09:51,Mike Guo <hongw...@163.com> 写道: > > Hi, folks. > > > I really need your guys help. I got so confuse about the tomcat 8.0.26 > virtual host configuration . > > > per tomcat document. it is really easy to configuration. > > so, I did what need to as document. > > let me have a example here. > > I got two hosting : localhostting and www.demo.com. > > > I add those configuration into con/server.xml > > <Host name="www.demo.com" appBase=“demo" > unpackWARs="true" autoDeploy="true"> > <Valve className="org.apache.catalina.valves.AccessLogValve" > directory="logs" > prefix=“demo_access_log" suffix=".txt" > pattern="%h %l %u %t "%r" %s %b" /> > > </Host> > > > and then startup the tomcat directly. and I know there are some directory > that need to create, but I found tomcat will do it automatic. like tomcat > already created the directory for host www.demo.com the app base directly. > demo. > > so, let me count them: > %tomcat_install%/demo (which is the hosting app base folder) > %tomcat_install%/conf/Catalina/www.demo.com (which is the hosting > configuration folder) > %tomcat_install%/work/Catalina/www.demo.com (which is the hosting work > folder). > > what’s I mean is all folder already were created. no missed. > > then, I shutdown the virtual hosting, I did not do anything testing yet. I > just want to put a application into my virtual hosting. also, I want to my > application will be deploy the ROOT application. > > so, per the document. I have two choice. copy the whole application to > %tomcat_install%/demo/ROOT fold (or make a war package named ROOT). I know > this will be work. but I am in development phrase. I don’t want to I need > deploy my application always when I debug or development. because every time > re-deploy, the session will be gone, it will make me trouble when I do the > debugging on page. so, I checked the “context” document, I found we can use > docbase put the application into somewhere. right now, let us assume my app > which I development is here: /home/ghw/demo which is a web content too. > > > so, per tomcat 8 document. > > I put a ROOT.xml here: %tomcat_install%/conf/Catalina/www.demo.com/ and same > time, I delete the ROOT folder in %tomcat_install%/demo/ which is the place > we need deploy application here. > > so, I suppose the virtual host should be work like this. > one thing, the ROOT.xml content like this: > > <Context docBase="/home/ghw/demo" reloadable="true"/> > > > and then, I restart the tomcat. > > and access: www.demo.com/index.jsp (which is a very simple jsp file, just say > “hello world”) > > > but I got 404 error. > > > I tried to make the the appBase to “” empty (someone said like this, but I > didn’t get any official document on tomcat) in con/server.xml, it doesn’t > work. I tried many times. many ways. and no logs, no any error tips. just > give me a blank page or 404. > > > it almost kill me. is there any one can give me a tips? > > > look like the docBase never work for tomcat 8. why? > any thing I did wrong? > > > thanks so much > > > Mike.G > > > > > > > > > > > > >