Java 你怎么知道你的PC上是否安装了Tomcat服务器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19302273/
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-12 15:52:24  来源:igfitidea点击:

How do you know if Tomcat Server is installed on your PC

javawindowstomcatjasperserver

提问by CodeNinja

I am using Windows 7 OS. I just installed jaspersoft server which installed Apache Tomcat and mysql as a bundle along with it.

我正在使用 Windows 7 操作系统。我刚刚安装了 jaspersoft 服务器,它安装了 Apache Tomcat 和 mysql 作为一个捆绑包。

I go to http://localhost:8080and theres a message that says webpage is not available.

我去 http://localhost:8080,那里有一条消息,说网页不可用。

I am a beginner, and I would like to know if Tomcat is first installed on my computer. Can you tell me how I can do that ? ( I would also like to know if it has to be started and on what port it was installed.)

我是初学者,我想知道我的电脑上是否先安装了Tomcat。你能告诉我怎么做吗?(我还想知道它是否必须启动以及安装在哪个端口上。)

UPDATE

更新

Heres something I did . i am really confused now . I found the location of the tomcat server. I found the server.xml file. The port in the server.xml file was listed as 8005. I also found start.bat which I ran. I now see that http://localhost:8080works but http://localhost:8005doesnt . Would you know why ?? The port 8005 should work because thats what was listed in the server.xml

这是我做的。我现在真的很困惑。我找到了tomcat服务器的位置。我找到了 server.xml 文件。server.xml 文件中的端口被列为 8005。我还找到了我运行的 start.bat。我现在看到这http://localhost:8080有效,但http://localhost:8005没有。你知道为什么吗??端口 8005 应该可以工作,因为这是 server.xml 中列出的

采纳答案by Christian Kuetbach

The port 8005 is used as service port. You can send a shutdown command (a configurable password)to that port. It will not "speak" HTTP, so you cannot use your browser to connect.

端口 8005 用作服务端口。您可以向该端口发送关闭命令(可配置的密码)。它不会“说”HTTP,因此您无法使用浏览器进行连接。

The default port for delivering web-content is 8080.

用于传送 Web 内容的默认端口是 8080。

But there may be other applications listen to that port. So your tomcat may not start, if the port is not available.

但是可能有其他应用程序侦听该端口。因此,如果端口不可用,您的 tomcat 可能无法启动。

You asked "How do you know, if tomcat server is installed on your PC?". The answer to that question is: You can't

您问“您怎么知道您的 PC 上是否安装了 tomcat 服务器?”。这个问题的答案是:你不能

You can't determine, if it is installed, because it may be only extracted from a ZIP archive or packaged within another application (Like JBoss AS (I think)).

您无法确定它是否已安装,因为它可能只能从 ZIP 存档中提取或打包在另一个应用程序中(例如 JBoss AS(我认为))。

回答by user2821894

In order to make

为了要做

     http://localhost:8080

work, tomcat has to be started first. You can check server.xml file in conf folder for the port information. You can search if tomcat is installed on your machine. Just go to start and then type tomcat. If it is installed it will give you the directory where it is installed. Then you can select that path and run it from command prompt. Example if tomcat is installed in C:\Programfile\tomcat. You need to set this path in command prompt,go to bin folder and startup. Example: C:\Programfile\tomcat\bin\startup. Else you can also run it by directly going to the path and run startup batch file.

工作,必须先启动tomcat。您可以检查 conf 文件夹中的 server.xml 文件以获取端口信息。您可以搜索您的机器上是否安装了 tomcat。只需转到开始,然后键入 tomcat。如果已安装,它将为您提供安装目录。然后您可以选择该路径并从命令提示符运行它。例如,如果 tomcat 安装在 C:\Programfile\tomcat 中。您需要在命令提示符中设置此路径,转到 bin 文件夹并启动。示例:C:\Programfile\tomcat\bin\startup。否则,您也可以直接转到路径并运行启动批处理文件来运行它。

回答by user2821894

In case of Windows(in my case XP):-

如果是 Windows(在我的情况下是 XP):-

  1. Check the directory where tomcat is installed.
  2. Open the directory called \conf in it.
  3. Then search file server.xml
  4. Open that file and check what is the connector port for HTTP,whre you will found something like 8009,8080 etc.
  5. Suppose it found 8009,use that port as "/localhost:8009/" in your web-browser with HTTP protocol. Hope this will work !
  1. 检查tomcat的安装目录。
  2. 在其中打开名为 \conf 的目录。
  3. 然后搜索文件 server.xml
  4. 打开该文件并检查 HTTP 的连接器端口是什么,您会发现诸如 8009、8080 之类的内容。
  5. 假设它找到了 8009,使用 HTTP 协议在您的 Web 浏览器中将该端口用作“/localhost:8009/”。希望这会奏效!

回答by Sharad

You can check in windows services if tomcat is installed it will be listed in windows services.

如果安装了 tomcat,您可以检查 windows 服务,它将在 windows 服务中列出。

To check the windows service list of services installed on windows machine use

要检查安装在 Windows 机器上的服务的 Windows 服务列表,请使用

  WINDOWS KEY + R   and type services.msc

There you can find all the services related with Jasperreport server like Tomcat and MySQL with name starting Jasperreport server Tomcat and MySQL only if these services are installed and its need to be started by selecting the option.Then you can access it through browser using this link :-

在那里你可以找到所有与 Jasperreport 服务器相关的服务,比如 Tomcat 和 MySQL,名称以 Jasperreport server Tomcat 和 MySQL 开头,前提是这些服务已经安装并且需要通过选择选项启动。然后你可以使用这个链接通过浏览器访问它:-

   http://localhost:8080

default port for tomcat is 8080.

tomcat 的默认端口是 8080。

回答by atjua

Open your windows search bar, and search for the keyword Tomcat. If a shortcut file is found instead, you can open the source file location of the shortcut by right-clicking the shortcut file and selecting the Properties.

打开 Windows 搜索栏,然后搜索关键字Tomcat。如果找到快捷方式文件,您可以通过右键单击快捷方式文件并选择“属性”来打开快捷方式的源文件位置。

回答by Imranmadbar

For linux ubuntu 18.04:

对于 linux ubuntu 18.04:

Go to terminal and command:$ sudo systemctl status tomcat