need: In the near future, we will implement the large file upload function. In addition to modifying the upload file limit size of the front-end framework upload control jQuery Uploadify and the file upload limit size in the MultipartResolver in the file upload module configured in the Spring MVC framework, we also need to modify the client_max_body_size attribute in the nginx.conf configuration file in the conf directory of the Nginx server and the connectionTimeout attribute and maxPostSize attribute in the server.xml configuration file in the conf directory of the Tomcat server. The above content is the modification I made. question: First, I modified the configuration of the Nginx server and Tomcat server and restarted the Nginx server. Then, I modified the page and code and redeployed and ran it. Then I uploaded a large file on the page, and problems occurred when submitting and saving. I suspected that there might be a problem with saving the large file, and I was busy checking the logs on the server. Then a colleague said that the file deletion function was invalid. Then another colleague said that the website could not be logged in. After entering the correct verification code, an error message said that the verification code login had expired... Various problems followed one after another. I looked at the server logs for a long time but did not find any problems. It was because I did not look carefully and did not locate where the problem occurred. Troubleshooting: I had no choice but to ask an expert for help. First, he asked me what I had modified. I said I had modified the configurations of both the Nginx server and the Tomcat server. The expert looked at the configuration files of the Nginx server on Linux and the server.xml configuration files of the Tomcat server, and then asked me what the configuration of the maxPostSize="0" attribute meant. I said that there is no limit on the body size under the HTTP POST request. If it is not set, the default value is maxPostSize="2097152", which is 2M in size, because the unit is Byte. Daniel then checked the relevant information and found out that it might be a problem caused by the Tomcat version. Different Tomcat versions may have different maxPostSize attribute settings. Knowing the problem, he started to configure it. solve: I searched for Tomcat maxPostSize on Baidu, and luckily the first result was about the maxPostSize settings for different versions of Tomcat. Contents of this blog After reading this blog, I checked the unified Tomcat version used in the project under Linux. The version used was Tomcat 7.0.70. Then after reading this article, what else can you say? Just change the attribute maxPostSize to -1, which means unlimited. Restart the Tomcat server, log in to the website again, and all the above problems will be gone. Attached is the blog address of this blogger: https://www.jb51.net/article/190134.htm Summary: Thinking about the problem that occurred yesterday, today is a good time to summarize it during the break, and then go to the relevant documents on the Tomcat official website to look at this problem. Nowadays, Tomcat versions are updated very quickly, and many Tomcat7 versions are no longer easy to find. We can check the latest Tomcat7 version information. After opening the Tomcat official website, check Tomcat 7.0 under Documentation Then look at the Configuration section under Reference Next, check the HTTP section under Connectors. This is closely related to the structure of the server.xml configuration file in Tomcat's conf file. As long as you are familiar with the server.xml configuration, it is not a problem to find this. Checking the relevant properties, we will see a detailed introduction to maxPostSize. This limit must be set to a negative number less than 0 to be unlimited. The default value is 2097152, which is 2M in size, in Byte. You should know that the above introduction is only for Tomcat 7.0.86 version. So how do we view the changes in Tomcat's historical versions? Go back to the document homepage where you first came in and click the Changelog section at the bottom. Here are all the changes in the historical versions of Tomcat7. We found the Tomcat 7.0.63 version and can see that the first item that changed is the content about the maxPost attribute. The blogger above is really full of useful information. Although the content is small, it hits the mark. Through the above summary, if similar problems occur in the future, the ability to troubleshoot problems should be improved. Summarize the troubleshooting steps yourself:
Summarize This is the end of this article about solving the problems that need to be paid attention to in the configuration of Tomcat's maxPostSize attribute. For more relevant content about Tomcat's maxPostSize attribute configuration, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue implements horizontal beveled bar chart
Getting Started with Data Volumes In the previous...
I rewrote my personal website recently. I bought ...
This article uses examples to illustrate the prin...
In design work, I often hear designers participati...
Example: tip: This component is based on vue-crop...
Table of contents Preface know Practice makes per...
Table of contents Introduction to NFS Service Wha...
Recently, WeChat Mini Program has proposed adjust...
By default, processes in the container run with r...
The final result is like this, isn’t it cute… PS:...
Table of contents Preface 1. Custom focus command...
Table of contents Written in front 1. Ngixn image...
1. Background Use LDAP to centrally manage operat...
Basic concepts: Macvlan working principle: Macvla...
1. First, double-click the vmware icon on the com...