I have developed an web application using HTML, Java Servlet and all. While developing I was using Tomcat to deploy it in order to test it.
Now my development is done and I want to make it live. For that we have live server but as I am new to all this I dont know how to deploy my java web application on live server?
So please help me if you know to answer?
My Project Structure
ProjectName ->src ->beanClass ->class1 ->Class2 ->easyServlet ->Servlet1 ->Servlet2 ->Servlet3 ->easyTrans ->Class1 ->Class2 ->Class3 ->Class4 ->build ->WebContent ->META-INF ->MENIFEST.mf ->WEB-INF ->lib(contain javascript files) ->web.xml ->html1 ->html2 ->html3 ->html4 ->html5
I am also using MySql so what I have to about it..
To deploy a web application to Apache Tomcat, you can copy a WAR file to the application base directory, e.g., c:/Tomcat8/webapps . This operation of course presupposes we know the application base directory. We could consult server. xml and look up the Host element to determine the directory name.
You will have to build a WAR of the project. You can do this
via ant using the war task
The ant option is better because when you have multiple developers on the project and the code is in version control, it is easier to get the project automatically (using ant) and build a war. (you have version control, don't you?)
But this is more of an operational difference (albeit an important one) but the war created in either way are same
Deploy the war to the server
You can manually copy the war file to the $TOMCAT_HOME/webapps directory (See the "Creating and Deploying a WAR File" section on this article)
You can use the Tomcat 6 "Manager" application.
Update
You said that you are using MySql also. MySql should be installed on a server (it can be on the same server) and the configuration should be changed (username, password, server details) so that the application connects to the same database (I am sure you are not hard coding database details and credentials in your application and reading them from some configuration, this is the configuration that has to be changed)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With