我已经复印了样品。在Tomcat的webapps目录下,我可以访问localhost:8080。
Tomcat如何部署,需要在浏览器中打开吗?如何访问该应用程序?
我已经复印了样品。在Tomcat的webapps目录下,我可以访问localhost:8080。
Tomcat如何部署,需要在浏览器中打开吗?如何访问该应用程序?
当前回答
1.从应用程序生成war文件 2. 打开tomcat管理器,进入页面 3.单击browse部署战争。 4. 选择你的战争文件。 好了!
其他回答
In addition to the ways already mentioned (dropping the war-file directly into the webapps-directory), if you have the Tomcat Manager -application installed, you can deploy war-files via browser too. To get to the manager, browse to the root of the server (in your case, localhost:8080), select "Tomcat Manager" (at this point, you need to know username and password for a Tomcat-user with "manager"-role, the users are defined in tomcat-users.xml in the conf-directory of the tomcat-installation). From the opening page, scroll downwards until you see the "Deploy"-part of the page, where you can click "browse" to select a WAR file to deploy from your local machine. After you've selected the file, click deploy. After a while the manager should inform you that the application has been deployed (and if everything went well, started).
以下是来自Tomcat 7文档页面的更长的操作说明和其他说明。
这对我来说很管用:
在本地创建war文件(mysite.war)。 在本地将它重命名为。war以外的东西,比如mysite.www 在tomcat仍然运行的情况下,上传mysite。WWW到webapps目录。 上传完成后,删除之前版本的mysite.war 列出目录,等待目录/mysite消失。 重命名mysite。WWW是神秘的。战争 列出目录,等待新的/mysite被创建。
如果在tomcat仍在运行的情况下,尝试将新文件作为war文件上传,它将尝试在所有文件就绪之前对其进行扩展。它会失败。既然失败了,它就不会再尝试了。因此,上传一个www文件,然后重命名它,允许在tomcat注意到它之前呈现整个war文件。
提示,不要忘记检查war文件的所有者是tomcat(使用chown)
你只需要把war文件放在webapps中,然后启动你的服务器。
它将被部署。
否则,你也可以使用tomcat管理器在webfront上远程上传和部署你的战争。
我按照下面链接的说明,它对我有用。 http://www.coderanch.com/t/487178/Tomcat/war-file-show-load
停止Tomcat 删除“tomcat/logs”目录下的所有日志和“tomcat/conf/Catalina/localhost”目录下的所有文件 从tomact/webapps中删除war文件和它创建的目录(如果有的话) 启动Tomcat 在查看日志时,再次将war文件复制到webapps目录
在此之后,请密切关注catalina.xxxx-xx-xx.log以找出问题。
应用程序名称进入tomcat部署URL的上下文中, 如。http://localhost applicationName。 如果您的应用程序名称很简单,那么它应该是http://localhost:8080/sample。
默认情况下,Port是8080,但是如果你想改变它,或者想知道tomcat运行的端口,只需到<tomcat-apache-dir>/conf/server.xml中的server.xml文件,在那里你可以找到Port和change。 如。<连接器端口="8080" redirectPort="8443" connectionTimeout="20000" protocol="HTTP/1.1"/>
如果出现任何错误,检查日志文件(例如<tomcat-apache-dir>/logs/catalina.out)