简体   繁体   English

无法打开“Tomcat Web应用程序管理器”

[英]Unable to open “Tomcat web application manager”

I am new to java web programming and eclipse-apache Tomcat. 我是java网络编程和eclipse-apache Tomcat的新手。 I have small login web-application which includes (one jsp page , one servlet class). 我有一个小的登录Web应用程序,其中包括(一个jsp页面,一个servlet类)。

I want to configure/deploy this application on apache web application manager. 我想在apache Web应用程序管理器上配置/部署此应用程序。 I mean I don't want to run this application in eclipse. 我的意思是我不想在Eclipse中运行此应用程序。 I hope you understand my point. 希望你明白我的意思。

Whenever I run my server in eclipse it run successfully. 每当我在eclipse中运行服务器时,它就会成功运行。 But when I want to open apache default page by typing http://localhost:8080 or http://localhost:8080 to configure my app It wouldn't open. 但是,当我想通过键入http:// localhost:8080http:// localhost:8080打开apache默认页面来配置我的应用程序它将无法打开。

Please advice me. 请指教。

To deploy a web application on Tomcat, you need to first compile your web application into a WAR file. 要在Tomcat上部署Web应用程序,首先需要将Web应用程序编译为WAR文件。 Then, take that WAR file (let's assume it's called "MyApp.WAR") and put that into the tomcat/webapps directory. 然后,获取该WAR文件(假设它被称为“MyApp.WAR”)并将其放入tomcat / webapps目录。 Restart the tomcat service. 重启tomcat服务。 Tomcat will extract that WAR to a folder in the webapps directory. Tomcat会将该WAR提取到webapps目录中的文件夹。 After that, any request to localhost:8080/MyApp will go to your webapp. 之后,对localhost:8080 / MyApp的任何请求都将转到您的webapp。

Make sure you have java installed, and add JAVA_HOME to your environment variable. 确保已安装Java,然后将JAVA_HOME添加到您的环境变量中。 (it is the path to java installation directory for eg C:\\Program Files\\java\\jdk-1.6) ie JAVA_HOME=C:\\Program Files\\java\\jdk-1.6 (它是java安装目录的路径,例如C:\\ Program Files \\ java \\ jdk-1.6)即JAVA_HOME=C:\\Program Files\\java\\jdk-1.6

install TOMCAT from here " http://tomcat.apache.org/download-70.cgi " make sure you do not install it in you "c:\\program files" due to some permission issues. 从这里安装TOMCAT“ http://tomcat.apache.org/download-70.cgi ”请确保由于某些权限问题而未将其安装在“c:\\ program files”中。

Lets say you installed tomcat at "c:\\webserver\\apache-tomcat\\" this is your CATALINA_HOME, add it to your environment variable ie CATALINA_HOME=c:\\webserver\\apache-tomcat\\ 假设您在“c:\\ webserver \\ apache-tomcat \\”安装了tomcat,这是您的CATALINA_HOME,将其添加到您的环境变量即CATALINA_HOME=c:\\webserver\\apache-tomcat\\

to acess tomcat webapp manager you need to configure user in %CATALINA_HOME%\\conf\\tomcat-users.xml Add a role and a user : 要访问tomcat Webapp管理器,您需要在%CATALINA_HOME%\\ conf \\ tomcat-users.xml中配置用户添加角色和用户:

Have your WAR file ready with you (this is how you create WAR " How to make war file in Eclipse ") 准备好您的WAR文件(这是创建WAR“ 如何在Eclipse中制作war文件 ”的方式)

move your WAR file to "%CATALINA_HOME%\\webapp" directory. 将您的WAR文件移动到“%CATALINA_HOME%\\ webapp”目录。 lets say "TestWeb.WAR" is your application with index.jsp page in it. 可以说“ TestWeb.WAR”是您的应用程序,其中包含index.jsp页面。

Now go to your %CALALINA_HOME%\\bin and launch the startup.bat file (you would be using startup.bat to start and shutdown.bat to stop tomcat) 现在转到你的%CALALINA_HOME%\\ bin并启动startup.bat文件(你将使用startup.bat启动和shutdown.bat来停止tomcat)

once tomcat is up and running check http://localhost:8080 is working fine. tomcat启动并运行后,检查http:// localhost:8080是否工作正常。 PS If port 80 is already in use then try configuring your tomcat to some other unused PORT here " http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/ " PS如果端口80已经在使用,那么尝试在这里将tomcat配置为其他未使用的PORT“ http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/

go to your browser type http://localhost:8080/TestWeb/index.jsp 转到浏览器,输入http:// localhost:8080 / TestWeb / index.jsp

now you can to lot of configuration to your web app like having a default page and all Hope this help you ! 现在,您可以对Web应用程序进行大量配置,例如拥有默认页面,并希望所有这些对您有所帮助!

Normally eclipse uses Tomcat as an eclipse project, hence it uses metadata. 通常,eclipse使用Tomcat作为eclipse项目,因此它使用元数据。

Server > Double click on the tomcat server instance > Server Location > Select "Use Tomcat installation" 服务器>双击tomcat服务器实例>服务器位置>选择“使用Tomcat安装”

在此输入图像描述

Update: Tested just now. 更新:刚刚测试。 Set Deploy path to webapps folder. Deploy path设置为webapps文件夹。 Works fine :) 工作正常 :)

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM