From: Pete Elmore Date: 2005-01-25T11:37:30+09:00 Subject: Re: redirect error messages -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 ed wrote: | Matthew Margolis wrote in | news:41F5A084.7010107@wisc.edu: | |>Anyone care to help me figure this out before I have to cancel my |>hosting service and waste time moving the domain? | | | I'm a newbie to ruby, but try the following: | $stderr = File.open('error.log', 'w+') | $stdout = $stderr | | In theory, both stdout and stderr should be redirected to the file. That's true. But you probably don't want $stdout to go to a file as that will cause your script to send no data to the user's browser. One of the problems that could cause the script to work locally but fail remotely is leaving off the print "Content-type: text/html\n\n" # or "text/plain", or # whatever Both of the \n's are important, as that's how the server and browser determine when the header stops and the content begins. From the error message you gave, it would appear that that's exactly what the problem is. Apache executes the script and runs all the way to the end, and, finding no '\n\n', interprets the body as the header and can't figure out where the header ends. Since (iirc) Apache runs on OSX, you could set it up locally and use that to debug your scripts before uploading them. Would you mind posting your script? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Debian - http://enigmail.mozdev.org iD8DBQFB9bHTv24lB609Ih8RAjKtAJ920UkHMMtwntLPXkNPImRx8WByygCgkzwC rYr4U6NH/EbMdlJA0QYn95c= =DEcL -----END PGP SIGNATURE-----