As the question explains I want to deploy a Java servlet based application which is developed on a local server (Apache Tomcat 6.0). I have the IP address, Host name for the new virtual server. I want to know, if it will be just a normal site migration process where I'll have to install Tomcat on the new server and configure the server, web XML files or is there a bit more.
As I have not done Tomcat config before. Any Help would be great
Is there a step-by-step documentation to perform this
Thanks
Download and install Java
Download Tomcat http://tomcat.apache.org/download-70.cgi
Read http://tomcat.apache.org/tomcat-7.0-doc/setup.html
Build your webapp into a war file with your build scripts
Copy the war file into webapps directory under your tomcat installation directory. More details can be found http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html
I find it best to create a script that deploys my webapp from running my build script. And scp and ssh task comes in handy for installing it quickly. There are probably other maven tasks that might work for you.
Related
Actually I have to run my java war file having service which i want to access .normally in pc we run eclipse and use tomcat to do so. But in server if I have space then how to run my war file over there.
Basically you just install tomcat on your server and deploy the war file to it. There is lots of documentation on how to do this.
I would turn to the tomcat documentation on how to get started:
https://tomcat.apache.org/tomcat-8.0-doc/introduction.html
I started my journey into web applications about three years ago and I'm happy to say that I've finally deployed a working website. My concern is that to deploy the website I use the Eclipse IDE and a Tomcat webserver. So basically I right click the project in Eclipse and then choose "Run As > Run on Server" and then select the Tomcat server I downloaded - from that point on the console spits out some startup messages and my website is online and ready for use. What are are some of the drawbacks of deploying a project this way. I've read just briefly about WAR files and adding them to Tomcats Webapps folder but I could neither get that working nor did I understand completely the process...so is it acceptable to just deploy the project the way I have been doing thus far by running it in Eclipse?
Generally Development machine and deployment server is different.
On Deployment server one may not have eclipse always.
WAR file is just a webarchive which includes all the necessary files. WAR makes your project portable.
Export WAR from eclipse place it in tomcat webapps in any machine and restart tomcat.
You should have your webapp successfully running on that machine.
That's a fine way for deploying a server when you're learning, or always have the server (the only server!) running on your development machine.
If you need to push to a remote machine, it won't work, and you'll need to learn other methods then, but for now, what you're doing is fine.
I have created an application in Java EE, I have learned how to deploy it in the tomcat server using the manager app or by copying the war file to the webapps folder. Now I can start the tomcat server only from the Netbeans IDE.
I want to know how to start the apache tomcat server without using the IDE and run my web application from the war file deployed. If I'm headed in the wrong direction please correct me. I'm asking this to gain knowledge of how to deploy the .war file in another server system without using the IDE only the tomcat server.
The shell scripts located in "CATALINA_HOME/bin" are the most bare-bones way of getting Tomcat up and running. The two scripts capable of starting Tomcat in this directory are named "catalina" and "startup", with extensions that vary by platform.
In your tomcat installation directory, there would be a startup.bat/sh file which will start the server for you. Moreover you can see the conf folder as well if you want to change any configurations. Whatever war you copy to the webapps folder will be automatically deployed
I wrote a small servlet and jsp project on eclipse and tomcat 5.5, but I don't know with works I do for make that a real site on a real host. Should I war them or I should upload project on host? My host should have which properties? I really don't now how to start?
I would recommend packaging them in a war and deploying it out to the remote tomcat server. Its not a good idea to deploy an unpackaged project directly to the server unless your debugging or testing. Once you have a finished project ready to deploy package it to a war. I typically deploy to server using the tomcat manager page. Just browse for the war, click the upload button and it should start right up. On my local machine this is the url that I use to upload to the server http://localhost:8080/manager. The server itself should have the same properties and settings that you are using in your eclipse workspace, and I would highly recommend that it be the same version as well. The war can also be dropped into a directory on the remote host and Tomcat will load this on startup, this location will vary depending on the host.
Currently, I have tomcat installed on the production server to serve my java webapps. I develop in eclipse at my personal workstation and then I use an ant script to build the project into a war file and deploy that on the server.
This setup works well when I am on the same network as the server because deploying is almost instantaneous. However, now that I am working remotely uploading the war file to the server is slow and in most cases very redundant (there are about .5 GB of static media included in the war file).
Is there a better way to update my webapp on tomcat from eclipse and if so what are the best options for implementing such a solution with minimal effort?
Checkout rsync. It transmits just the updates to the file, so it will greatly speed up your process. Also depending on how complex your application is you might look into installing jetty on your personal workstation. It works well with eclipse and lets you check the new code almost instantaneously.
What it sounds like you want is to have the exploded war file(your root app/result of ant compile) sit in your tomcat web-apps folder. Tomcat will deploy it based on the host or context tag in server.xml.
This way, you can just drop your $app/WEB-INF/classes into the application and, if context reload is enabled, the new files will be deployed immediately.