I've installed Apache on a Raspberry Pi. If I create a js file in /var/www with nano, it works fine, and is served correctly if I open http://x.x.x.x/test.js directly in a browser. However, if I copy any .js or .gif file from an external source, e.g.
sudo wget http://code.jquery.com/jquery-2.0.0.min.js sudo wget http://i.imgur.com/ctTvTU5.gif -o puppy.gif
, when I try to access these file, e.g. at http://x.x.x.x/puppy.gif, it just spins forever and the page never loads.
I can't figure out why it's able to serve the test.js file that I created with nano but not jquery-2.0.0.min.js or puppy.gif. The permissions are the same for all of these files (rw-r--r--).
-rw-r--r-- 1 root root 83095 Apr 18 15:52 jquery-2.0.0.min.js -rw-r--r-- 1 root root 6071 Apr 20 08:42 puppy.gif -rw-r--r-- 1 root root 102400 Apr 20 08:19 test.js
At first I though it related to the filesize, but it didn't have any problem serving a 100K test.js that I made with
sudo dd if=/dev/zero bs=1K count=100 of=test.js
Access log (again /test.js is served successfully but for /puppy.gif and /jquery-2.0.0.min.js the page never loads):
192.168.2.251 - - [20/Apr/2013:09:31:45 -0500] "GET /puppy.gif HTTP/1.1" 200 6363 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31" 127.0.0.1 - - [20/Apr/2013:09:31:56 -0500] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.2.22 (Debian) (internal dummy connection)" 192.168.2.251 - - [20/Apr/2013:09:33:22 -0500] "GET /test.js HTTP/1.1" 304 212 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31"
There's nothing in the error log. Strangely nothing is logged for requests for /jquery-2.0.0.min.js.
Update: I decided to start over; I re-flashed my SD card and decided to try Nginx instead of Apache, but I'm having the same issue. I've noticed that everything is served successfully on localhost (if I access it from the browser on the rpi).
I've found that externally, a tiny 539 byte 16x16 png image is served successfully (though wireshark indicates the packet is malformed) but a larger png image is not served successfully.
bretttolbert.com/misc/rpitest/ sad.png (539 bytes) penguin.png (528 KB) GET_sad.png_succeeds.pcap (shows malformed packet, but works) GET_penguin.png_fails.pcap (request is not successful)
My RPi is 192.168.2.102 and my PC (client) is 192.168.2.251.