<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 閱讀(1353) 評(píng)論(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

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

    方法二:
        在eclipse中,在自動(dòng)生成的server.xml基礎(chǔ)上添加一個(gè)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>
    該修改在"關(guān)閉,再啟動(dòng)"(直接重啟不行)server后,能被更新到tomcat conf下面的server.xml
    在項(xiàng)目發(fā)布中,最終生效的是tomcat conf下的server.xml


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

    使用eclipse發(fā)布xm到tomcat
     把ROOT目錄刪掉,把xm重命名ROOT
     使用http://localhost時(shí),可以直接訪問自己開發(fā)的項(xiàng)目


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

    Copyright © xan

    主站蜘蛛池模板: 亚洲国产精品成人精品无码区| 日本免费观看网站| 久久夜色精品国产亚洲| 亚洲免费日韩无码系列| 亚洲乱码日产精品a级毛片久久| 日韩色日韩视频亚洲网站 | 最新国产成人亚洲精品影院| 8x8×在线永久免费视频| 亚洲视频在线一区二区三区| 亚洲精品免费在线视频| 亚洲国产综合精品中文第一| 成年女人男人免费视频播放| 老牛精品亚洲成av人片| 亚洲精品NV久久久久久久久久| A毛片毛片看免费| 久久91亚洲精品中文字幕| 最近免费中文字幕大全高清大全1 最近免费中文字幕mv在线电影 | 免费观看四虎精品成人| 伊人久久大香线蕉亚洲| 无码av免费网站| 中文字幕在线观看亚洲视频| 麻豆精品国产免费观看| 一级大黄美女免费播放| 亚洲av无码国产精品色午夜字幕 | 18国产精品白浆在线观看免费| 2020久久精品亚洲热综合一本| 国产免费av片在线无码免费看| 一进一出60分钟免费视频| 亚洲国产精品无码专区| 久久久www成人免费毛片| 免费国产在线精品一区| 亚洲视频在线播放| 四虎影院在线免费播放| aa毛片免费全部播放完整| 亚洲国产日韩在线成人蜜芽| 国产精品成人无码免费| 精品四虎免费观看国产高清午夜| 亚洲一卡二卡三卡| 国产偷国产偷亚洲清高动态图| 69av免费视频| 成人一级免费视频|