Linux java安装tomcat作为服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6030725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 04:07:21  来源:igfitidea点击:

java install tomcat as service

javalinuxtomcatservice

提问by Mehraban

I'm planning to develop an application installer which, as a part of installation, installs Apache Tomcat on Linux. Does anyone know how can I programmatically install Tomcat as service on Linux. Best

我计划开发一个应用程序安装程序,作为安装的一部分,在 Linux 上安装 Apache Tomcat。有谁知道如何在 Linux 上以编程方式安装 Tomcat 作为服务。最好的事物

回答by Ed Manet

If you have Tomcat installed already, you probably need to put a start up script for Tomcat in /etc/init.d

如果你已经安装了 Tomcat,你可能需要在 /etc/init.d 中放置一个 Tomcat 的启动脚本

This article has a decent start up script.

这篇文章有一个不错的启动脚本。

http://www.howtogeek.com/howto/linux/installing-tomcat-6-on-ubuntu/

http://www.howtogeek.com/howto/linux/installing-tomcat-6-on-ubuntu/

回答by Cédric Julien

If you are on a debian-base distribution, just type

如果您使用的是基于 debian 的发行版,只需键入

sudo apt-get install tomcat6 tomcat6-admin tomcat6-examples

and you'll have a tomcat fully functional (example for Ubuntu 10.04)

并且您将拥有一个功能齐全的 tomcat(例如 Ubuntu 10.04

回答by Habeeb Perwad

Tomcat7 (Stable release 2011 January) For Debian-base:Tested in Ubuntu 14.04.

Tomcat7(2011 年 1 月稳定版)对于基于 Debian 的:在 Ubuntu 14.04 中测试。

Install Tomcat7:

安装Tomcat7:

sudo apt-get install tomcat7 tomcat7-docs tomcat7-admin 
sudo apt-get install libtomcat7-java tomcat7-common tomcat7-examples

Start the tomcat server:

启动tomcat服务器:

sudo service tomcat7 restart

Check whether the the tomcat is running or not by access the URL http:/127.0.0.1:8080 in browser or in terminal:

通过在浏览器或终端中访问 URL http://127.0.0.1:8080 来检查 tomcat 是否正在运行:

w3m http://127.0.0.1:8080

More...

更多的...