{"id":762,"date":"2024-03-15T12:03:24","date_gmt":"2024-03-15T12:03:24","guid":{"rendered":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?p=762"},"modified":"2024-03-15T12:03:42","modified_gmt":"2024-03-15T12:03:42","slug":"how-to-install-apache-tomcat-7-on-centos-7-html","status":"publish","type":"post","link":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html","title":{"rendered":"How To Install Apache Tomcat 7 on CentOS 7 ?"},"content":{"rendered":"<div class=\"kb-article-content\">\n<h1 class=\"HeadingStyles__StyledH1-sc-73f0758c-0 kOcXHf TutorialTemplate___StyledHeading2-sc-c876722d-1 cniRZf\">How To Install Apache Tomcat 7 on CentOS ?<\/h1>\n<p>sudo yum install tomcat -y<\/p>\n<p>This will install Tomcat 7 and its dependencies, such as Java, and it will also create the&nbsp;<code>tomcat<\/code>&nbsp;user.<\/p>\n<p>&nbsp;<\/p>\n<p>sudo vi \/usr\/share\/tomcat\/conf\/tomcat.conf<\/p>\n<p>we will install a few additional packages that will help you manage your Tomcat applications and virtual hosts.<\/p>\n<p>Make change to the Java options that Tomcat uses when it starts. Open the Tomcat configuration file.<\/p>\n<p>sudo vi \/usr\/share\/tomcat\/conf\/tomcat.conf<\/p>\n<p>Add the following&nbsp;<code>JAVA_OPTS<\/code>&nbsp;line to the file. Feel free to change the&nbsp;<code>Xmx<\/code>&nbsp;and&nbsp;<code>MaxPermSize<\/code>&nbsp;values\u2014these settings affect how much memory Tomcat will use<\/p>\n<pre><code>JAVA_OPTS=\"-Djava.security.egd=file:\/dev\/.\/urandom -Djava.awt.headless=true -Xmx<mark>512m<\/mark> -XX:MaxPermSize=<mark>256m<\/mark> -XX:+UseConcMarkSweepGC\"<br><br>Save and exit.<br><br><\/code><\/pre>\n<h2 id=\"install-admin-packages\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-apache-tomcat-7-on-centos-7-via-yum#install-admin-packages\">Install Admin Packages<\/a><\/h2>\n<p>To install the default Tomcat root page (tomcat-webapps), and the Tomcat Web Application Manager and Virtual Host Manager (tomcat-admin-webapps), run this command<\/p>\n<p>sudo yum install -y tomcat-webapps tomcat-admin-webapps<\/p>\n<p>This adds the&nbsp;<code>ROOT<\/code>,&nbsp;<code>examples<\/code>,&nbsp;<code>sample<\/code>,&nbsp;<code>manager<\/code>, and&nbsp;<code>host-manager<\/code>&nbsp;web apps to the&nbsp;<code>tomcat\/webapps<\/code>&nbsp;directory.<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"configure-tomcat-web-management-interface\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-apache-tomcat-7-on-centos-7-via-yum#configure-tomcat-web-management-interface\">Configure Tomcat Web Management Interface<\/a><\/h2>\n<p>In order to use the manager webapp installed in the previous step, we must add a login to our Tomcat server. We will do this by editing the&nbsp;<code>tomcat-users.xml<\/code>&nbsp;file.<\/p>\n<p>sudo vi \/usr\/share\/tomcat\/conf\/tomcat-users.xml<\/p>\n<p>&nbsp;<\/p>\n<p>This file is filled with comments which describe how to configure the file. You may want to delete all the comments&nbsp;<strong>between<\/strong>&nbsp;the following lines, or you may leave them if you want to reference the examples.<\/p>\n<pre><code>&lt;tomcat-users&gt;\n...\n&lt;\/tomcat-users&gt;<br><br><br>Add a user who can access the&nbsp;manager-gui&nbsp;and&nbsp;admin-gui&nbsp;(the management interface that we installed earlier).<br>You can do so by defining a user similar to the example below. Be sure to change the username and password to something secure.<br><br><\/code><\/pre>\n<pre><code>&lt;tomcat-users&gt;\n    &lt;user username=\"<mark>admin<\/mark>\" password=\"<mark>password<\/mark>\" roles=\"manager-gui,admin-gui\"\/&gt;\n&lt;\/tomcat-users&gt;<\/code><br><br><br>Save and exit the&nbsp;<code>tomcat-users.xml<\/code>&nbsp;file.<br><br><br><\/pre>\n<h2 id=\"start-tomcat\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-apache-tomcat-7-on-centos-7-via-yum#start-tomcat\">Start Tomcat<\/a><\/h2>\n<p>sudo systemctl start tomcat<\/p>\n<p>If you started the service earlier for some reason, run the restart command instead.<\/p>\n<p>sudo systemctl restart tomcat<\/p>\n<p>sudo systemctl enable tomcat<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"access-the-web-interface\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-apache-tomcat-7-on-centos-7-via-yum#access-the-web-interface\">Access the Web Interface<\/a><\/h2>\n<pre><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Open in web browser:\">Open in web browser:<\/div>\n<pre><code>http:\/\/<mark>server_IP_address<\/mark>:8080<\/code><br><br><br>You will see something like the following image.<br><br><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hostitsmart.com\/manage\/images\/kb\/1220_tomcat.png\" alt=\"\" width=\"765\" height=\"234\"><\/pre>\n<pre><br><code>Let\u2019s take a look at the Manager App, accessible via the link or&nbsp;http:\/\/<mark>server_IP_address<\/mark>:8080\/manager\/html<br><br><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hostitsmart.com\/manage\/images\/kb\/1224_tomcat-manager.png\" alt=\"\" width=\"591\" height=\"491\"><br><br><br>The Web Application Manager is used to manage your Java applications. You can Start, Stop, Reload, Deploy, and Undeploy here. <br>You can also run some diagnostics on your apps (i.e. find memory leaks).<br><br>http:\/\/<mark>server_IP_address<\/mark>:8080\/host-manager\/html<br><br><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hostitsmart.com\/manage\/images\/kb\/1225_tomcat-virtual-host-manager.png\" alt=\"\" width=\"764\" height=\"308\"><br><br><br>From the Virtual Host Manager page, you can add virtual hosts to serve your applications from.<br><br><br><br><\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How To Install Apache Tomcat 7 on CentOS ? sudo yum install tomcat -y This will install Tomcat 7 and its dependencies, such as Java, and it will also create the&nbsp;tomcat&nbsp;user. &nbsp; sudo vi \/usr\/share\/tomcat\/conf\/tomcat.conf we will install a few additional packages that will help you manage your Tomcat applications and virtual hosts. Make change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[],"class_list":["post-762","post","type-post","status-publish","format-standard","hentry","category-tomcat"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Install Apache Tomcat 7 on CentOS 7 ?<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Install Apache Tomcat 7 on CentOS 7 ?\" \/>\n<meta property=\"og:description\" content=\"How To Install Apache Tomcat 7 on CentOS ? sudo yum install tomcat -y This will install Tomcat 7 and its dependencies, such as Java, and it will also create the&nbsp;tomcat&nbsp;user. &nbsp; sudo vi \/usr\/share\/tomcat\/conf\/tomcat.conf we will install a few additional packages that will help you manage your Tomcat applications and virtual hosts. Make change [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html\" \/>\n<meta property=\"og:site_name\" content=\"Host IT Smart Knowledge base\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-15T12:03:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-15T12:03:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hostitsmart.com\/manage\/images\/kb\/1220_tomcat.png\" \/>\n<meta name=\"author\" content=\"Admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html\"},\"author\":{\"name\":\"Admin\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9\"},\"headline\":\"How To Install Apache Tomcat 7 on CentOS 7 ?\",\"datePublished\":\"2024-03-15T12:03:24+00:00\",\"dateModified\":\"2024-03-15T12:03:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html\"},\"wordCount\":293,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\"},\"articleSection\":[\"Tomcat\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html\",\"name\":\"How To Install Apache Tomcat 7 on CentOS 7 ?\",\"isPartOf\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website\"},\"datePublished\":\"2024-03-15T12:03:24+00:00\",\"dateModified\":\"2024-03-15T12:03:42+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\",\"name\":\"Host IT Smart Knowledge base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\",\"name\":\"Host IT Smart Knowledge base\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":240,\"height\":80,\"caption\":\"Host IT Smart Knowledge base\"},\"image\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9\",\"name\":\"Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g\",\"caption\":\"Admin\"},\"sameAs\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\"],\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Install Apache Tomcat 7 on CentOS 7 ?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html","og_locale":"en_US","og_type":"article","og_title":"How To Install Apache Tomcat 7 on CentOS 7 ?","og_description":"How To Install Apache Tomcat 7 on CentOS ? sudo yum install tomcat -y This will install Tomcat 7 and its dependencies, such as Java, and it will also create the&nbsp;tomcat&nbsp;user. &nbsp; sudo vi \/usr\/share\/tomcat\/conf\/tomcat.conf we will install a few additional packages that will help you manage your Tomcat applications and virtual hosts. Make change [&hellip;]","og_url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html","og_site_name":"Host IT Smart Knowledge base","article_published_time":"2024-03-15T12:03:24+00:00","article_modified_time":"2024-03-15T12:03:42+00:00","og_image":[{"url":"https:\/\/hostitsmart.com\/manage\/images\/kb\/1220_tomcat.png"}],"author":"Admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html#article","isPartOf":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html"},"author":{"name":"Admin","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9"},"headline":"How To Install Apache Tomcat 7 on CentOS 7 ?","datePublished":"2024-03-15T12:03:24+00:00","dateModified":"2024-03-15T12:03:42+00:00","mainEntityOfPage":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html"},"wordCount":293,"commentCount":0,"publisher":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization"},"articleSection":["Tomcat"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html","name":"How To Install Apache Tomcat 7 on CentOS 7 ?","isPartOf":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website"},"datePublished":"2024-03-15T12:03:24+00:00","dateModified":"2024-03-15T12:03:42+00:00","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/377\/How-To-Install-Apache-Tomcat-7-on-CentOS-7-.html"]}]},{"@type":"WebSite","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/","name":"Host IT Smart Knowledge base","description":"","publisher":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization","name":"Host IT Smart Knowledge base","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":240,"height":80,"caption":"Host IT Smart Knowledge base"},"image":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9","name":"Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g","caption":"Admin"},"sameAs":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/"],"url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/comments?post=762"}],"version-history":[{"count":1,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/762\/revisions"}],"predecessor-version":[{"id":763,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/762\/revisions\/763"}],"wp:attachment":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/media?parent=762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/categories?post=762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/tags?post=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}