Score:0

Can't download .bin file from server (Apache 2.4.48)

de flag

I have an Ubuntu server with Apache2.4. (Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-74-generic x86_64))

I updated Apache from 2.4.46 to 2.4.48 and everything else I have tested is working properly except .bin file downloading over HTTPS. My device starts to download the file but it doesn't reach even the first packet of the file and it is saying that "Peer closed connection".

Downloading a .bin file worked earlier with Apache 2.4.46.

apache2ctl -S

VirtualHost configuration:
*:443                  is a NameVirtualHost
         default server ************** (/etc/apache2/sites-enabled/default-ssl.conf:2)
         port 443 namevhost ************** (/etc/apache2/sites-enabled/default-ssl.conf:2)
                 alias www.**************
         port 443 namevhost ********** (/etc/apache2/sites-enabled/default-ssl.conf:140)
                 alias www.**********
*:80                   is a NameVirtualHost
         default server ********** (/etc/apache2/sites-enabled/**********.conf:1)
         port 80 namevhost ********** (/etc/apache2/sites-enabled/**********.conf:1)
                 alias www.**********
         port 80 namevhost ************** (/etc/apache2/sites-enabled/**************.conf:1)
                 alias www.**************
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

Server logs:

ssl_engine_kernel.c(422): AH02034: Initial (No.1) HTTPS request received for child 3 (server **************:443)
http_request.c(436): Headers received from client:
http_request.c(440):    Host: **************
http_request.c(440):    Range: bytes=0-2047
http_request.c(440):    Connection: keep-alive
mod_authz_core.c(818): AH01626: authorization result of Require all granted: granted
mod_authz_core.c(818): AH01626: authorization result of <RequireAny>: granted
request.c(312): request authorized without authentication by access_checker_ex hook: /**********/*****/file.bin
mod_headers.c(866): AH01502: headers: ap_headers_output_filter()
byterange_filter.c(296): AH01583: Range: 0-2047 | 0-2047 (0 : 0 : 252692)
http_filters.c(1129): Response sent with status 206, headers:
http_filters.c(958):    X-Frame-Options: DENY
http_filters.c(958):    X-Content-Type-Options: nosniff
http_filters.c(958):    Last-Modified: Thu, 10 Jun 2021 13:00:07 GMT
http_filters.c(958):    ETag: \\"*****-**************\\"
http_filters.c(958):    Accept-Ranges: bytes
http_filters.c(958):    Content-Length: 2048
http_filters.c(958):    Content-Range: bytes 0-2047/252692
http_filters.c(958):    Keep-Alive: timeout=10, max=100
http_filters.c(958):    Connection: Keep-Alive
http_filters.c(958):    Content-Type: application/octet-stream
ssl_engine_io.c(1760): coalesce: have 0 bytes, adding 409 more (buckets=1)
ssl_engine_io.c(1760): coalesce: have 409 bytes, adding 2048 more (buckets=1)
ssl_engine_io.c(1821): coalesce: passing on 2457 bytes
ssl_engine_io.c(2310): OpenSSL: write 2517/2517 bytes to BIO#560760e4dc80 [mem: 560760e52493]
ssl_engine_io.c(2319): OpenSSL: I/O error, 5 bytes expected to read on BIO#560760e48400 [mem: 560760e52493]
ssl_engine_io.c(2310): OpenSSL: read 5/5 bytes from BIO#560760e48400 [mem: 560760e52493]
ssl_engine_io.c(2310): OpenSSL: read 64/64 bytes from BIO#560760e48400 [mem: 560760e52498]
ssl_engine_kernel.c(2218): OpenSSL: Read: SSL negotiation finished successfully
ssl_engine_io.c(2310): OpenSSL: write 69/69 bytes to BIO#560760e4dc80 [mem: 560760e5c493]
core_filters.c(542): (104)Connection reset by peer:  core_output_filter: writing data to the network
ssl_engine_kernel.c(2223):  OpenSSL: Write: SSL negotiation finished successfully
ssl_engine_io.c(1115):  AH02001: Connection closed to child 3 with standard shutdown (server **************:443)

I have tried a lot of things to solve this problem but nothing has worked. I wonder what has changed between those Apache versions that could have caused this. I hope someone could help me solve this problem or maybe have some ideas what I should try.

ziiroust avatar
de flag
I have these in my apache2.conf and I think they are correct because they have worked properly earlier. `Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 10`
ke flag
Is the file stored on a network filesystem or anything like that? Either way as a first step, I suggest trying `EnableSendfile OFF` and `EnableMMAP OFF`
ziiroust avatar
de flag
Yes, the file is stored on a virtual server's filesystem. I had to go back to use Apache 2.4.46 so the server would be fully functional but I'll try your suggestions when updating that again. But thanks for help anyway!
ziiroust avatar
de flag
@covener I tried to disable both `EnableSendfile` and `EnableMMAP` but it didn't give any help for my problem.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.