<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Tomcat 5.5 server.xml 配置的一些問題

    Posted on 2008-05-07 13:02 xan 閱讀(1346) 評論(0)  編輯  收藏 所屬分類: Java
    • Host Name:
    Network name of this virtual host, as registered in your Domain Name Service server.
    Exactly one of the Hosts associated with each Engine MUST have a name matching the defaultHost attribute of that Engine.

    • Host Name Alias:
    in some circumstances, it is desireable that two or more network names should resolve to the same virtual host.
    <Host name="www.mycompany.com" ...>
        ...
        <Alias>mycompany.com</Alias>
        ...
    </Host>
    In order for this strategy to be effective, all of the network names involved must be registered
    • host appBase:
    The Application Base directory for this virtual host. This is the pathname of a directory that may contain web applications to be deployed on this virtual host.
    You may specify an absolute pathname for this directory, or a pathname that is relative to the $CATALINA_BASE directory.
    appBase="webapps" is the default value.

    • host context:
    You can nest one or more Context elements inside this Host element, each representing a different web application associated with this virtual host.

    • context docBase:
    The Document Base (also known as the Context Root) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host.
    If a symbolic link is used for docBase then changes to the symbolic link will only be effective after a Tomcat restart or by undeploying and redeploying the conext. A context reload is not sufficient.
    Do not choose a docBase that starts with your Host's appBase string. The default appBase is "webapps" so do not choose a docBase like "webapps-foo." Doing so will lead to deployment errors: see Bugzilla for details.
    The value of this field must not be set when the Context is configured using a META-INF/context.xml file as it will be inferred by the automatic deployment process.

    • context path:
    The context path of this web application, which is matched against the beginning of each request URI to select the appropriate web application for processing.
    All of the context paths within a particular Host must be unique. If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts.


    問題: 為什么我可以使用http://www.mysite.com:8080/ 去訪問Test Project,  而使用
    http://localhost:8080/ 卻不能,需使用http://localhost:8080/Test_Project訪問

    C:\WINDOWS\system32\drivers\etc\hosts
    127.0.0.1       localhost
    127.0.0.1        www.mysite.com

    這個問題是“直接使用
    http://localhost 或 http://www.mysite.com/ 訪問開發的項目, 為了達到這一目的,有以下途徑:
    途徑1:
        設置 context path=“” ,如
    <Context docBase="Test Project" path="" reloadable="true" crossContext="true" source="org.eclipse.jst.j2ee.server:Test Project"/></Host>
    但是這有一個問題
    使用eclipse servers 新建一個server,產生配置文件
    D:\WorkSpace\MY_DEV\Servers\Tomcat v5.5 Server @localhost-config\server.xml, 修改該自動生成的文件
    啟動server后,這些配置文件將被發布到tomcat webapps的同級目錄conf下,而且在發布時server.xml的內容為eclipse自動生成的內容用戶的修改被拋棄。所以為了達到
    “直接使用http://localhost 或 http://www.mysite.com/ 訪問開發的項目這一目標,有兩種方法:
    方法一:
        直接修改tomcat conf目錄下的server.xml文件。

    方法二:
        在eclipse中,在自動生成的server.xml基礎上添加一個host
        <Host appBase="webapps" autoDeploy="true" name="www.mysite.com" unpackWARs="true">
            <Context docBase="Test Project" path="" reloadable="true" source="org.eclipse.jst.j2ee.server:
    Test Project"/>
        </Host>
    該修改在"關閉,再啟動"(直接重啟不行)server后,能被更新到tomcat conf下面的server.xml
    在項目發布中,最終生效的是tomcat conf下的server.xml


    途徑2:來自
    http://blog.csdn.net/miqi770/archive/2008/02/20/2109805.aspx,未嘗試

    使用eclipse發布xm到tomcat
     把ROOT目錄刪掉,把xm重命名ROOT
     使用http://localhost時,可以直接訪問自己開發的項目


    posts - 36, comments - 2, trackbacks - 0, articles - 0

    Copyright © xan

    主站蜘蛛池模板: 免费观看的毛片手机视频| 无码国产精品一区二区免费式影视 | 亚洲一区二区三区高清视频| 国内精品免费在线观看| 亚洲国产精品无码久久久秋霞2| 色www永久免费| 亚洲精品~无码抽插| 久久免费福利视频| 亚洲高清资源在线观看| 亚州免费一级毛片| 亚洲午夜无码久久久久小说| 成年女人免费碰碰视频| 国产尤物在线视精品在亚洲| 亚洲国产精品无码久久久久久曰 | 一区二区三区观看免费中文视频在线播放 | 一级特级aaaa毛片免费观看| 国产亚洲精久久久久久无码| 蜜桃视频在线观看免费视频网站WWW| 亚洲色图在线观看| 在线免费观看视频你懂的| 免费的黄网站男人的天堂| 日韩一卡2卡3卡4卡新区亚洲| 日韩在线永久免费播放| 最新亚洲精品国偷自产在线| 国产免费变态视频网址网站| 久久久久久久国产免费看| 亚洲色av性色在线观无码| 在线视频免费国产成人| 中文字幕在线免费视频| 亚洲另类小说图片| 亚洲日本在线观看视频| 最近免费中文在线视频| 国产亚洲女在线线精品| 久久精品国产亚洲AV麻豆不卡| 69视频免费观看l| 免费一级毛片在线播放放视频| 亚洲国产成人久久综合碰碰动漫3d| 可以免费看的卡一卡二| fc2成年免费共享视频网站| 亚洲一区二区三区精品视频| 国产日产亚洲系列最新|