Tomcat IP address Access project Map shared directory

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.