我已经复印了样品。在Tomcat的webapps目录下,我可以访问localhost:8080。
Tomcat如何部署,需要在浏览器中打开吗?如何访问该应用程序?
我已经复印了样品。在Tomcat的webapps目录下,我可以访问localhost:8080。
Tomcat如何部署,需要在浏览器中打开吗?如何访问该应用程序?
当前回答
1.从应用程序生成war文件 2. 打开tomcat管理器,进入页面 3.单击browse部署战争。 4. 选择你的战争文件。 好了!
其他回答
请执行以下步骤:
停止Tomcat 右键点击项目,点击“清洁和构建” 转到你的项目目录和Dist文件夹内,你会得到你复制到tomcat上的war文件 webApp目录 启动tomcat 自动战争文件提取和运行您的项目
有两种方法:
您可以进行热部署(热部署意味着在服务器运行/启动时进行部署)。 或者您可以进行冷部署(冷部署意味着在服务器停止时进行部署)。
只需使用tomcat管理控制台进行控制台部署,或者简单地复制并粘贴应用程序到服务器tomcat_home目录的webapp文件夹中。
注意:如果您的war文件大小超过52 MB(默认配置值), 你需要在你的webapp文件夹的Manager应用程序的web.xml文件中做两个小的修改(在安装服务器时,默认由Apache tomcat提供Manager应用程序)。
Go to the web.xml of the manager application (for instance it could be under /tomcat7/webapps/manager/WEB-INF/web.xml. Increase the max-file-size and max-request-size values in web.xml file: <multipart-config> <!– 50MB max –> <max-file-size>52428800</max-file-size> <max-request-size>52428800</max-request-size> <file-size-threshold>0</file-size-threshold> </multipart-config> Increase the size by putting the values for <max-file-size> and <max-request-size> according to your requirement.
1.从应用程序生成war文件 2. 打开tomcat管理器,进入页面 3.单击browse部署战争。 4. 选择你的战争文件。 好了!
为了在tomcat上部署war文件, 请遵循以下步骤:
停止tomcat。powershell - >服务。msc->OK->Apache Tomcat 8.5->stop(在左侧)。
把。war文件放在E:\Tomcat_Installation\webapps文件夹中,也就是Put。战争(。战争只是一个例子)
启动tomcat后(启动tomcat powershell->服务)。msc - >确定- > Apache Tomcat 8.5 - >开始)
你会在E:\Tomcat_Installation\webapps**put**中得到一个文件夹
通过这种方式,您可以在Apache Tomcat中部署war文件。
手动步骤- Windows
复制.war文件(例如:prj.war)到%CATALINA_HOME%\webapps(例如:C:\tomcat\webapps) 运行% CATALINA_HOME % \ bin \ startup.bat 您的.war文件将自动提取到具有相同名称(没有扩展名)的文件夹(例如:prj) 转到%CATALINA_HOME%\conf\server.xml,并获取HTTP协议的端口。<连接器端口="8080"…/ >。缺省值为8080。 访问以下网址: (<协议>:/ / localhost: <端口> /文件夹/ resourceName (例如:localhost: 8080 /文件夹/ resourceName)
不要尝试访问没有资源名的URL,因为如果没有像index.html这样的文件,或者如果在web.xml中没有像“/”或“/*”这样的URL模式,它将不起作用。
可用的主路径在这里:[<protocol>://]localhost:<port>/manager/html(例如:http://localhost:8080/manager/html),它们在“Running”列上有true。
使用UI管理器:
Go to [<protocol>://]localhost:<port>/manager/html/ (usually localhost:8080/manager/html/) This is also achievable from [<protocol>://]localhost:<port> > Manager App) If you get: 403 Access Denied go to %CATALINA_HOME%\conf\tomcat-users.xml and check that you have enabled a line like this: <user username="tomcat" password="tomcat" roles="tomcat,role1,manager-gui"/> In the Deploy section, WAR file to deploy subsection, click on Browse.... Select the .war file (E.g.: prj.war) > click on Deploy. In the Applications section, you can see the name of your project (E.g.: prj).