The Linux hosting servers at SANGKRIT.net provides you cPanel management, many Java applications ship in WAR packages which means Web Application Archive that you can easily install on your server.
Deploying Java WAR Packages:
There are two methods of deploying Java Application: The file manager interface and the command line interface. This lesson will focus on easier method i.e. via File Manager Interface.
For deploying a Java WAR package using the cPanel File Manager interface, first login to your cPanel and then navigate to cPanel’s File Manager interface from Home >> Files >> File Manager then follow the given steps:
- Select your public_html directory.
- Click New Folder to create a new folder
- Select your new folder in the center pane of the interface.
- Click Upload followed by Choose File.
- Browse the Java WAR package and then click Open.
- Select the file and click Rename.
- Change the file extension from .war to .zip and click Rename File.
- Select the .zip file and click Extract.
- Select the .htaccess file inside your public_html directory
If in case you do not see any .htaccess file then it must be kept hidden. To make the file visible click ‘Settings’ and tick ‘Show hidden files’ option. You can do same from the popup shown when you attempt to open your file manager.
Continue with the following steps:
- Click Edit followed by clicking Edit in the Text Editor
- Now enter the following text in the text box:12SetHandler jakarta-servletSetEnv JK_WORKER_NAME ajp13
- Save Changes your changes and access your Java application with the http://example.com/exampledirectory/examplejavaapplication URL.
- example.com represents your domain name
- exampledirectory represents the Java application’s directory
- examplejavaapplication represents the Java application’s name
That’s all. Your Java Application is now ready to use.