From: Sam Waller Date: 2006-12-09T19:40:06+09:00 Subject: Re: apache2 + ubuntu edgy + ruby On Sat, 9 Dec 2006 06:44:27 +0900, Grant Hollingworth wrote: >* Sam Waller [2006-12-08 12:00]: >>When I try to run a test.rb file I'm getting this in the error.log file: >> >>[Fri Dec 08 13:52:30 2006] [error] [client 127.0.0.1] (2)\xd9\x05i\xb7: exec of >>'/var/www/site/test.rb' failed >>[Fri Dec 08 13:52:30 2006] [error] [client 127.0.0.1] Premature end of script headers: test.rb > >It might be a problem with suexec. Check suexec.log. You probably have to change the permissions on the script -- suexec doesn't like scripts (or the directories they're in) to be group-writable. 'which ruby' say /usr/bin/ruby the permissions and ownership of test.rb: -rwxr-xr-x 1 www-data www-data 110 2006-12-08 12:37 test.rb* the directory that test.rb was in: /var/www/site was owned by root and I changed it to www-data:www-data and I get the same error. I tried changing test.rb to the following but still get the same error and couldn't find additional information: require 'net/http' http = Net::HTTP.new('localhost', 80) resp, page = http.get('/var/www/site', nil ) I also tried removing the space as mentioned but get the same results. I also have run into problems with carriage returns and linefeeds in scripts so I dumped test.rb just to be sure: 00000000 23 21 2f 75 73 72 2f 62 69 6e 2f 72 75 62 79 0d |#!/usr/bin/ruby.| 00000010 0a 70 72 69 6e 74 20 22 43 6f 6e 74 65 6e 74 2d |.print "Content-| 00000020 74 79 70 65 3a 74 65 78 74 2f 68 74 6d 6c 5c 72 |type:text/html\r| 00000030 5c 6e 5c 72 5c 6e 22 0d 0a 70 72 69 6e 74 20 22 |\n\r\n"..print "| 00000040 3c 68 74 6d 6c 3e 3c 62 6f 64 79 3e 48 65 6c 6c |Hell| 00000050 6f 20 57 6f 72 6c 64 21 3c 2f 62 6f 64 79 3e 3c |o World!<| 00000060 2f 68 74 6d 6c 3e 5c 72 5c 6e 22 0d 0a |/html>\r\n"..| 0000006d Thanks for your help, Sam