Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Images from a site not being served

I did a clean install of Snow Leopard Server last night.

Then I moved my Web Server files onto the new server.

The server hosts five domains.

On one of the domains certain images (but not all) are not being served out.

Safari activity simply states "bad request".

Right-clicking on a missing image to open the missing image in a new window results in an Error 400: Unimplemented method.

On the server, in the Finder, the images are there, and they open in preview. Privileges are OK (Everybody Read Only).

Any ideas?

MacBook Pro 17, Mac OS X (10.6.1)

Posted on Oct 19, 2009 9:17 PM

Reply
19 replies

Oct 31, 2009 9:15 PM in response to TK321

I think you need mod_rewrite module enabled.

One should NEVER get a 400 Bad Request message. That should be near impossible, however if mod_rewrite is not on and a GET command has a space in its command then you COULD get error 400. With Mod_rewrite enabled, any request with a space (' ') will be 'rewritten' into %20 and that should fix it.

Peter

Nov 2, 2009 8:19 AM in response to TK321

O.K., Well, we will solve this.

The fist observation is that only the items in /media/ are being 'denied'. Could they be moved (duplicated for a first test) and the site be adjust ted (even one or two links) to see if they then load? I found other parts of that site that are being served and again the data that is in /media is denied but other media is not ( http://www.criticcinema.com/tour.html). This does insinuate that this is permissions and not specifically Apache as it should then either be all broke or all working, code does not rot.

Next question. have you made changes to the type-map, also previously known as the mime type ' application/x-type-map'?

Read this, please: http://httpd.apache.org/docs/1.3/content-negotiation.html This explains how you can use (or more honestly, one could exist and you not know it) to allow Apache to pick a 'more appropriate' mime type, such as to allow for local translations to be chosen without consciously making a choice of German over English etc. This can also be applied to images as well, so the browser and server could 'chose' to default to text/html for those media types based on this mapping. The reason I bring this one up is each of those items that are failing are all being mime types as text/html. I don't recall if Firefox browser 'defaults' to that when it does not know what type something is but it is a question that just needs to be looked into to be sure it is NOT that.

We'll get to the bottom of this all.

Peter

Message was edited by: Peter Scordamaglia - Added link to partially working page

Nov 2, 2009 9:46 AM in response to Peter Scordamaglia

OK. Some interesting findings.

1) I zipped the site folder up, moved it to my computer and opened it up in DreamWeaver. It displays correctly from within DreamWeaver, and when previewing in browsers from the DreamWeaver app, it looks fine. This leads me to believe that the HTML is OK, and the files are not corrupt.

2) I duplicated the "media" folder and renamed it "graphics". I duplicated "index.html" and renamed it "index2.html". Then I did a find and replace in the document, changing references from "media" to "graphics". That page works! You can see it here: http://www.criticcinema.com/index2.html.
This leads me to believe that the files are not corrupt the HTML is OK (I won't go so far to say its good!), and the server is doing what it is supposed to.

3) When viewing files on the server, I noticed that the images that are not displaying show a preview in the finder (column view), but when opening in the Preview application, do NOT display. The Finder "genie" effects show the image growing from the Finder's preview as it opens in the Preview application, and the Preview window opens to the size of the image, but only displays a grey window, not the image! Not sure what that means. However, if I open that file directly with Safari, it displays fine! Not sure what that means either! Maybe that is a red herring, as I am remotely controlling/viewing the server using ARD, so maybe ARD somehow is not allowing preview to show me the photos, although I have never observed that before.

4) Based on observations in 2 and 3 above, I renamed the "media" folder "media original", duplicated it, and renamed the duplicated folder "media". That didn't fix the problem.

5) No I did not make any changes to the type-map, also previously known as the mime type ' application/x-type-map'

Stymied.

Message was edited by: TK321

Nov 2, 2009 1:14 PM in response to TK321

OK on this Site, do you have any redirects? Could it be that there is a Redirect for /Media/ to another folder and permissions are wonky as that folder is an alias or possibly even a hard link with its own rights?

I am starting to grasp as straws but I am sure we will find it, even if just through sheer brute force of undoing every button.

Peter

Nov 2, 2009 3:59 PM in response to Peter Scordamaglia

Access:

192.168.123.50 - - [02/Nov/2009:17:51:16 -0600] "GET /joel/books/index.htm HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:17 -0600] "GET /joel/books/launch.css HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:18 -0600] "GET /joel/books/zpix/yoda.jpg HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:51 -0600] "GET / HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /GeneratedItems/CSScriptLib.js HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /zcritic.css HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/blink/lights left81.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/1-gear.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/blink/lights_top.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/critic-alt.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/4-library.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/blink/lights top12.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/7-joel.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/2-tour.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/5-liners.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/8-tiff.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/6-recommend.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/3-todo.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/9-trailers.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/filmstrip-L1.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/maco/frame.jpg HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /tour/zimages/thx.jpg HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/filmstrip-R1.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/7-joel-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/4-library-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/1-gear-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/5-liners-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/2-tour-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/8-tiff-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/6-recommend-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/9-trailers-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:52 -0600] "GET /media/marquee/3-todo-over.gif HTTP/1.1" 400 2867
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /index2.html HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/critic-alt.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/blink/lights left81.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/blink/lights_top.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/4-library.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/blink/lights top12.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/1-gear.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/3-todo.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/8-tiff.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/5-liners.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/6-recommend.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/7-joel.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/2-tour.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/filmstrip-R1.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/maco/frame.jpg HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/9-trailers.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/filmstrip-L1.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/4-library-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/1-gear-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/7-joel-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/2-tour-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/5-liners-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:57 -0600] "GET /graphics/marquee/8-tiff-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:58 -0600] "GET /graphics/marquee/3-todo-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:58 -0600] "GET /graphics/marquee/6-recommend-over.gif HTTP/1.1" 304 -
192.168.123.50 - - [02/Nov/2009:17:51:58 -0600] "GET /graphics/marquee/9-trailers-over.gif HTTP/1.1" 304 -
66.249.68.72 - - [02/Nov/2009:17:53:27 -0600] "GET /groups/tech/revisions/16748/1/ HTTP/1.1" 200 13336




Error:
No error posted to log at time of access. This is what was there earlier:
[Mon Nov 02 17:12:11 2009] [error] [client 65.55.106.184] File does not exist: /Library/WebServer/Documents/critic/error.html
[Mon Nov 02 17:36:48 2009] [error] [client 65.55.211.30] File does not exist: /Library/WebServer/Documents/critic/robots.txt
[Mon Nov 02 17:36:48 2009] [error] [client 65.55.211.30] File does not exist: /Library/WebServer/Documents/critic/error.html

Nov 2, 2009 6:08 PM in response to TK321

More observations:

1) I created a very simple document (to eliminate any strange java code, etc), it exhibited the same problem:
http://www.criticcinema.com/index3.html

2) All of these pages open in the browser on the server just fine.
In other words, if I navigate into the site's directory and double-click on the index.html file, it opens and displays the images just fine in Safari.

Which points to something in the server.

However my index2.html file (which points to the duplicated "media" folder and renamed to "graphics") works, which points to an issue in the server combined with that particular "media" folder.

Message was edited by: TK321

Nov 2, 2009 6:55 PM in response to TK321

OK part of this might be from the 304 status.

the log format looks to be Common Log Format (CLF). Your format string looks like this "%h %l %u %t \"%r\" %>s %b".

A PERFECT snippit is

192.168.123.50 - - 02/Nov/2009:17:51:52 -0600 "GET /tour/zimages/thx.jpg HTTP/1.1" 304 -
192.168.123.50 - - 02/Nov/2009:17:51:52 -0600 "GET /media/filmstrip-R1.gif HTTP/1.1" 400 2867

That is from the index.html GET which has the mixture of /media and /media or /tour images. When the site is being 'hit' through /media/ (or tour), all lines are getting error 400 and the amount of data being sent is 2k (2876 bytes) but the items that are not in /media are getting 304 which is 'NOT MODIFIED'. 304 Not Modified Indicates the resource has not been modified since last requested. Typically, the HTTP client provides a header like the If-Modified-Since header to provide a time against which to compare. Utilizing this saves bandwidth and reprocessing on both the server and client, as only the header data must be sent and received in comparison to the entirety of the page being re-processed by the server, then resent using more bandwidth of the server and client. This is 'ok', it is more for cached sites (say google or the internet wayback machine). That is a lot of gobbledygook for works as intended (My server does the same with lots of images)

I dl'ed a file http://www.criticcinema.com/media/maco/frame.jpg and it WAS sent as a text/html file. it is 2K and is a valid html file. I think the hint here is this:

<meta name="apple required_uirevision" content="">
<meta name="apple collabuid" content="">
<meta name="apple_passwordResetEnabled" content="">
<meta name="apple_siteDisplayName" content="My Page">
<meta name="apple_iconURI" content="/collaboration/images/group.png">
<meta name="viewport" content="width=950, user-scalable=yes, minimum-scale=0.25, maximum-scale=1.5">

This content looks to be coming from /collaboration, which is the Apple wiki. Nothing in the documentation states that /media would be used or redirected but that content is coming from there. I am still digging, but could you please check all your other domains for redirects and while doing that, please note how many (if any) have collaboration on.

So far, the solution seems to be to take all the /media/ and move to /images/ or wherever you moved them already, and while we are trying to figure out what the heck is up, set index2.html to your default page.

Peter

Nov 2, 2009 7:07 PM in response to Peter Scordamaglia

I have one domain on the server that uses the collaboration (wiki/blogs) tools.

No redirects that I can tell (and I don't remember ever having a need to do a redirect) - would there be an easy way to check?

I figured I might have to change the media folder name to something else, based on other tests I did. Problem is that media folder has lots of references, so I will have to update quite a few pages—which I can do in DreamWeaver, no problem, but then I doubt we would ever get to the bottom of the real problem...

Nov 2, 2009 7:45 PM in response to TK321

Some head-way:

1) I dumped all of my old files in an archive folder. Interesting thing - It would not let me move the "media" folder using WebDAV, even though the folder had the same permissions as the other folders. I looked at the server, and tried to move the media folder into my archive folder, and was prompted to authenticate, which I did.

2) Then I used DreamWeaver to change the name of the "media" folder to "graphics" on my local copy of the site and change the references. Then used WebDAV to move the site back to the server and now it is mostly working.

It seems my images are not displaying the "over" image when hovering over the link - just displays a black box. Once you hover and get the black box, it stays there, even when not hovering.

You can see this by hovering over a link in the marquee.

This behavior is also exhibited when viewing the site from within DreamWeaver, so it is not a server issue.

However, when I look at the original server files in my archive folder, and double-click the index file on the server, the hove image does appear correctly.

If I had to guess it appears that DreamWeaver did not update the links in the (JavaScript?) hovers?

Looks like viewing source code bears that out. Which kind of blows - why does DreamWeaver only change some of the references? Seems like a half-a55 job if you ask me. There are a lot references to change if I have to do this by hand... Using DreamWeaver to change the other references took quite a bit of time, and that was automated...

Ideas?

Message was edited by: TK321

Message was edited by: TK321

Nov 2, 2009 8:07 PM in response to TK321

Do you use something called TwistedWeb?

This is a working GET from requesting MACO.HTML
-----
GET /graphics/filmstrip-R1.gif HTTP/1.1
Host: www.criticcinema.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: image/png,image/ ;q=0.8,*/;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.criticcinema.com/maco.html
Cookie: utcOffset=-5
If-Modified-Since: Tue, 18 Jul 2000 22:37:19 GMT
If-None-Match: "81a3f-478-36cb763c805c0"
Cache-Control: max-age=0

*HTTP/1.1 200 OK*
Date: Tue, 03 Nov 2009 03:59:49 GMT
Server: Apache/2.2.11 (Unix) DAV/2 PHP/5.3.0
Last-Modified: Tue, 03 Nov 2009 03:29:32 GMT
ETag: "83d59-478-4776f1a3b1f00"
Accept-Ranges: bytes
Content-Length: 1144
Cache-Control: max-age=3600
Expires: Tue, 03 Nov 2009 04:59:49 GMT
MS-Author-Via: DAV
X-Frame-Options: SameOrigin
Keep-Alive: timeout=15, max=496
Connection: Keep-Alive
Content-Type: image/gif
_GIF89a.. (DATA)_
-----
This is good!! Now for an item in /media (from same load of MACO.HTML)

GET /media/marquee/8-tiff-over.gif HTTP/1.1
Host: www.criticcinema.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: image/png,image/ ;q=0.8,*/;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.criticcinema.com/maco.html
Cookie: sessionID=unauthenticated; utcOffset=-5

*HTTP/1.1 400 Bad Request*
Date: Tue, 03 Nov 2009 03:59:49 GMT
Server: Twisted/8.2.0 TwistedWeb/[twisted.web2, version 8.2.0]
Content-Length: 2867
Content-Type: text/html;charset=utf-8
Cache-Control: max-age=60
Expires: Tue, 03 Nov 2009 04:00:49 GMT
MS-Author-Via: DAV
X-Frame-Options: SameOrigin
Connection: close
-----
And the html wiki page came down. I think that TwistedWeb might be part of this issue.

Peter

Nov 2, 2009 8:13 PM in response to TK321

I found a way to match the java code for the rollovers that was still referencing "media" and do a mass find and replace operation across the site.

Everything looks good now.

My guess is that media folder is somehow tied to wiki stuff.

I suppose one could attempt a test by creating a fake site and trying to reference images inside a folder called "media" ....

There is a folder named "Media" in the /Library/Collaboration directory.

Images from a site not being served

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.