How to Deploy Dynamic Java Web Project on Java Hosting server
Login To cPanel
Log in to cPanel using cPanel Username and Password given by Java hosting provider. In other way Login into MediaStroke account and Click on Services then Click on Active Button which is in front of your Java Hosting Service. It will go to next page then Click on Login to cPanel link from left side bar.
Login to MediaStroke -> Services -> My Services -> Active -> Login to cPanel.
Create and manage Database
Using MYSQL Databases and phpMyAdmin we can create and manage a database. Creation of Database and user using MYSQL Databases is explained below:
Click on MySql Database and create a database and user then add user to database.
Create New Database:
To create a Database for a java project enter database name and click on Create Database. The Database will be created.
For example,
as we enter sample_db as a database name the database name will become abrwdnbc_sample_db means cPanelUsername_dbname. In above example, abrwdnbc is username of cPanel account user.
Add new User:
To create user of database enter username and password as per your choice. To generate strong and valid password click on generate password. Type password again to verify a password then Click on Create User.
For example,
as we enter user as a user which will become abrwdnbc_user that means cPanelUsername_dbusername.
Add User to Database:
Connect the user to the database which help to access database. Select user and Database and click on Add button which will add user to the database
After after adding user to database, manage privileges. Select privileges and click on Make Changes(note:select all privileges).
In above Example, user abrwdnbc_user added to database abrwdnbc_sample_db. Then Go back to the Databases and click on phpMyAdmain to manage database.
Login to cPanel -> Databases -> MySql Database -> Create new Database -> Create new user -> Add user to Database -> Manage Privilege
Manage Database
First, Select your Database from phpMyAdmin then Create and manage table.
Databases -> phpMyAdmin -> Select your database -> Create table -> Manage table
Database connectivity:
After creation of database use the hostname, Database_name, Username, and Password to connect database to Java project.
Generate WAR file:
To deploy java project on java hosting server we convert this file into war file first. Follow the steps below to convert into war file:
After completion of code of java project right click on project, select Export option and then click on WAR file.
Right click on project -> Export -> WAR file.
Deployment of WAR File :
When enter in cPanel, Click on Private JVM application Software. In private JVM Select and install Apache-tomcat server and its version as per your choice. Apache-tomcat server is used for deployment of java project on java Hosting.
Login to cPanel -> Software -> Private JVM -> Apache-tomcat & version
Start Apache-tomcat, Select JDK version and apply on next page and assign domain or subdomain which map domain to Private JVM. In mapped domain table on same page Enable Private JVM (Tomcat) Click on Enable/Disable. To Upload, a war file Click on deploy then select the war file and deploy.
To upload war file from file manager click on Link of Java Project path contain in Mapped Domain table which appears at bottom of the table. In these 2 ways we can upload war file.
Login to cPanel -> Software -> Private JVM -> Apache-tomcat & version -> Start Apache-tomcat -> apply JDK version -> Enable/disable domain -> Deploy war
OR
Login to cPanel -> Software -> Private JVM -> Apache-tomcat & version -> Start Apache-tomcat -> apply JDK version -> Enable/disable domain ->click on java project Path -> File manager -> upload war file
Run Project on Java Hosting
Enter www.domain_name/project_name to run project on Java Hosting.
Open new tab -> enter www.domain_name/project_name
Webroot directories such as web, www, public_html the ROOT.war directory is webroot directory to run project using domain name. For example, enter www.domain_name.com on Java Hosting server. If project file is save as ROOT.war which webroot diectory then goto new tab -> enter www.domain_name
Java Hosting at MediaStroke:
We recommend MediaStroke provide best java hosting services with Private JVM and cPanel. You can host your Java project with MySql Database with Apache-tomcat server. You can also host your JSP, servlet, Spring, Hibernate projects or any other Java web application on java hosting. Best end support to run your website without any interrupt. Standard plan, B2B Business Plan and Pro plan at affordable prices.
For more detailed information Refer Link: https://mediastroke.com/java-hosting
To host your simple Java project on Java Hosting server refer our Previous blog Click Here
Thanks for the useful information.