开发者

How to work with a shared Tomcat?

Sorry, but I tried searching for this subject, but I didn't find related to my problem. Recently, I bought a domain and web hosting for it. I bought it especially for using it for my Java projects. I have Tomcat available as server on the hosting.

My question is: how do I work with a hosted Tomcat, which, in my opinion, it is quite different from localhost (where you could have unlimited a开发者_运维知识库ccess)?

For example, if I create a Spring project that looks like this:

project-name

src

war

index.jsp

WEB-INF

web.xml

The index.jsp outputs a simple This is a test

web.xml

<welcome-file-list>

   <welcome-file>

      index.jsp

   </welcome-file>

</welcome-file-list>

I created an Ant build.xml that will build the project, but when I access from http://domain.com/project-name it will not work, and I only cand access the file from http://domain.com/project-name/war

If I had done this on localhost, I'd deploy it in tomcat-path/webapps, but how does this work online?


The solution is to install Tomcat Manager Webapp in order to deploy applications on a shared hosting that uses Tomcat as server.

EDIT:
If the hosting doesn't offer you Tomcat Manager (as was in my case), you can still make it through by asking the administrator of your hosting to configure your jk_mod file to deploy your war files.

Append these lines

jkMount /*.war ajp3
jkMount /* ajp3 ## I'm still not sure if this made it work, because it makes tomcat listen on the entire public_html

But be aware, if your version of Tomcat is brought to you by cPanel's EasyApache, you will have to deal with some issues there too - the latest installed Tomcat will be 5.5.33 (a bit old, right?), but again you can try tweaking the old version and install, let's say 6.x.x
A tutorial about this upgrade:

http://www.bestdesigns.co.in/blog/install-tomcat-6

The thing that help me a lot to understand the concepts that were envolved in solving this problem:

http://www.scribd.com/doc/6085698/Tomcat -- a training course about Tomcat and cPanel

An another thing to add: Install a local version of Tomcat on your machine, first deploy it on localhost. If there it works, it should be working online as well.

Those of you who work with Spring Roo, on Tomcat 5.5.33, if you already know, you cannot deploy your projects, becase of the too old Tomcat, so you have to upgrade your Tomcat immediately.

I hope this will help all of those who had difficulties like myself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜