Tuesday, May 12, 2015

Apache Tomcat server runs but does not display home page

<!--[if !mso]><![endif]
Well this particular issue was pestering me for a while now. All my apps on this server were running properly but still when I say http://localhost:8080 it would serve me an error page. Now I know that this error page is being served by the server at least. So, why not the server’s root page?

This led me to search for the root folder of the server. Well that was another mess that I made with my tomcat folder lol. Coming back to the point, I found a neat an good explanation about a fix for this issue in a pretty decent webpage - http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html .

It said the following,
Copy the ROOT (default) Web app into Eclipse. Eclipse forgets to copy the default apps (ROOT, examples, docs, etc.) when it creates a Tomcat folder inside the Eclipse workspace. Go to C:\apache-tomcat-7.0.34\webapps and copy the ROOT folder. Then go to your Eclipse workspace, go to the .metadata folder, and search for "wtpwebapps". You should find something like C:\your-eclipse-workspace-location\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps (or .../tmp1/wtpwebapps if you already had another server registered in Eclipse). Go to the wtpwebapps folder and paste ROOT (say "yes" if asked if you want to merge/replace folders/files). Then reload http://localhost/ to see the Tomcat welcome page.

So my working directories in my local machine were as follows
“Root folder’s” folder path in Tomcat deployed directory – D:\softwares\apache-tomcat-7.0.54\webapps\
My eclipse workspace - D:\EclipseWorkspace\Server8090\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps

Now I copy pasted the folder named “Root” from former to the later and I skipped over writing any existing files.

And now my beautiful server’s gorgeous home page is as follows


No comments:

Post a Comment