First of all , how to access the project directly through the IP address.
Web project Normal access is Http://192.168.1.1:8080/demo, including IP, port, and project name. Directly through IP access, no input port and project name is required to make the following modifications in the Server.xml file in the tomcat,conf directory:
Port to 80 so that you do not have to enter the port when you access the Web project;
<context docbase= "/demo path=" "reloadable=" true "/>//path value is" "
Then restart the project to access the project directly via IP.
The second problem, the picture folder is not in the project relative path , this time if you need to access pictures under the picture folder, you need to Server.xml in the Conf directory to make changes, but also in the
<context path= "Images" docbase= "D:\pictureFiles" debug= "0"/>//Map D Disk Pictruefiles folder to project path
Then in the Web page Access folder under the picture below:
This allows the page to display the picture normally.
The above situation is that picture folders and items on the same server, in some cases, such as load balancing requires picture servers and Web projects deployed on different servers, the general server is on the same LAN, then how to access it. share the picture folder on the picture server (assuming the picture server IP is 192.168.1.100, the Picture folder path is D:/picturefiles), the right Key folder-Properties-sharing-advanced sharing
Select Advanced sharing, as follows
Enter the share name, here is images.
2. The picture server is set up here, then the Tomcat on another server is set up conf/serve.xml; add in
<context path= "Images" docbase= "\\192.168.1.100\images" debug= "0"/>
Accessing pictures on the front end of the web is the same as the first.
<!--startfragment-->
Size: 24.6 KB Size: KB View picture attachments