我们将LAMP Ubuntu16.04(Apache2.4.7)迁移到一个新的Ubuntu20.04(Apache2.4.41)。
两者都安装在/var/www/intranet/onyar上。
与新的,如果我下载一个文件从这个挂载驱动器,它已损坏。用旧的就行了。如果我用旧服务器下载的话,没关系。如果我通过桑巴进入,那就没问题了。
所以在Apache和挂载驱动器之间似乎是个问题?如果我尝试了一个文件外挂载驱动器(http://newserver/intranet/test.xls),它的工作正常。
我用txt、office类型和PDF文件测试了它,这些文件都损坏了。HTML文件有效!
我在里面放了一个简单的'test.txt‘文件,里面有字符串'hola’,我用'http://newserver/intranet/onyar/test.txt‘打开它,浏览器给我这样的信息:
Last-Modified: Thu, 12 Nov 2020 09:38:46 GMT
ETag: "4-5b3e5adb1be88"
Accept-Ranges: bytes
Content-Length: 4
Cache-Control: max-age=1209600
Expires: Thu, 26 Nov 2020 09:40:37 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/plain
holad_ip = dnsResolve(host);
if (isInNet(resolved_ip, "127.0.0.1", "255.255.255.255") || isInNet(resolved_ip, "172.16.0实际上,如果我在hola之后Ctrl+F5字符串(d_ip =.)有时会发生变化:
Last-Modified: Thu, 12 Nov 2020 09:38:46 GMT
ETag: "4-5b3e5adb1be88"
Accept-Ranges: bytes
Content-Length: 4
Cache-Control: max-age=1209600
Expires: Thu, 26 Nov 2020 09:57:01 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/plain
holar.</p>
<hr>
<address>Apache/2.4.41 (Ubuntu) Server at 10.80.160.178 Port 80</address>
</body></html>
p>The document hLast-Modified: Thu, 12 Nov 2020 09:38:46 GMT
ETag: "4-5b3e5adb1be88"
Accept-Ranges: bytes
Content-Length: 4
Cache-Control: max-age=1209600
Expires: Thu, 26 Nov 2020 09:57:01 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/plain
holaIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document ha这些结局似乎来自其他文件!就像阿帕奇不知道文件什么时候结束还有其他的东西.
参考资料:
发布于 2020-11-12 10:25:29
似乎我受到了这个bug的影响:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900821
对我来说,解决方案是将其放入/etc/apache2/apache2.conf中:
<Directory "/var/www/intranet/onyar">
EnableMMAP Off
</Directory>https://askubuntu.com/questions/1291685
复制相似问题