{"id":2322,"date":"2013-05-07T06:08:03","date_gmt":"2013-05-07T10:08:03","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=2322"},"modified":"2013-05-07T06:09:23","modified_gmt":"2013-05-07T10:09:23","slug":"how-to-install-tomcat-7-on-a-cpanel-server","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-install-tomcat-7-on-a-cpanel-server","title":{"rendered":"How to install Tomcat 7 on a cPanel server?"},"content":{"rendered":"<p>cPanel&#8217;s easyapache script by default install Tomcat version 5.5 and provides no option to upgrade to version 7.x if required, so people who requires Tomcat 7 will have to install\/upgrade tomcat manually but the newer version won&#8217;t be recognized by cPanel by default and people will have to configure domains manually in the tomcat configuration files.<\/p>\n<p>There is a workaround though, so once Tomcat 7 is installed and some small changes are made, it can be managed from WHM also.<\/p>\n<p><strong>1)<\/strong> Start by installing the available Tomcat version provided by cPanel using the easyapache script. It will install Java on your server so you don&#8217;t have to install it manually. cPanel will install Tomcat under \/usr\/local\/jakarta\/ directory and a link to tomcat inside it.<\/p>\n<blockquote>\n<pre># ls -la \/usr\/local\/jakarta\r\ndrwxr-xr-x\u00a0 13 tomcat nobody 4096 Apr 29\u00a0 2009 apache-tomcat-5.5.25\/\r\nlrwxrwxrwx\u00a0\u00a0 1 root\u00a0\u00a0 root\u00a0\u00a0\u00a0\u00a0 39 Apr 29\u00a0 2009 tomcat -&gt; \/usr\/local\r\n\/jakarta\/apache-tomcat-5.5.25\/<\/pre>\n<\/blockquote>\n<p><strong>2)<\/strong> Download Tomcat 7 in the \/usr\/local\/jakarta directory and extract it<\/p>\n<blockquote>\n<pre># cd \/usr\/local\/jakarta\r\n# wget http:\/\/apache.cs.utah.edu\/tomcat\/tomcat-7\/v7.0.39\/\\\r\nbin\/apache-tomcat-7.0.39.tar.gz\r\n# tar -zxf apache-tomcat-7.0.39.tar.gz<\/pre>\n<\/blockquote>\n<p><strong>3)<\/strong> Once the tomcat file is extracted, a new directory &#8216;apache-tomcat-7.0.39&#8217; will be created under the jakarta folder. Now, remove the old &#8216;tomcat&#8217; link and create a new symlink to point to the new tomcat directory i.e.<\/p>\n<blockquote>\n<pre># rm -f tomcat\r\n# ln -s \/usr\/local\/jakarta\/apache-tomcat-7.0.39 tomcat<\/pre>\n<\/blockquote>\n<p>so it looks like follows:<\/p>\n<blockquote>\n<pre># ls -la \/usr\/local\/jakarta\r\n drwxr-xr-x\u00a0 13 tomcat nobody apache-tomcat-5.5.25\/\r\n drwxr-xr-x\u00a0\u00a0 9 root\u00a0\u00a0 root apache-tomcat-7.0.39\/\r\n -rw-r--r--\u00a0\u00a0 1 root\u00a0\u00a0 root apache-tomcat-7.0.39.tar.gz\r\n lrwxrwxrwx\u00a0\u00a0 1 root\u00a0\u00a0 root tomcat -&gt; \/usr\/local\/jakarta\r\n\/apache-tomcat-7.0.39\/<\/pre>\n<\/blockquote>\n<p><strong>4)<\/strong> Now goto the new tomcat directory and compile the newer version<\/p>\n<blockquote>\n<pre># cd \/usr\/local\/jakarta\/tomcat\/bin\r\n# tar -zxf commons-deamon-native.tar.gz\r\n# cd commons-daemon-1.0.14-native-src\/unix\r\n# .\/configure\r\n# make\r\n# cp jsvc ..\/..\u00a0\u00a0 (copies the new file to the bin directory)<\/pre>\n<\/blockquote>\n<p><strong>5)<\/strong> Now copy the server.xml and workers.properties from the old tomcat installation to the new one. This is required if you already have tomcat enabled on some websites before the upgrade.<\/p>\n<blockquote>\n<pre># cp -p \/usr\/local\/jakarta\/apache-tomcat-5.5.25\/conf\/server.xml \\\r\n\/usr\/local\/jakarta\/tomcat\/conf\/\r\n# cp -p \/usr\/local\/jakarta\/apache-tomcat-5.5.25\/conf\/workers.properties\\\r\n\/usr\/local\/jakarta\/tomcat\/conf\/<\/pre>\n<\/blockquote>\n<p><strong>6)<\/strong> Now, restart the tomcat server<\/p>\n<blockquote>\n<pre># \/usr\/local\/jakarta\/tomcat\/bin\/shutdown.sh\r\n# \/usr\/local\/jakarta\/tomcat\/bin\/startup.sh\r\n# \/etc\/init.d\/httpd restart<\/pre>\n<\/blockquote>\n<p><strong>7)<\/strong> Check the tomcat version in use:<\/p>\n<blockquote>\n<pre># sh \/usr\/local\/jakarta\/tomcat\/bin\/version.sh<\/pre>\n<\/blockquote>\n<p>If for any reason, you would like to go back to the older Tomcat version, just goto the jakarta folder and change the &#8216;tomcat&#8217; symlink to the older tomcat folder and restart the tomcat server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>cPanel&#8217;s easyapache script by default install Tomcat version 5.5 and provides no option to upgrade to version 7.x if required, so people who requires Tomcat 7 will have to install\/upgrade tomcat manually but the newer version won&#8217;t be recognized by cPanel by default and people will have to configure domains manually in the tomcat configuration files.<br \/>\nThere is a workaround though, so once Tomcat 7 is installed and some small changes are made, it can be managed from WHM also.<br \/>\n1) Start by installing the available Tomcat version provided by [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1479,1481,1478,1477,1480],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/2322"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=2322"}],"version-history":[{"count":12,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/2322\/revisions"}],"predecessor-version":[{"id":2334,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/2322\/revisions\/2334"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=2322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=2322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=2322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}