MediaStroke dedicated tomcat

Java hosting web application deployment using cPanel

Generally, you want to host a Java web application on a server, so that it is accessible from anywhere world-wide. Eventually we start searching for Java hosting plan options available. But there are not as many readily available hosting options for Java-based web applications as those for PHP-based web applications.

Firstly, we develop a Java web application. Test and deploy it on Tomcat server on local systems. However, Java developers face a common challenge i.e. need of simple to use and manage Java hosting environment for server.

So as to address this challenge Dedicated Tomcat a cPanel plugin is the best choice specially customized to provide solution for hosting of Java web applications. Altogether using a Dedicated Tomcat plugin Java developers can easily manage Java hosting environment for their Java web applications.

This article covers step by step guide for hosting a Java web application developed using JSP, Servlets and MySQL for database using cPanel in detail.

Why cPanel for Java hosting?

cPanel is the most popular and easy to use control panel for web hosting. cPanel comes with lots of feature those are without a doubt useful to manage website, email, databases, cron jobs, SSL Certificates, DNS and more. As a matter of fact most of developers are using cPanel to manage their websites and other web hosting features

Why Java for building web applications?

Java is the most preferred programming language for web application developments. When all things considered Java has many advantages over other programming languages like high scalability, cross-platform support, excellent memory management, high performance and more. There are many Java technologies eventually useful for web application development like Servlets, Java Server Pages, Java Server Faces, JMS, Java Mail API, JavaBeans Activation Framework, Java API for XML Processing, JDBC, JPA, JNDI, JAXB, and many more.

Another key point is that Java is a robust language. Also there are many web frameworks which are written in Java or Java-based languages and runs on Java platform. As using these frameworks makes development simple and faster along with many other feature benefits as a result those frameworks are widely used. These Java frameworks are useful during the web application development of various domains like banking, finance, e-commerce, stock market, big data, AI, IoT, manufacturing and more.

To list out few examples of the popular Java frameworks available are Struts, Spring, Spring MVC, Spring Boot, Hibernate, Apache Wicket, Apache Hadoop, GWT, Grails, ATG, Play, Dropwizard, Vaadin, Tapestry, Spark, Vert.X, OpenXava, Jersey, Apache Mina, OSGi, MyBatis, MyFaces, Drools, and many more.

Hosting web application developed using Java.

You need to host your Java web application on server, so that it run on server and becomes accessible via internet from anywhere world-wide using any web client like browser.

To select from various plans which comes with Dedicated Tomcat specially designed for Java hosting solutions furnished by MediaStroke click here.

Once you purchased Java hosting plan, follow the below step-by-step procedure for hosting Java web applications.

Firstly, keep your Java web application packaged as WAR file prepared to host it onto server.

Step-by-step procedure for hosting Java web application

1. Login into cPanel

Login into cPanel of your hosting plan using username and password given by hosing provider. You can directly login to cPanel when you login into your MediaStroke account from Services by clicking Active button in front of your Java Hosting Service. It will take to next page, then click on Login to cPanel from left side bar.

Login into MediaStroke account -> Services -> My Services -> Active -> Login to cPanel

2. Go to Dedicated Tomcat plugin

The Dedicated Tomcat is a cPanel plugin specially customized for Java hosting solutions so as to provide easy setup and management of Java environment for Java web applications. Go to Dedicated Tomcat plugin in cPanel dashboard.

Java hosting using cpanel

3. Setup Java environment

Under Dedicated Tomcat there are features like Tomcat Version, JDK Version, Mappings, Manage Tomcat, Deploy specifically used to setup and manage Java environment for Java web applications deployment.

To setup Java environment for your Java web application using Dedicated Tomcat follow below steps:

a. Tomcat Version :

For hosting Java web applications the Tomcat server is comparatively most frequently used web server. Using this feature basically you can select Tomcat version you wish to install from the given list of Tomcat versions for your Java hosting.

While installing/reinstalling Tomcat server, it will overwrite files and/or projects from your existing Tomcat server instance, if there any.

Java hosting dedicated tomcat

b. JDK Version:

Using this feature the default JDK version can be changed to the version you wish from the drop-down list.

Select the JDK version of your choice from list and click on the Submit button.

Note that you need to restart the Tomcat server in order to apply the changed JDK version. You can restart Tomcat server from Manage Tomcat feature of Dedicated Tomcat.

set jdk version for java hosting

c. Manage Tomcat :

You can manage your Tomcat server instance using controls in Manage Tomcat feature.

If there is no running Tomcat server instance, you will see only one control button i.e. Start Tomcat. To start the Tomcat server instance click on the Start Tomcat button.

start tomcat server on cpanel

Once Tomcat server is started successfully the Stop Tomcat and Re-Start Tomcat buttons will be shown thereafter Tomcat server can be stopped or restarted using these buttons.

manage tomcat on cpanel server

d. Application Mapping :

The different ways for application mapping available are:

tomcat hosting application mappings

Universal Mapping : Use this option to map entire main domain space. This feature is useful to use complete hosting space for java applications only.

For example :

http://example.com

Project Mapping: Use this option to map particular projects only. Enter the project path(s) you would like to map in the text fields. This feature will run the PHP and/or HTML from the main domain and Java projects from the directory path.

For example :

http://example.com/demo

To submit the details entered for mapping, click on the Submit button.

Exclude Directory : Use this option to exclude particular directory from universal mapping. Enter the directory path which you would like to exclude from universal mapping in the text fields given. To submit the details entered to exclude from the mapping, click on the Submit button.

Disable Mapping : Use this option to disable all kind of mappings and only php and/or html will run from apache server. Simply it disables java features of cPanel.

Deploy WAR file :

Go to File Manager in Files.

Go to path /home/{user}/appservers/{tomacat_version}/webapps

Click on the Upload button and select WAR file from select file dialog.

Deploy war file path

Conclusion :

In summary we can say one has to follow simple procedure to setup and manage Tomcat for Java web applications on Java hosting by using Dedicated Tomcat under cPanel. Dedicated Tomcat is a simple to use alternative for Private JVM for Java hosting using cPanel.

Leave a Reply

Your email address will not be published. Required fields are marked *