時(shí)間:2023-02-03 22:12:01 | 來源:建站知識
時(shí)間:2023-02-03 22:12:01 來源:建站知識
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Engine name="Catalina" defaultHost="www.xxx.com">
<Host name="www.xxx.com" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Alias>xxx.vip</Alias> <Context path="" docBase ="shop" reloadable="true" /> </Host>
shop是你的項(xiàng)目的名字,把你的項(xiàng)目的名字放上面就可以了。不用再通過項(xiàng)目的名字來訪問這個(gè)項(xiàng)目,直接用域名就可以訪問到這個(gè)項(xiàng)目。<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/><Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="8443"/>
2.將Engine的defaultHost改為自己的域名,如果是本地測試則無需更改。<Engine name="Catalina" defaultHost="localhost"><!-- ------ 更改為 ------ --><Engine name="Catalina" defaultHost="www.xxxxx.com(自己的域名)">
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"><!-- ------ 更改為 ------ --><Host name="www.xxxxx.com" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="tomcat在云服務(wù)器的路徑/webapps/項(xiàng)目名" reloadable="true"/><!-- 注意:本地可用相對路徑 docBase="../wtpwebapps/項(xiàng)目名", 云端需要是絕對路徑,否則會訪問不到。 -->
5.保存文件,重啟Tomcat的測試(為了避免出錯(cuò)重啟下,也可以不重啟)。關(guān)鍵詞:靜態(tài),訪問,使用
客戶&案例
營銷資訊
關(guān)于我們
微信公眾號
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。