{"id":14380,"date":"2025-02-21T18:18:00","date_gmt":"2025-02-21T12:48:00","guid":{"rendered":"https:\/\/www.skynats.com\/?p=14380"},"modified":"2025-02-21T18:18:08","modified_gmt":"2025-02-21T12:48:08","slug":"deploying-a-tomcat-application-using-podman-on-a-cpanel-server","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/deploying-a-tomcat-application-using-podman-on-a-cpanel-server\/","title":{"rendered":"Deploying a Tomcat Application  Using Podman on a cPanel Server"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Deploying Tomcat application using Podman on a cPanel server usually requires a variety of configuration steps. While there are several container management tools available, Podman offers a simpler and daemon-free approach to managing containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-by-step-deployment-guide\" style=\"font-size:18px\"><strong>Step-by-Step Deployment Guide<\/strong><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-1-install-tomcat-with-podman\" style=\"font-size:18px\">Step 1: Install Tomcat with Podman<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start by accessing the Terminal on your <a href=\"https:\/\/cpanel.net\/\" target=\"_blank\" rel=\"noopener\">cPanel<\/a>. To install Tomcat via Podman, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/ea-podman install ea-tomcat101<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command install Tomcat and creates a directory named like ea-tomcat101.username.02 within \/ea-podman.d\/ directory.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"font-size:18px\">Step 2: Upload Your WAR File<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, navigate to the newly created Tomcat directory:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/home\/username\/ea-podman.d\/ea-tomcat101.username.02<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Inside this directory, locate the webapps folder and upload your .war file there. Make sure the file is named ROOT.war to ensure it\u2019s deployed correctly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"font-size:18px\">Step 3: Modify Tomcat Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure your application is deployed on startup, navigate to the conf file&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/home\/username\/ea-podman.d\/ea-tomcat101.username.02\/conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">open the server.xml file for editing. Look for the following line:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&lt;Host name=&#8221;localhost&#8221; appBase=&#8221;webapps&#8221; unpackWARs=&#8221;false&#8221; autoDeploy=&#8221;false&#8221; deployOnStartup=&#8221;false&#8221; deployXML=&#8221;false&#8221;&gt;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Change the false values to true, so it looks like this:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&lt;Host name=&#8221;localhost&#8221; appBase=&#8221;webapps&#8221; unpackWARs=&#8221;true&#8221; autoDeploy=&#8221;true&#8221; deployOnStartup=&#8221;true&#8221; deployXML=&#8221;true&#8221;&gt;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;ve made the change, save and close the file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" style=\"font-size:18px\">Step 4: Restart Tomcat<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To apply the changes, restart the Tomcat service by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/ea-podman restart ea-tomcat101.username.02<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Upon restarting, your .war file will automatically deploy into the webapps folder, and a directory named ROOT will be created for your application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"font-size:18px\">Step 5: Configure Apache<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Next, log into your server via SSH as the root user and modify the Apache configuration file located at \/usr\/local\/apache\/conf\/httpd.conf. Search for the domain example.com and uncomment the following lines in the virtual host entries for ports 81 and 444:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Include \"\/etc\/apache2\/conf.d\/userdata\/std\/2_4\/username\/example.com\/*.conf\"\nInclude \"\/etc\/apache2\/conf.d\/userdata\/ssl\/2_4\/username\/example.com\/*.conf\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;ve made these changes, save the file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"font-size:18px\">Step 6: Create Necessary Directories<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, as the root user, create the following directories:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/etc\/apache2\/conf.d\/userdata\/std\/2_4\/username\/example.com\nmkdir -p \/etc\/apache2\/conf.d\/userdata\/ssl\/2_4\/username\/example.com<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" style=\"font-size:18px\">Step 7: Add Proxy Configuration<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Inside both of the newly created directories, create a file named proxy.conf and add the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;IfModule proxy_ajp_module>\n    ProxyPass \"\/\" \"ajp:\/\/127.0.0.1:10003\/\"\n&lt;\/IfModule><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To determine the correct port, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>podman ps<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" style=\"font-size:18px\">Step 8: Restart Apache<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, restart Apache to apply all your changes by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart httpd<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-conclusion\" style=\"font-size:18px\">Conclusion<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Your Tomcat application should now be successfully deployed and accessible on your cPanel server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For assistance with deploying a Tomcat application using Podman on a cPanel server, contact our expert <a href=\"https:\/\/www.skynats.com\/blog\/\">support team<\/a> today for seamless guidance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deploying Tomcat application using Podman on a cPanel server usually requires a variety of configuration steps. While there are several container management tools available, Podman offers a simpler and daemon-free approach to managing containers. Step-by-Step Deployment Guide Step 1: Install Tomcat with Podman Start by accessing the Terminal on your cPanel. To install Tomcat via [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[870,972,971],"class_list":["post-14380","post","type-post","status-publish","format-standard","hentry","category-blog","tag-cpanel-server","tag-podman","tag-tomcat-application"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/14380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=14380"}],"version-history":[{"count":1,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/14380\/revisions"}],"predecessor-version":[{"id":14381,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/14380\/revisions\/14381"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=14380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=14380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=14380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}