簡體   English   中英

如何在沒有IDE的情況下在Tomcat上部署Restful

[英]how to deploy Restful on Tomcat without IDE

我使用Eclipse Maven Tomcat7制作了Restful WS,現在有一個在線server UbuntuTomcat7裝有Tomcat7 我需要知道的是如何在沒有EclipseMaven情況下部署Restful

您可以使用瀏覽器中的管理器應用程序將war文件部署到正在運行的Tomcat實例。 這是URL: http://your.server.intranet:8080/manager/html (或localhost:8080 )。

配置文件$CATALINA_BASE/conf/tomcat-users.xml包含管理員用戶和管理員角色。 請參閱Configuration_Manager_Application_Access

例:

<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
    <role rolename="manager-gui" />
    <role rolename="manager-script" />
    <role rolename="manager-jmx" />
    <role rolename="manager-status" />

    <user username="admin" password="whoknows" roles="manager-gui" />
    <user username="adminScript" password="topsecret" roles="manager-script" />
</tomcat-users>

假設您的tomcat7安裝目錄為~/Document/tomcat7並且您想部署MyRestful.war

  1. MyRestful.war復制到目錄~/Document/tomcat7/webapps
  2. 查看文件~/Document/tomcat7/conf/server.xml並找到以下行
<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

通常端口號是8080但值得仔細檢查。

  1. 現在,您可以通過訪問

http://your.server.url:8080/MyRestful/replace-with-your-rest-api

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM