How to auto deploy .war on cpanel server?

colorcloud

Active Member
Aug 14, 2003
28
0
151
Hi there,

I just install CPanel's tomcat addon, but I have questions about deploy war files.

How can we deploy war file without giving everyone access to Tomact manager?
As I try to deploy a war file using Tomcat manager, it was uncompress at tomcat's default "webapps" dir, but not /home/username/public_html , how does everyone else dealing with this?
Can we set CP serve to auto deploy war files?
 

colorcloud

Active Member
Aug 14, 2003
28
0
151
Well, cpanel's developer replied:

Can we have CP's addon module Tomcat to auto deploy a end user's war
file after they upload their war file to the server?

You can have it do anythign you wish in the install function.

As far as watching for it to upload and doing somethgin you'd have to setup a
mechanism to watch for it and act on it.
However, could someone explan me what he was talking about? :confused:
 

muugii

Member
Aug 31, 2006
6
0
151
any solution?

my jsptest file is working fine. But howto deploy WAR file? How is it working?

thanks,
Muugii
 

nasix

Registered
Mar 8, 2010
3
0
51
Have you had a response to your question ? I m suffering for the same problem.

Thanks.
 

Vinayak

Well-Known Member
Jun 27, 2003
288
7
168
Bharat
cPanel Access Level
Root Administrator
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="domain.com" appBase="/home/username/public_html" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false" reloadable="true">
<Alias>www.domain.com</Alias>
<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">
</Context>
</Host>
There was a problem preserving the entries, for the same follow this thread
Unable to run jsp pages with www.domain.com - cPanel Forums
 

qwidjib0

Member
PartnerNOC
Aug 3, 2005
15
0
151
Chicago, Illinois
cPanel Access Level
Root Administrator
Twitter

Vinayak

Well-Known Member
Jun 27, 2003
288
7
168
Bharat
cPanel Access Level
Root Administrator
Actually it's very simple, they just need to unzip the .war archive in shell. See:

How to deploy a .WAR application - Ubiquity Web Hosting Wiki

We have over 100 users that have used these instructions and it works great. If you deployed Tomcat using EasyApache and have it setup as cPanel has designed, that should be about it. That was derived from:

http://twiki.cpanel.net/twiki/pub/AllDocumentation/TrainingResources/TrainingSlides08/Tomcat.pdf
But for that the user will need shell access, also what if it's a continuous development/updating process.

The server.xml tweak that I had mentioned, just needs the .WAR file uploaded as any other file to /public_html folder and it's done. Now if the developers have made any changes on the dev platform, they just have to upload the new .WAR file and they are done.
 

qwidjib0

Member
PartnerNOC
Aug 3, 2005
15
0
151
Chicago, Illinois
cPanel Access Level
Root Administrator
Twitter
But for that the user will need shell access
True, though jailed shell is a nice feature to enable.

also what if it's a continuous development/updating process.
That could present a problem (I believe the servlet would still need to be restarted, which cPanel currently does not provide a feature for short of restarting Tomcat). Although editing in a live server environment is not best practice (the ideal method would obviously be to develop and test in Eclipse with a local machine being used for development).

The server.xml tweak that I had mentioned, just needs the .WAR file uploaded as any other file to /public_html folder and it's done. Now if the developers have made any changes on the dev platform, they just have to upload the new .WAR file and they are done.
Actually both methods result in that entry being added to server.xml. :)
 

a24uall

Active Member
Feb 4, 2010
27
0
51
India
Haiii,

uploaded .war to public_html >> restarted tomcat
Extracted folder was created in
/usr/local/jakarta/apache-tomcat-5.5.28/work/Catalina/DOMAIN.COM/FOLDER (war file name)

that makes the domain accessible through browser as :
DOMAIN.COM:8080/FOLDER
hope its clear for my friends...

Now I just want to know how I can make this accessible as DOMAIN.com/FOLDER
Or
how I can make the extracted folder automatically come under my public_html folder instead of /usr/local/jakarta/apache-tomcat-5.5.28/work/Catalina/DOMAIN.COM/FOLDER

thanks...
 

victornet

Registered
Jul 8, 2010
1
0
51
Create the .war without the folder path, your deployment will then be in the /public_html
can u explain how to make this? im having the same problem

my war is deploying on jakart folders and with that i can acces by site.com:8080 i want to acess as site.com too