Hi,
I want to run scripts in /home/me/public_html/cgi-scripts as me but I
can’t seem to figure out why suEXEC won’t work with mod_ruby:
The following shell-script works fine while the ruby script underneath it gets
a “touch: creating `tag_you_re_it.txt’: Permission denied” in
/var/log/apache/error.log
#!/bin/sh
echo "Content-type: text/html\r\n\r\n"
echo ""
touch tag_i_shelled_you.txt
#!/usr/bin/ruby
require “cgi”
touch tag_you_re_it.txt
When I change the directory’s permission so that everyone can write in
it, the file tag_you_re_it.txt is created with apache as owner.
Why isn’t my ruby script executed as me ?
Puzzled,
Simon
All parts concerning ruby in my /etc/apache/httpd.conf:
LoadModule ruby_module /usr/lib/apache/1.3/mod_ruby.so
If the ruby module is installed, this will be enabled.
# for Apache::RubyRun RubyRequire apache/ruby-runexec files under /ruby as ruby scripts.
<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options ExecCGI
exec *.rbx as ruby scripts.
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
for Apache::ERubyRun
RubyRequire apache/eruby-run
handle files under /eruby as eRuby files by eruby.
<Location /eruby>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
Options ExecCGI
handle *.rhtml as eruby files.
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
for Apache::ERbRun
#RubyRequire apache/erb-run
RubyRequire apache/eruby-run
handle files under /erb as eRuby files by ERb.
<Location /erb>
SetHandler ruby-object
RubyHandler Apache::ERbRun.instance
Options ExecCGI
for debug
RubyRequire auto-reload
···
–
If you tell the truth you don’t have to remember anything.
– Mark Twain