1.編輯tomcat中的server.xml文件
2.在Host標(biāo)簽下添加
<Context docBase="/user" path="/pictures" debug="0" reloadable="true"/>
docBase 對應(yīng)linux 真實(shí)路徑/user/123.png
path 對應(yīng)tomcat 訪問路徑
3.訪問地址http://192.168.44.128:8080/pictures/123.png
指令:
./catalina.sh run?會(huì)在當(dāng)前控制臺打印出日志信息
ps -ef |grep tomcat? 查看啟動(dòng)情況
錯(cuò)誤:linux真實(shí)路徑不存在