Reasons and solutions for Internal Server Error when opening a website

Internal server error 500 error occurs when opening the website. Usually, some unknown exceptions occur on the server side. However, when checking, we should not only focus on the application service, but pay attention to the entire chain from the server receiving the request to the application service. road.

Solution to Internal Server Error Caused by Permission Issues in Program Files

访问网站提示“Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request”

Solution: Log in to FTP or file manager, check the file permission setting of the site directory, set the folder permission to 755, and set the single file permission to 644.

After setting 644 in this way, the problem can be solved, and at the same time, it will not affect the write permission required by the website to meet the normal operation of the website. If there are many permissions in your site that need to be set, in order to improve efficiency.

Solution to Internal Server Error Caused by Program Application Problems

Because the program codes used by different websites are not the same, the solutions will not be exactly the same. The following troubleshooting methods provide a general solution: the possibility of errors due to application logic problems is very small, so the second reason is the most suspected , is the mark logic problem. If you directly check the source code of the mark, it is too time-consuming and laborious. At this time, the best way is to capture packets in real time to see what happened between the mark and the application service.

Use the tcpdump command to capture the data packets from jetty to the application service, and output the result to a temporary file:

tcpdump -i eth0:0 -s0 host 1X.XXX.XXX.XX -w /tmp/out1.cap

Jetty will limit the size of the requested data. When it exceeds 200,000 bytes, it will report an error and return error code 500.

Found the problem, add the jetty-web.xml file in the WEB-INF directory to solve it, the content of the file is as follows:

<Configure id="WebAppContext"class="org.eclipse.jetty.webapp.WebAppContext">

<Set name="maxFormContentSize"type="int"> 0 </Set>

おすすめ

転載: blog.csdn.net/jh035512/article/details/128011030