Apache doesn't show filesize/duration during downloading .dmg in browser?

janton

Verified User
Joined
Sep 17, 2009
Messages
145
I have a .dmg on my website for a Mac Software, but when i try to download this (even in different browsers), it doesn't show me the duration or the filesize.
Could this be something I need to configure in Apache?

I checked the http header:

HTTP/1.1 200 OK =>
Date => Mon, 22 Apr 2013 15:36:08 GMT
Server => Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.3.22
Last-Modified => Thu, 11 Apr 2013 13:30:19 GMT
ETag => "2087eb-4151ab7-4da15c9a450c0"
Accept-Ranges => bytes
Content-Length => 68491959
Cache-Control => max-age=1209600
Expires => Mon, 06 May 2013 15:36:08 GMT
Vary => Accept-Encoding,User-Agent
Connection => close
Content-Type => application/x-apple-diskimage


Any idea?
 
I am sure apache doesnt know what mime-type that is. You will have to set it in the apache config or force mime type with htaccess
 
Dear Chatwizrd, i added the dmg mime-type through the advanced tab in Directadmin (before i did the http header check) so I told application/x-apple-diskimage for dmg
You suggest that I also add it somewhere else? (or maybe i need to restart apache/httpd?)
 
Ok so i think i found the issue, it seems the file works ok if i change the extension to .zip so i check the http header there and i see the following difference:
Vary => Accept-Encoding,User-Agent

So that means that apache is compressing it? How and where should i change this? i now added the mime-type in my directadmin advanced tab. Should I go in with SSH and change something in a apache file?
 
OK so it works now, what i did was: /etc/httpd/conf/extra/httpd-deflate.conf
changed:

# Don't compress images and other uncompressible content
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|mp?g)$ no-gzip dont-vary


i added the dmg extension:


# Don't compress images and other uncompressible content
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|rar|zip|exe|dmg|flv|mov|wma|mp3|avi|mp?g)$ no-gzip dont-vary



what if directadmin updates apache http etc. will this setting go lost?
 
Back
Top