How to deploy war files into cPanel and remove the project name?

Trainee Asked on October 10, 2019 in Cpanel.
Add Comment
2 Answer(s)

According to one cpanel hosting service command prompt access is generally turned off for cpanel for security reasons and you have to ask for it specifically. If you have this access you can login and run the unzip command (after uploading the war file using FileZilla or similar).

According to cpanel if you don’t have command prompt access, you can upload the war to your public_html directory, but before doing this you need to change the apache config and add a “JkMount” for this (see the one with “appname” below).

<IfModule mod_jk.c>
  JkMount /*.jsp ajp13
  JkMount /servlet/* ajp13
  JkMount /servlets/* ajp13
  JkMount /*.do ajp13
  JkMount /appname/* ajp13

Except of course you put “your app name” instead of appname. This change will instruct apache to redirect calls to the top-level url (ie to your Tomcat instance (ie After you have uploaded the war and changed the config, you have to restart apache.

But we said we didn’t have ssh access, so how do we modify that file. according to this forum we can edit the /home/username/public_html/.htaccess or just /public_html/.htaccess and add these lines:

SetHandler jakarta-servlet

Now, apache will re-direct to tomcat for instead of How do we get it to work from just I simply don’t know the answer to this. As far as I know using the usual trick of changing the war file to ROOT.war does not work in cpanel.

Reviewer Answered on October 10, 2019.
Add Comment

You will have to fix the entries at /usr/local/jakarta/tomcat/conf/server.xml Some time back after lot of tweaking I used this and it worked:

<Host name="" appBase="/home/username/public_html" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" reloadable="true">
<Context path="" reloadable="true" docBase="/home/username/public_html" debug="1" privileged="true" autoDeploy="true" liveDeploy="true" />
<Context path="/manager" debug="0" privileged="true" docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
Reviewer Answered on October 10, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.