{"id":569,"date":"2024-09-19T12:12:01","date_gmt":"2024-09-19T15:12:01","guid":{"rendered":"https:\/\/bc.novooobj.xyz\/como-configurar-o-tomcat-como-servico-no-linux\/"},"modified":"2024-09-19T12:12:01","modified_gmt":"2024-09-19T15:12:01","slug":"configurar-tomcat-como-servico-linux","status":"publish","type":"post","link":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/","title":{"rendered":"Como configurar o Tomcat como servi\u00e7o no Linux?"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"color: #3366ff; font-size: large;\">Problema<\/span><\/p>\n<p style=\"text-align: justify;\"><strong>Como configurar o Tomcat como servi\u00e7o no Linux?<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: large; color: #3366ff;\">Solu\u00e7\u00e3o\/Procedimento<\/span><\/p>\n<p style=\"text-align: justify;\">Para\u00a0facilitar a utiliza\u00e7\u00e3o do Tomcat no Linux, \u00e9 poss\u00edvel criar um script que re\u00fane em um \u00fanico arquivo as opera\u00e7\u00f5es necess\u00e1rias para utiliza\u00e7\u00e3o do mesmo (start, stop, restart e status). Al\u00e9m do script, tamb\u00e9m pode-se realizar algumas configura\u00e7\u00f5es para se utilizar como um servi\u00e7o. <\/span><\/p>\n<p style=\"text-align: justify;\">Esse\u00a0artigo, ser\u00e1 dividido em tr\u00eas partes: primeiro ser\u00e1 exibido uma lista de comandos com ilustra\u00e7\u00f5es; em seguida, o c\u00f3digo e a explica\u00e7\u00e3o do funcionamento do mesmo; e por \u00faltimo ser\u00e1 demonstrado como a configura\u00e7\u00e3o do servi\u00e7o \u00e9 realizada utilizando a biblioteca &#8220;chkconfig&#8221;.<\/span><\/p>\n<p style=\"text-align: justify;\"><strong>1 &#8211; Comandos<\/strong><strong>:<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">A &#8211; Listar comandos do script: &#8220;<strong>service tomcat<\/strong>&#8220;<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG\" alt=\"\" width=\"430\" height=\"55\" align=\"\" \/><\/p>\n<p style=\"text-align: justify;\">B &#8211; Iniciar servi\u00e7o do Tomcat: &#8220;<strong>service tomcat start<\/strong>&#8220;<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat_start.PNG\" alt=\"\" width=\"951\" height=\"138\" align=\"\" \/><\/p>\n<ul style=\"list-style-type: disc; text-align: justify;\">\n Ao iniciar o servi\u00e7o, \u00e9 verificado se o mesmo j\u00e1 est\u00e1 em execu\u00e7\u00e3o, para impedir que duas inst\u00e2ncias fiquem ativas.<\/li>\n<\/ul>\n<p style=\"padding-left: 30px; text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat_start_validacao.PNG\" alt=\"\" width=\"325\" height=\"58\" align=\"\" \/><\/p>\n<p style=\"text-align: justify;\">C &#8211;\u00a0Parar servi\u00e7o do Tomcat: &#8220;<strong>service tomcat stop<\/strong>&#8220;<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat_stop.PNG\" alt=\"\" width=\"954\" height=\"156\" align=\"\" \/><\/span><\/p>\n<p style=\"text-align: justify;\">D &#8211;\u00a0Reiniciar servi\u00e7o Tomcat: &#8220;<strong>service tomcat restart<\/strong>&#8220;<\/span><\/p>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat_restart.PNG\" alt=\"\" align=\"\" \/><\/span><\/p>\n<p style=\"text-align: justify;\">E &#8211;\u00a0Listar status do servi\u00e7o: &#8220;<strong>service tomcat status<\/strong>&#8220;<\/span><\/p>\n<ul style=\"list-style-type: disc; text-align: justify;\">\n Ativo:<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat_status.PNG\" alt=\"\" width=\"336\" height=\"179\" align=\"\" \/><br \/><\/span><\/p>\n<ul style=\"list-style-type: disc; text-align: justify;\">\n<li>Inativo:<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat_status_inativo.PNG\" alt=\"\" width=\"334\" height=\"176\" align=\"\" \/><br \/><\/span><\/p>\n<hr \/>\n<p style=\"text-align: justify;\"><strong>2 &#8211; An\u00e1lise de C\u00f3digo:<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">Agora que j\u00e1 t\u00eam uma vis\u00e3o do funcionamento do script, vamos analis\u00e1-lo melhor em c\u00f3digo. Deve-se criar um arquivo chamado <strong>tomcat<\/strong> na pasta &#8220;<strong>bin<\/strong>&#8221; do Tomcat.<\/span><\/p>\n<p style=\"text-align: justify;\"><strong>A &#8211; Vari\u00e1veis do servi\u00e7o<\/strong><\/span><\/p>\n<ul style=\"text-align: justify;\">\n <strong>C\u00f3digo:<\/strong><\/li>\n<\/ul>\n<pre class=\"wp-block-code-block-pro\"><pre class=\"EnlighterJSRAW\">#!\/bin\/bash\n# chkconfig: 2345 20 80\n# description: Tomcat Server basic start\/shutdown script\n# processname: tomcat\n\n#JAVA_HOME=\/opt\/oobj\/aplicativos\/jre1.7.0_75\n#export JAVA_HOME\n\t\n#PATH=$PATH:$JAVA_HOME\/bin\n#export PATH\n\t\nTOMCAT_HOME=\/opt\/oobj\/aplicativos\/tomcat\/bin\nSTART_TOMCAT=\/opt\/oobj\/aplicativos\/tomcat\/bin\/startup.sh\nSTOP_TOMCAT=\/opt\/oobj\/aplicativos\/tomcat\/bin\/shutdown.sh<\/pre><\/pre>\n<p style=\"text-align: justify;\">No c\u00f3digo acima, as vari\u00e1veis s\u00e3o:<\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li><strong>JAVA_HOME<\/strong> e <strong>PATH:<\/strong> est\u00e3o comentadas, pois o Tomcat j\u00e1 pega o Java do S.O. Caso queira utilizar um Java espec\u00edfico, basta remover o coment\u00e1rio (sharp: #) e informar o caminho da pasta do Java;<\/li>\n<li><strong>TOMCAT_HOME:<\/strong>\u00a0informar o caminho do Tomcat.<\/span>\n<ol style=\"list-style-type: lower-alpha;\">\n<li>As vari\u00e1veis\u00a0<strong>START_TOMCAT<\/strong> e <strong>STOP_TOMCAT\u00a0<\/strong>tamb\u00e9m devem apontar para o mesmo caminho do Tomcat.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">B &#8211;\u00a0Procedimentos de inicializa\u00e7\u00e3o: &#8220;<strong>start<\/strong>&#8220;:<\/span><\/p>\n<ul style=\"list-style-type: disc; text-align: justify;\">\n <strong>C\u00f3digo:<\/span><\/strong><\/li>\n<\/ul>\n<pre class=\"wp-block-code-block-pro\"><pre class=\"EnlighterJSRAW\">start() {\na=&lt;code&gt;{{EJS0}}&lt;\/code&gt;\nif [ -n &quot;$a&quot; ]; then\necho -e &quot; \\033[1;32m Servi\u00e7o ja em execucao \\033[0m&quot;\nelse\necho -n &quot;Starting tomcat: &quot;\ncd $TOMCAT_HOME\n${START_TOMCAT}\necho &quot;done.&quot;\nfi\n}<\/pre><\/pre>\n<p style=\"text-align: justify;\"><strong>\u00a0<\/span><\/strong><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #252525; font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: #ffffff;\">Na vari\u00e1vel &#8220;<strong>a<\/strong>&#8221; armazena a informa\u00e7\u00e3o se o tomcat est\u00e1 ativo ou n\u00e3o. Trata-se de uma consulta pelo servi\u00e7o, utilizando-se 2 filtros, um pelo &#8220;java&#8221; e outro pelo caminho de instala\u00e7\u00e3o do tomcat &#8220;$TOMCAT_HOME&#8221;. Se houver inst\u00e2ncia do tomcat ativa, um valor ser\u00e1 armazenado, caso contr\u00e1rio, a vari\u00e1vel ficar\u00e1 vazia. Uma condi\u00e7\u00e3o avalia se a vari\u00e1vel &#8220;<strong>a<\/strong>&#8221; est\u00e1 vazia ou n\u00e3o, se estiver vazia, uma mensagem de que o servi\u00e7o j\u00e1 est\u00e1 em execu\u00e7\u00e3o \u00e9 exibida na tela; caso contr\u00e1rio, o tomcat \u00e9 iniciado.<\/span><\/p>\n<p style=\"text-align: justify;\">C &#8211;\u00a0Procedimentos de parada: &#8220;<strong>stop<\/strong>&#8220;<\/span><\/p>\n<ul style=\"list-style-type: disc; text-align: justify;\">\n <strong>C\u00f3digo:<\/strong><\/li>\n<\/ul>\n<pre class=\"wp-block-code-block-pro\"><pre class=\"EnlighterJSRAW\">stop() {\necho -n &quot;Shutting down tomcat: &quot;\ncd $TOMCAT_HOME\n${STOP_TOMCAT}\na=&lt;code&gt;{{EJS1}}&lt;\/code&gt;\n&lt;code&gt;{{EJS2}}&lt;\/code&gt;\necho -e &quot; \\033[1;31m kill PID $a \\033[0m&quot;\n}<\/pre><\/pre>\n<p style=\"text-align: justify;\"><span style =\"color:#687f8c;  font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: #ffffff;\">O procedimento de parada chama o servi\u00e7o de &#8220;<strong>shutdown<\/strong>&#8221; do Tomcat para parar o servi\u00e7o. Visto que o servi\u00e7o de &#8220;<strong>shutdown<\/strong>&#8221; do Tomcat em alguns momentos n\u00e3o responde, principalmente, quando se inicia e tenta parar no mesmo instante, foi incrementado um &#8220;<strong>kill<\/strong>&#8221; sobre o processo do Tomcat, para caso o &#8220;<strong>shutdown<\/strong>&#8221; falhe. Este procedimento consiste em capturar o <strong>PID<\/strong> &#8220;vari\u00e1vel &#039;a&#039; &#8220;, e executar um &#8220;<strong>kill<\/strong>&#8221; sobre o mesmo.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style =\"color:#687f8c;  font-family: sans-serif;\"><span style=\"font-size: 14px; line-height: 22.4px;\">D &#8211;\u00a0Procedimento para captura e exibi\u00e7\u00e3o do status do servi\u00e7o:<\/span><\/span><\/p>\n<ul style=\"text-align: justify;\">\n <strong>C\u00f3digo:<\/strong><\/li>\n<\/ul>\n<pre class=\"wp-block-code-block-pro\"><pre class=\"EnlighterJSRAW\">status(){\necho &quot;&quot;\necho -e &quot;\\033[1;50m STATUS SERVICO TOMCAT OOBJ: \\033[0m&quot;\necho &quot;&quot;\nSTATE=0\nSTATE=&lt;code&gt;{{EJS3}}&lt;\/code&gt;\necho -e &quot;Servico : \\033[1;29m + TOMCAT + \\033[0m&quot;\nif [ &quot;$STATE&quot; -ge &quot;1&quot; ] ; then\necho -e &quot; + STATUS: \\033[1;32m Rodando \\033[0m&quot;\nelse\necho -e &quot; + STATUS: \\033[1;31m Inativo \\033[0m&quot;\nfi\necho &quot;&quot;\na=&lt;code&gt;{{EJS4}}&lt;\/code&gt;\necho -e &quot; + PID: \\033[1;31m $a \\033[0m&quot;\necho &quot;&quot;\n}<\/pre><\/pre>\n<p style=\"text-align: justify;\"><strong><span style=\"font-family: sans-serif;\"><span style=\"font-size: 14px; line-height: 22.4px;\">\u00a0<\/span><\/span><\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><strong><span style=\"font-family: sans-serif;\"><span style=\"font-size: 14px; line-height: 22.4px;\"><span style=\"font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: #ffffff;\">Exibe-se a mensagem &#8220;<strong>STATUS SERVICO TOMCAT OOBJ<\/strong><\/span><\/span><\/span><\/strong><strong><span style=\"font-family: sans-serif;\"><span style=\"font-size: 14px; line-height: 22.4px;\"><span style=\"font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: #ffffff;\">&#8220;, que pode ser modificada como desejar. A vari\u00e1vel &#8220;<strong>STATE<\/strong>&#8221; recebe o valor &#8220;<strong>0<\/strong>&#8221; (zero), e faz uma busca pelo servi\u00e7o. Se o servi\u00e7o estiver ativo, recebe o valor &#8220;<strong>1<\/strong>&#8221; (um) e uma condicional verifica se o valor armazenado \u00e9 <strong>1<\/strong>, caso seja, exibe que o servi\u00e7o est\u00e1 &#8220;rodando&#8221;, caso seja <strong>0<\/strong>, exibe a mensagem &#8220;inativo&#8221;. Tamb\u00e9m foi incrementado a escrita do PID do tomcat junto com o status, com a vis\u00e3o de facilitar a identifica\u00e7\u00e3o e monitoramento via &#8220;<strong>top<\/strong>&#8220;.<\/span><\/span><\/span><\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">E &#8211;\u00a0Captura de comandos dos usu\u00e1rios e execu\u00e7\u00e3o das a\u00e7\u00f5es:<\/span><\/p>\n<ul style=\"list-style-type: disc;\">\n <strong>C\u00f3digo:<\/span><\/strong><\/li>\n<\/ul>\n<pre class=\"wp-block-code-block-pro\"><pre class=\"EnlighterJSRAW\">#acoes executadas de acordo com parametros passados via console\ncase &quot;$1&quot; in\nstart)\nstart\n;;\nstop)\nstop\n;;\nrestart)\nstop\nsleep 10\nstart\n;;\nstatus)\nstatus\n;;\n*)\necho &quot;Usage: {start|stop|restart|status}&quot;\nesac<\/pre><\/pre>\n<p style=\"text-align: justify;\">\u00a0<\/span><\/p>\n<p style=\"margin: 0.5em 0px; line-height: 22.4px; color: #252525; font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;\">No final do script, h\u00e1 um &#8220;case&#8221; que captura o comando digitado, e seleciona a a\u00e7\u00e3o a ser executada.<\/span><\/p>\n<ul style=\"line-height: 1.5em; list-style-type: disc; margin: 0.3em 0px 0px 1.6em; padding: 0px; list-style-image: url(data:image\/png; base64,ivborw0kggoaaaansuheugaaaauaaaanaqmaaabb8jblaaaablbmvex\/\/\/8auow5qsojaaaaaxrstlmaqobyzgaaabnjrefucb1jyeabbqw\/wlcagqeagpidyt0ivcsaaaaasuvork5cyii=); color: #252525; font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;\">\n<li style=\"margin-bottom: 0.1em;\"><strong>start<\/strong>: chama o procedimento de inicializa\u00e7\u00e3o;<\/li>\n<li style=\"margin-bottom: 0.1em;\"><strong>stop<\/strong>: chama o procedimento de parada;<\/li>\n<li style=\"margin-bottom: 0.1em;\"><strong>restart<\/strong>: chama o &#8220;stop&#8221;, aguarda 10 segundos e chama o &#8220;start&#8221;<\/li>\n<li style=\"margin-bottom: 0.1em;\"><strong>status<\/strong>: chama o procedimento de status<\/li>\n<li style=\"margin-bottom: 0.1em;\">E caso n\u00e3o seja digitado um comando, \u00e9 exibido o &#8220;<strong>usage<\/strong>&#8221; com as op\u00e7\u00f5es de uso do script.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">F &#8211;<\/span> Script completo:<\/span><\/p>\n<pre class=\"wp-block-code-block-pro\"><pre class=\"EnlighterJSRAW\">#!\/bin\/bash\n# chkconfig: 234 20 80\n# description: Tomcat Server basic start\/shutdown script\n# processname: tomcat\n#Caso utilize um java diferente do do SO, informar caminho aqui, e exportar a variavel\n#JAVA_HOME = \/opt\/jre\/\n#export JAVA_HOME\n#Define diretorio do tomcat e scripts de inicio e parada\nTOMCAT_HOME=\/opt\/oobj\/aplicativos\/tomcat\nSTART_TOMCAT=$TOMCAT_HOME\/bin\/startup.sh\nSTOP_TOMCAT=$TOMCAT_HOME\/bin\/shutdown.sh\nstart() {\na=&lt;code&gt;{{EJS5}}&lt;\/code&gt;\nif [ -n &quot;$a&quot; ]; then\necho -e &quot; \\033[1;32m Servi\u00e7o ja em execucao \\033[0m&quot;\nelse\necho -n &quot;Starting tomcat: &quot;\ncd $TOMCAT_HOME\n${START_TOMCAT}\necho &quot;done.&quot;\nfi\n}\nstop() {\necho -n &quot;Shutting down tomcat: &quot;\ncd $TOMCAT_HOME\n${STOP_TOMCAT}\na=&lt;code&gt;{{EJS6}}&lt;\/code&gt;\n&lt;code&gt;{{EJS7}}&lt;\/code&gt;\necho -e &quot; \\033[1;31m kill PID $a \\033[0m&quot;\n}\nstatus(){\necho &quot;&quot;\necho -e &quot;\\033[1;50m STATUS SERVIOS TOMCAT OOBJ: \\033[0m&quot;\necho &quot;&quot;\nSTATE=0\nSTATE=&lt;code&gt;{{EJS8}}&lt;\/code&gt;\necho -e &quot;Servico : \\033[1;29m + TOMCAT + \\033[0m&quot;\nif [ &quot;$STATE&quot; -ge &quot;1&quot; ] ; then\necho -e &quot; + STATUS: \\033[1;32m Rodando \\033[0m&quot;\nelse\necho -e &quot; + STATUS: \\033[1;31m Inativo \\033[0m&quot;\nfi\necho &quot;&quot;\na=&lt;code&gt;{{EJS9}}&lt;\/code&gt;\necho -e &quot; + PID: \\033[1;31m $a \\033[0m&quot;<\/pre><\/pre>\n<hr \/>\n<p style=\"text-align: justify;\"><strong>3 &#8211; Configura\u00e7\u00e3o do Script:<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">Por fim, para se configurar o script \u00e9 utilizado o comando \u201c<strong>chkconfig<\/strong>\u201d. O procedimento \u00e9 o seguinte:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 22.4px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important; background-color: #ffffff;\">1. Criar link simb\u00f3lico (atalho) na pasta &#8220;\/etc\/init.d\/&#8221; com o nome <strong>tomcat<\/strong>:<\/span><\/span><\/p>\n<p style=\"text-align: justify; padding-left: 30px;\"><strong>Comando:\u00a0<\/strong><em>ln -s \/opt\/oobj\/aplicativos\/tomcat\/bin\/tomcat \/etc\/init.d\/tomcat<\/em><\/span><\/p>\n<p style=\"text-align: justify;\">Obs.: Onde &#8220;\/opt\/oobj\/aplicativos\/tomcat\/bin\/tomcat&#8221; \u00e9 o caminho onde est\u00e1 o arquivo \u201ctomcat\u201d.<\/span><\/p>\n<p style=\"text-align: justify;\">2. Configurar permiss\u00e3o e adicionar a configura\u00e7\u00e3o ao S.O.:<\/span><\/p>\n<pre class=\"wp-block-code-block-pro\"><pre class=\"EnlighterJSRAW\">chmod 755 \/etc\/init.d\/tomcat\nchkconfig --add tomcat\nchkconfig --level 234 tomcat on<\/pre><\/pre>\n<p style=\"text-align: justify;\">Pronto, feito isto o script j\u00e1 est\u00e1 configurado para ser utilizado como servi\u00e7o no linux e com todos os comandos necess\u00e1rio para facilitar sua utiliza\u00e7\u00e3o.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-size: large; color: #3366ff;\">Refer\u00eancia<\/span><\/p>\n<p style=\"text-align: justify;\">Sem refer\u00eancias.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"Problema Como configurar o Tomcat como servi\u00e7o no Linux? Solu\u00e7\u00e3o\/Procedimento Para\u00a0facilitar a utiliza\u00e7\u00e3o do Tomcat no Linux, \u00e9 poss\u00edvel criar&hellip;","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ub_ctt_via":"","footnotes":""},"categories":[143],"tags":[202],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-dicas-e-ferramentas","tag-nao-revisado"],"acf":[],"featured_image_src":null,"author_info":{"display_name":"Malu Duarte","author_link":"https:\/\/oobj.com.br\/bc\/author\/malu-duarte\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Como configurar o Tomcat como servi\u00e7o no Linux? - Base de Conhecimento - Oobj<\/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:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Como configurar o Tomcat como servi\u00e7o no Linux? - Base de Conhecimento - Oobj\" \/>\n<meta property=\"og:description\" content=\"Problema Como configurar o Tomcat como servi\u00e7o no Linux? Solu\u00e7\u00e3o\/Procedimento Para\u00a0facilitar a utiliza\u00e7\u00e3o do Tomcat no Linux, \u00e9 poss\u00edvel criar&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Base de Conhecimento - Oobj\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/oobjti\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-19T15:12:01+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG\" \/>\n<meta name=\"author\" content=\"Malu Duarte\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Malu Duarte\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/\"},\"author\":{\"name\":\"Malu Duarte\",\"@id\":\"https:\/\/oobj.com.br\/bc\/#\/schema\/person\/d5b05a7bbe2be07843923019324402ad\"},\"headline\":\"Como configurar o Tomcat como servi\u00e7o no Linux?\",\"datePublished\":\"2024-09-19T15:12:01+00:00\",\"dateModified\":\"2024-09-19T15:12:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/\"},\"wordCount\":797,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/#organization\"},\"image\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG\",\"keywords\":[\"nao revisado\"],\"articleSection\":[\"Dicas e ferramentas\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/\",\"url\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/\",\"name\":\"Como configurar o Tomcat como servi\u00e7o no Linux? - Base de Conhecimento - Oobj\",\"isPartOf\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG\",\"datePublished\":\"2024-09-19T15:12:01+00:00\",\"dateModified\":\"2024-09-19T15:12:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage\",\"url\":\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG\",\"contentUrl\":\"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/oobj.com.br\/bc\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Como configurar o Tomcat como servi\u00e7o no Linux?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/oobj.com.br\/bc\/#website\",\"url\":\"https:\/\/oobj.com.br\/bc\/\",\"name\":\"Base de Conhecimento - Oobj\",\"description\":\"Aprenda tudo sobre nossas solu\u00e7\u00f5es, desde o que significa um \u00edcone na tela at\u00e9 como completar uma tarefa.\",\"publisher\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/oobj.com.br\/bc\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/oobj.com.br\/bc\/#organization\",\"name\":\"Oobj Tecnologia da Informa\u00e7\u00e3o\",\"url\":\"https:\/\/oobj.com.br\/bc\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/oobj.com.br\/bc\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/2024\/10\/logo.png\",\"contentUrl\":\"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/2024\/10\/logo.png\",\"width\":512,\"height\":168,\"caption\":\"Oobj Tecnologia da Informa\u00e7\u00e3o\"},\"image\":{\"@id\":\"https:\/\/oobj.com.br\/bc\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/oobjti\",\"https:\/\/www.instagram.com\/oobjti\",\"https:\/\/www.linkedin.com\/company\/oobjti\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/oobj.com.br\/bc\/#\/schema\/person\/d5b05a7bbe2be07843923019324402ad\",\"name\":\"Malu Duarte\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/oobj.com.br\/bc\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/nsl_avatars\/454927dc8b9b69d69aaf0b3bee9c909b.png\",\"contentUrl\":\"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/nsl_avatars\/454927dc8b9b69d69aaf0b3bee9c909b.png\",\"caption\":\"Malu Duarte\"},\"url\":\"https:\/\/oobj.com.br\/bc\/author\/malu-duarte\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Como configurar o Tomcat como servi\u00e7o no Linux? - Base de Conhecimento - Oobj","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:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/","og_locale":"pt_BR","og_type":"article","og_title":"Como configurar o Tomcat como servi\u00e7o no Linux? - Base de Conhecimento - Oobj","og_description":"Problema Como configurar o Tomcat como servi\u00e7o no Linux? Solu\u00e7\u00e3o\/Procedimento Para\u00a0facilitar a utiliza\u00e7\u00e3o do Tomcat no Linux, \u00e9 poss\u00edvel criar&hellip;","og_url":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/","og_site_name":"Base de Conhecimento - Oobj","article_publisher":"https:\/\/www.facebook.com\/oobjti","article_published_time":"2024-09-19T15:12:01+00:00","og_image":[{"url":"http:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG"}],"author":"Malu Duarte","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Malu Duarte","Est. tempo de leitura":"6 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#article","isPartOf":{"@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/"},"author":{"name":"Malu Duarte","@id":"https:\/\/oobj.com.br\/bc\/#\/schema\/person\/d5b05a7bbe2be07843923019324402ad"},"headline":"Como configurar o Tomcat como servi\u00e7o no Linux?","datePublished":"2024-09-19T15:12:01+00:00","dateModified":"2024-09-19T15:12:01+00:00","mainEntityOfPage":{"@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/"},"wordCount":797,"commentCount":0,"publisher":{"@id":"https:\/\/oobj.com.br\/bc\/#organization"},"image":{"@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG","keywords":["nao revisado"],"articleSection":["Dicas e ferramentas"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/","url":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/","name":"Como configurar o Tomcat como servi\u00e7o no Linux? - Base de Conhecimento - Oobj","isPartOf":{"@id":"https:\/\/oobj.com.br\/bc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage"},"image":{"@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG","datePublished":"2024-09-19T15:12:01+00:00","dateModified":"2024-09-19T15:12:01+00:00","breadcrumb":{"@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#primaryimage","url":"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG","contentUrl":"https:\/\/www.oobj.com.br\/bc\/assets\/Articles\/300\/Wiki-service_tomcat.PNG"},{"@type":"BreadcrumbList","@id":"https:\/\/oobj.com.br\/bc\/configurar-tomcat-como-servico-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/oobj.com.br\/bc\/"},{"@type":"ListItem","position":2,"name":"Como configurar o Tomcat como servi\u00e7o no Linux?"}]},{"@type":"WebSite","@id":"https:\/\/oobj.com.br\/bc\/#website","url":"https:\/\/oobj.com.br\/bc\/","name":"Base de Conhecimento - Oobj","description":"Aprenda tudo sobre nossas solu\u00e7\u00f5es, desde o que significa um \u00edcone na tela at\u00e9 como completar uma tarefa.","publisher":{"@id":"https:\/\/oobj.com.br\/bc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/oobj.com.br\/bc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/oobj.com.br\/bc\/#organization","name":"Oobj Tecnologia da Informa\u00e7\u00e3o","url":"https:\/\/oobj.com.br\/bc\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/oobj.com.br\/bc\/#\/schema\/logo\/image\/","url":"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/2024\/10\/logo.png","contentUrl":"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/2024\/10\/logo.png","width":512,"height":168,"caption":"Oobj Tecnologia da Informa\u00e7\u00e3o"},"image":{"@id":"https:\/\/oobj.com.br\/bc\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/oobjti","https:\/\/www.instagram.com\/oobjti","https:\/\/www.linkedin.com\/company\/oobjti\/"]},{"@type":"Person","@id":"https:\/\/oobj.com.br\/bc\/#\/schema\/person\/d5b05a7bbe2be07843923019324402ad","name":"Malu Duarte","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/oobj.com.br\/bc\/#\/schema\/person\/image\/","url":"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/nsl_avatars\/454927dc8b9b69d69aaf0b3bee9c909b.png","contentUrl":"https:\/\/oobj.com.br\/bc\/wp-content\/uploads\/nsl_avatars\/454927dc8b9b69d69aaf0b3bee9c909b.png","caption":"Malu Duarte"},"url":"https:\/\/oobj.com.br\/bc\/author\/malu-duarte\/"}]}},"_links":{"self":[{"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/posts\/569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/comments?post=569"}],"version-history":[{"count":0,"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"wp:attachment":[{"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oobj.com.br\/bc\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}