Re: css image url's and :img problem FIXED

2007-11-24 Thread pedro mg
Finally, a solution.
After spending days on this, i got to a solution: use a Lighty specific header.

Instead of:
@headers['X-Sendfile'] = full_path

Use:
@headers['X-LIGHTTPD-Send-file'] = full_path

There is still the need of the:
fastcgi.server = ( ... = (( ..., allow-x-send-file = enable )))

http://trac.lighttpd.net/trac/changeset/1097/branches/lighttpd-merge-1.4.x/doc/fastcgi.txt

Wget logs the headers correctly:
$ wget -d -S http://machine:port/webapp -o log
$ wget -d -S http://machine:port/webapp/static/img001.jpg -o log

TY zimbatm for the refactor.

http://pastebin.com/mdd73c8b

-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-22 Thread Jonas Pfenniger
I know what I will say won't help you : FastCGI is a total waste of
time. Apart if you're stucked with that setup, a reverse proxy of any
kind does just fine and is much less hassle to maintain/operate.
Contrary to FastCGI, HTTP is a well understood and supported protocol,
with lots of different tools. I always use Nginx or Apache + Mongrels
and it works fine.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-21 Thread pedro mg
On Sun, Nov 18, 2007 at 04:10:04AM +, pedro mg wrote:
 img :src = R(Static, 'img04.jpg'), :alt = 'test image'

Hi,

anyone using Lighttpd + FastCGI to run Camping using Why's configuration
shown at 4) in:
http://code.whytheluckystiff.net/camping/wiki/TheCampingServerForLighttpd

Focusing on the fastcgi module configuration we have:
fastcgi.server = (  = (
 ...
)

With this, camping mounts all apps at ROOT.
The problem is the image file handling. It handles .css and .js files 
correctly, but no image is handled.

Mounting the app in a subdirectory:
fastcgi.server = ( /project1 = (
 ...
)
starts serving image files correctly for all other apps except for this one, 
since fastcgi will handle /project images (with error)

In Debian, mime types are assigned to lighty via PERL script called from 
lighttpd.conf, so no need for assignement at the 10-fastcgi.conf file.

So my question is: anyone using Lighttpd + FastCGI + Camping ? How do you serve 
images ?

System: Debian 4.0
Camping 1.5

best regards,
-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-20 Thread pedro mg
On Tue, Nov 20, 2007 at 06:34:12AM +, pedro mg wrote:
  You aren't running on Windows are you? The newline handling might
  be corrupting your files...

If i test http://localhost:3301/project/static/img01.png

I get the correct Content-Type in the browser title:
img01.png (PNG Image)

If it is a gif file, i get (GIF Image), etc.
But it doesnt render in the browser, reporting:
The image http://localhost:3301/project/static/img01.png; cannot be displayed 
because it contains errors.

Any hint  ?

-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-20 Thread Jonas Pfenniger
2007/11/20, pedro mg [EMAIL PROTECTED]:
 But it doesnt render in the browser, reporting:
 The image http://localhost:3301/project/static/img01.png; cannot be 
 displayed because it contains errors.

 Any hint  ?

Are you still running the same code ? I've spotted another error :
more line 5 between 6 and 7. Otherwise, your 403 error won't have the
right content-type. This is not the cause of your problem but it could
help.

Also, on what server are you running the code ? Mongrel ?
And which version of camping are you using ?

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-20 Thread Jonas Pfenniger
Try this version : http://pastebin.com/m10c8fab0

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-19 Thread Jonas Pfenniger
2007/11/18, pedro mg [EMAIL PROTECTED]:
 The class is here: http://pastebin.com/f7c92f95a

Remove the quotes around the regexp on line 5. Right now the
expression returns nil, which is not an entry in your MIME_TYPES hash.
Apparently the browser can work around a nil mime-type for the .css
but not for the pics.

-- 
Cheers,
  zimbatm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-19 Thread pedro mg
On Mon, Nov 19, 2007 at 03:13:11PM +0100, Jonas Pfenniger wrote:
 2007/11/18, pedro mg [EMAIL PROTECTED]:
  The class is here: http://pastebin.com/f7c92f95a
 
 Remove the quotes around the regexp on line 5. Right now the
 expression returns nil, which is not an entry in your MIME_TYPES hash.
 Apparently the browser can work around a nil mime-type for the .css
 but not for the pics.

Yes Jonas, thanks, i noticed it almost immediately through IRB testing ;) and
did remove them:

MIME_TYPES[file[(/\.\w+$/)]] || 'text/plain'

best regards,
-- 
pedro mg
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-19 Thread pedro mg
On Mon, Nov 19, 2007 at 02:10:06PM +1100, Clifford Heath wrote:
 When you get that, do a File-Save and see whether the file you save is
 identical to the source file.

no, diff size corrupted image file. 2 more bytes added... \nl ?

 You aren't running on Windows are you? The newline handling might
 be corrupting your files...

no, Debian Etch. Epiphany and Iceweasel, same results.

best regards,
-- 
pedro mg
http://blog.tquadrado.com
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-18 Thread pedro mg
On Sat, 2007-11-17 at 21:43 -0800, John Beppu wrote:
 On Nov 17, 2007 8:10 PM, pedro mg [EMAIL PROTECTED] wrote:
 
 background: #33 url(img01.gif) repeat-x;
 
 url(/static/img01.gif)

oh, sorry for the 2nd post.
Ty John, but i tried that, and even the whole path to the images, and
still no results.

-- 
pedro mg



___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-18 Thread Magnus Holm
Can you access the image at (localhost:3301)/static/img01.gif through your
browser?

On 11/18/07, pedro mg [EMAIL PROTECTED] wrote:

 On Sat, 2007-11-17 at 21:43 -0800, John Beppu wrote:
  On Nov 17, 2007 8:10 PM, pedro mg [EMAIL PROTECTED] wrote:
 
  background: #33 url(img01.gif) repeat-x;
 
  url(/static/img01.gif)

 oh, sorry for the 2nd post.
 Ty John, but i tried that, and even the whole path to the images, and
 still no results.

 --
 pedro mg



 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list




-- 
Magnus Holm
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: css image url's and :img problem

2007-11-18 Thread pedro mg
On Sun, 2007-11-18 at 18:23 +0100, Magnus Holm wrote:
 Can you access the image at (localhost:3301)/static/img01.gif through
 your browser?

I get an error message:

Couldn't load image 'img01.gif'
Unrecognized image file format

Same result for .jpg and .png image files.
I guess i'm having problems with DOCTYPE and headers...

-- 
pedro mg

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-18 Thread Clifford Heath
On 19/11/2007, at 1:33 PM, pedro mg wrote:
 On Sun, 2007-11-18 at 18:23 +0100, Magnus Holm wrote:
 Can you access the image at (localhost:3301)/static/img01.gif through
 your browser?

 I get an error message:

 Couldn't load image 'img01.gif'
 Unrecognized image file format

When you get that, do a File-Save and see whether the file you save is
identical to the source file.

You aren't running on Windows are you? The newline handling might
be corrupting your files...

Clifford Heath.


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: css image url's and :img problem

2007-11-17 Thread John Beppu
On Nov 17, 2007 8:10 PM, pedro mg [EMAIL PROTECTED] wrote:


 background: #33 url(img01.gif) repeat-x;


url(/static/img01.gif)

?
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list