国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

幫助中心 >  技術(shù)知識庫 >  網(wǎng)站相關(guān) >  網(wǎng)站運營(yíng) >  Tomcat中更改網(wǎng)站根目錄和默認頁(yè)的配置方法

Tomcat中更改網(wǎng)站根目錄和默認頁(yè)的配置方法

2017-10-10 08:17:40 5497

1.tomcat原來(lái)的默認根目錄是http://www.tjdsmy.cn:8080,如果想修改訪(fǎng)問(wèn)的根目錄,可以這樣:

找到tomcat的server.xml(在conf目錄下),找到:


<Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false"></Host>



在</Host>前插入:



<Context path="" docBase="D:/eclipse3.3/landui/tomcat/" debug="0"/>


其中D:/eclipse3.3/landui/tomcat/就是我想設置的網(wǎng)站根目錄,然后重啟tomcat。


再次訪(fǎng)問(wèn)http://www.tjdsmy.cn:8080時(shí),就是直接訪(fǎng)問(wèn)D:/eclipse3.3/landui/tomcat/目錄下的文件了。


2.tomcat的web.xml(在conf目錄下),在該文件中找到


    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>


這是tomcat默認的3個(gè)文件,當你輸入指定路徑后,tomcat會(huì )自動(dòng)查找這3個(gè)頁(yè)面。如果你想讓tomcat自動(dòng)找到自己的頁(yè)面,比如main.jsp??梢孕薷纳厦嫘畔椋?br/>


    <welcome-file-list>
        <welcome-file>main.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    
這樣就可以了。


提交成功!非常感謝您的反饋,我們會(huì )繼續努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題:
-->