Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do I deploy a Java War archive/web application into a server that uses the latest version of Cpanel control panel? The server has Cent OS 6.2 OS.

share|improve this question
    
Is the tomcat server deployed from WHM? –  Wesley Apr 24 '12 at 6:43
    
@WesleyDavid - I used EasyApache to install Tomcat from within WHM... –  Arvind Apr 25 '12 at 8:52

1 Answer 1

Update: i might have misunderstood your request, if you don't have any Java Application server, then you can install tomcat using the following commands as root at an ssh/telnet console;

# install tomcat6 and httpd
yum -y install tomcat6 java-1.6.0-openjdk httpd mysql-connector-java

that command will install a lot of dependencies, but importantly it sets up tomcat and httpd as services, which can be started like so;

service httpd start
service tomcat6 start

and to add to be started automatically every reboot;

chkconfig tomcat6 on
chkconfig httpd on

You can setup SSH from cpanel folowing these instructions; - http://docs.cpanel.net/twiki/bin/view/11_30/CpanelDocs/ShellAccess

or this tutorial; - http://www.cpanel.net/media/tutorials/ssh.htm

So assuming that either you have tomcat or that the Java application server supports some form of auto-deployment, then you should copy the war file to the appropriate directory;

1) tomcat auto-deploy folder under CentOS is

/var/lib/tomcat6/webapps

2) glassfish supports auto-deployment under the auto-deploy folder under domain1;

/opt/glassfishv3/glassfish/domains/domain1/autodeploy

You should be able to copy the file from your local machine to these folders using the cpanel File Manager.

If you do not have a war file, then the alternative is to create context fragment into the /usr/share/tomcat6/conf/Catalina/localhost/ folder like this post describes;
http://wiki.metawerx.net/wiki/Context.xml

Both glassfish and tomcat also support their own manager interfaces via the various admin tools (which you almost certainly want to configure eventually, in order to effectively manage these apps) which you can alternatively use to deploy WAR archives remotely.

However be aware that securing tomcat manager is important, as its easy to leave open with silly easy password etc.

share|improve this answer
    
I have Tomcat already installed using EasyApache in cpanel- are your instructions applicable still in my case? Thanks... –  Arvind Apr 26 '12 at 5:29
    
from what I understood, EasyApache installs Apache web server and PHP, but not apache tomcat. You might need to run the above commands to find out. If you can get a shell login try rpm -qa | grep tomcat6 –  Tom H Apr 26 '12 at 7:36
    
ok, i did install tomcat using whm, and now i can see under "Restart Services" in WHM, an option for "Restart Tomcat Servlet Server"... so tomcat is installed... –  Arvind Apr 26 '12 at 9:36
    
right, so using the cpanel File manager, look for the folder /var/lib/tomcat6/webapps and then copy your war file into that. –  Tom H Apr 26 '12 at 9:42

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.