Z
Zach Dennis
I feel bad for asking this question, but I am going to pull my hair out with
this. I recently got Ruby to run as a cgi under Apache2/Win2k combination.
Works great. I am now trying to do the same thing on Apache2/Redhat9 combo,
but to no avail. I keep getting the Server Error 500, premature end of
script headers.
Here is my Apache config:
------------------------------
<VirtualHost *>
ServerAdmin root@localhost
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Files ~ "^\.htm">
Order allow,deny
Deny from all
</Files>
<Directory "/var/www/cgi-bin">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
AddType application/x-httpd-ruby .rb
Action application/x-httpd-ruby /usr/local/bin/ruby
</VirtualHost>
Here is my Script that I am trying to run( test.rb ):
-----------------------------------------------------
#!/usr/local/bin/ruby
print "Content-type: text/html\r\n"
print "<html><body>Hello</body></html>"
I was having this problem on my windows box at first but then I changed the
first line to read:
#! ruby
and it has worked ever since. However I have changed the first line on my
test.rb file on the Linux box to the following variations:
#! ruby
#!/usr/local/bin/ruby
#!/bin/ruby
#!/bin/env ruby
#! /bin/env ruby
and to not avail does it work. All files are owned by root. Any ideas?
Thanks in advance,
Zach
this. I recently got Ruby to run as a cgi under Apache2/Win2k combination.
Works great. I am now trying to do the same thing on Apache2/Redhat9 combo,
but to no avail. I keep getting the Server Error 500, premature end of
script headers.
Here is my Apache config:
------------------------------
<VirtualHost *>
ServerAdmin root@localhost
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Files ~ "^\.htm">
Order allow,deny
Deny from all
</Files>
<Directory "/var/www/cgi-bin">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
AddType application/x-httpd-ruby .rb
Action application/x-httpd-ruby /usr/local/bin/ruby
</VirtualHost>
Here is my Script that I am trying to run( test.rb ):
-----------------------------------------------------
#!/usr/local/bin/ruby
print "Content-type: text/html\r\n"
print "<html><body>Hello</body></html>"
I was having this problem on my windows box at first but then I changed the
first line to read:
#! ruby
and it has worked ever since. However I have changed the first line on my
test.rb file on the Linux box to the following variations:
#! ruby
#!/usr/local/bin/ruby
#!/bin/ruby
#!/bin/env ruby
#! /bin/env ruby
and to not avail does it work. All files are owned by root. Any ideas?
Thanks in advance,
Zach