[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Apache2 conf and mod_ruby (mac os x 10.4.11

unbewusst.sein

4/28/2008 11:56:00 AM


in my httpd.conf i have :

LoadModule ruby_module libexec/httpd/mod_ruby.so
....
AddModule mod_ruby.c


and :
<IfModule mod_ruby.c>
# for Apache::RubyRun
RubyRequire apache/ruby-run

# exec files under /ruby as ruby scripts.
<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options +ExecCGI
</Location>

# for rbx files
<Directory /Users/yt/Sites/*>
Options +ExecCGI
</Directory>

# exec *.rbx as ruby scripts.
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>

# # 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
</Location>
#
# # handle *.rhtml as eruby files.
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>

# # for Apache::ERbRun
# RubyRequire apache/erb-run
#
# # handle files under /erb as eRuby files by ERb.
# <Location /erb>
# SetHandler ruby-object
# RubyHandler Apache::ERbRun.instance
# </Location>

# # for debug
#RubyRequire auto-reload

<IfModule mod_dir.c>
DirectoryIndex index.html index.rhtml
</IfModule>

AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/eruby

</IfModule>


however any attempt to read a *.rbx or *.rhtml gave me the text content
of the script itself.

i've checked the syntax of httpd.conf, according to apachectl -t, it is
correct.

i'm running Mac 0S 10.4.11 with :
ruby 1.8.6 (2007-09-24 patchlevel 111) [powerpc-darwin8.11.0]
eRuby version 1.0.5

how could i debugg this stuff ?
--
Une Bévue
13 Answers

unbewusst.sein

4/28/2008 5:40:00 PM

0

Roger Pack <rogerpack2005@gmail.com> wrote:

> I'm not too familiar with it, but it may be an additional Option you
> need to add or an AddHandler.

thanks for your answer, i discovered, in the mean time, Apache 2, is
unable to load mod_ruby.so because of a symbol not found, expected in a
flat name space...

i fall back to Apache 1.3, the Apple's default wich works at least, for
the time being, with rbx files in any directory...


also i wanted to compile the latest mod_ruby, but it fails.

i suspect something wrong in my manuall Apache 2 install (i wanted to
link the latest mod_ruby with this apache 2)...
--
Une Bévue

Tiago Macedo

4/29/2008 2:44:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm using mod_ruby with apache 2.2.6 without any issues. I manually
compiled and installed both apache and mod_ruby so I'm not sure of how
much help I'll be.

My config is pretty simple:

LoadModule ruby_module /usr/local/apache2/modules/mod_ruby.so

<IfModule mod_ruby.c>

~ RubyRequire apache/ruby-run
~ <Files *.rbx>
~ SetHandler ruby-object
~ RubyHandler Apache::RubyRun.instance
~ </Files>

~ RubyRequire apache/eruby-run
~ <Files *.rhtml>
~ SetHandler ruby-object
~ RubyHandler Apache::ERubyRun.instance
~ </Files>
</IfModule>

It's installed here:

root@takk:/usr/lib/ruby/1.8# ls -la apache/
total 64
drwxr-xr-x 2 root root 4096 2007-11-05 17:03 ./
drwxr-xr-x 32 root root 4096 2007-11-05 17:03 ../
- -rw-r--r-- 1 root root 3664 2007-11-05 17:03 erb-run.rb
- -rw-r--r-- 1 root root 3381 2007-11-05 17:03 eruby-debug.rb
- -rw-r--r-- 1 root root 3229 2007-11-05 17:03 eruby-run.rb
- -rw-r--r-- 1 root root 6148 2007-11-05 17:03 query.rb
- -rw-r--r-- 1 root root 13949 2007-11-05 17:03 rails-dispatcher.rb
- -rw-r--r-- 1 root root 3626 2007-11-05 17:03 rd2html.rb
- -rw-r--r-- 1 root root 2353 2007-11-05 17:03 registry.rb
- -rw-r--r-- 1 root root 3428 2007-11-05 17:03 ruby-debug.rb
- -rw-r--r-- 1 root root 3956 2007-11-05 17:03 ruby-profile.rb
- -rw-r--r-- 1 root root 2461 2007-11-05 17:03 ruby-run.rb
root@takk:/usr/lib/ruby/1.8#

Let me know if I can be of further help.

Tiago Macedo

Une Bévue wrote:
| Roger Pack <rogerpack2005@gmail.com> wrote:
|
|> I'm not too familiar with it, but it may be an additional Option you
|> need to add or an AddHandler.
|
| thanks for your answer, i discovered, in the mean time, Apache 2, is
| unable to load mod_ruby.so because of a symbol not found, expected in a
| flat name space...
|
| i fall back to Apache 1.3, the Apple's default wich works at least, for
| the time being, with rbx files in any directory...
|
|
| also i wanted to compile the latest mod_ruby, but it fails.
|
| i suspect something wrong in my manuall Apache 2 install (i wanted to
| link the latest mod_ruby with this apache 2)...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail....

iEYEARECAAYFAkgXNAEACgkQxFuRTtCTMvJWnQCfWuYcBdFOUIrsmbth5vBdY7Q7
h+MAn28LQquclWD6JZRUoO8q/fGQNNdo
=eGxJ
-----END PGP SIGNATURE-----

unbewusst.sein

4/29/2008 3:43:00 PM

0

Tiago Macedo <tmacedo@student.dei.uc.pt> wrote:

> Hash: SHA1
>
> Hi,
>
> I'm using mod_ruby with apache 2.2.6 without any issues. I manually
> compiled and installed both apache and mod_ruby so I'm not sure of how
> much help I'll be.

fine, thanks, i'l re-install, manually everything...

and let u know.

--
Une Bévue

unbewusst.sein

5/2/2008 3:52:00 PM

0

Tiago Macedo <tmacedo@student.dei.uc.pt> wrote:

> Let me know if I can be of further help.

right now, *.rbx files are working but not *.rhtml.

with eruby the Apache2 server complains :
[Wed Apr 30 16:53:57 2008] [error] mod_ruby: failed to require
apache/eruby-run
[Wed Apr 30 16:53:57 2008] [error] mod_ruby: error in ruby
[Wed Apr 30 16:53:57 2008] [error] mod_ruby:
/opt/local/lib/ruby/1.8/apache/eruby-run.rb:45:in `require': no such
file to load -- eruby (LoadError)
[Wed Apr 30 16:53:57 2008] [error] mod_ruby: from
/opt/local/lib/ruby/1.8/apache/eruby-run.rb:45
[Wed Apr 30 16:54:23 2008] [error] mod_ruby: error in ruby
[Wed Apr 30 16:54:23 2008] [error] mod_ruby: (eval):45: (eval):45:
uninitialized constant Apache::ERubyRun (NameError)
[Wed Apr 30 16:54:23 2008] [error] mod_ruby: from (eval):45:in `value'


the line 45 of eruby-run.rb being :

require "eruby"

i did a test changing this line to the absolute path of eruby, without
any positive effect...


even my httpd.conf is slightly different from yours, i had to add :
<Directory /Users/yt/Sites/*>
Options +ExecCGI
</Directory>

in order to get *.rbx files working...
--
Une Bévue

Tiago Macedo

5/2/2008 5:15:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm guessing you don't have eruby installed:

http://wiki.modruby.net/en/?eRub...

Tiago Macedo

Une Bévue wrote:
| Tiago Macedo <tmacedo@student.dei.uc.pt> wrote:
|
|> Let me know if I can be of further help.
|
| right now, *.rbx files are working but not *.rhtml.
|
| with eruby the Apache2 server complains :
| [Wed Apr 30 16:53:57 2008] [error] mod_ruby: failed to require
| apache/eruby-run
| [Wed Apr 30 16:53:57 2008] [error] mod_ruby: error in ruby
| [Wed Apr 30 16:53:57 2008] [error] mod_ruby:
| /opt/local/lib/ruby/1.8/apache/eruby-run.rb:45:in `require': no such
| file to load -- eruby (LoadError)
| [Wed Apr 30 16:53:57 2008] [error] mod_ruby: from
| /opt/local/lib/ruby/1.8/apache/eruby-run.rb:45
| [Wed Apr 30 16:54:23 2008] [error] mod_ruby: error in ruby
| [Wed Apr 30 16:54:23 2008] [error] mod_ruby: (eval):45: (eval):45:
| uninitialized constant Apache::ERubyRun (NameError)
| [Wed Apr 30 16:54:23 2008] [error] mod_ruby: from (eval):45:in `value'
|
|
| the line 45 of eruby-run.rb being :
|
| require "eruby"
|
| i did a test changing this line to the absolute path of eruby, without
| any positive effect...
|
|
| even my httpd.conf is slightly different from yours, i had to add :
| <Directory /Users/yt/Sites/*>
| Options +ExecCGI
| </Directory>
|
| in order to get *.rbx files working...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail....

iEYEARECAAYFAkgbS+kACgkQxFuRTtCTMvJdRgCfUfxhCj1b4dBAR2jBzWWZocxv
tAIAn1gRtfBrARNQ4/aj83jkXHjJGskp
=u2DD
-----END PGP SIGNATURE-----

unbewusst.sein

5/3/2008 4:17:00 PM

0

Tiago Macedo <tmacedo@student.dei.uc.pt> wrote:

> I'm guessing you don't have eruby installed:
>
> http://wiki.modruby.net/en/?eRub...

ok, thanks, i'll read this wiki.

i suspect the test done with eruby on command line was done with an
older eruby not linked the Apache2 (?)
even erubis is working on command line, and part of it as cgi.
--
Une Bévue

unbewusst.sein

5/3/2008 4:30:00 PM

0

Une Bévue <unbewusst.sein@weltanschauung.com.invalid> wrote:

> ok, thanks, i'll read this wiki.

I'd like to add a question :
what i the role of this eruby ? I mean if i do :
$ eruby --version
eRuby version 1.0.5
ruby 1.8.6 (2007-09-24 patchlevel 111) [powerpc-darwin8.11.0]

even i've tested eruby on cli...

also :
$ which eruby
/opt/local/bin/eruby

may be this isn't the "same" eruby ???
I'm confused about that...
--
Une Bévue

Tiago Macedo

5/5/2008 2:30:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do you have anything similar to this?

root@takk:~# locate eruby.so
/usr/lib/ruby/1.8/i686-linux/eruby.so

This is what apache is requiring.

Tiago Macedo

Une Bévue wrote:
| Une Bévue <unbewusst.sein@weltanschauung.com.invalid> wrote:
|
|> ok, thanks, i'll read this wiki.
|
| I'd like to add a question :
| what i the role of this eruby ? I mean if i do :
| $ eruby --version
| eRuby version 1.0.5
| ruby 1.8.6 (2007-09-24 patchlevel 111) [powerpc-darwin8.11.0]
|
| even i've tested eruby on cli...
|
| also :
| $ which eruby
| /opt/local/bin/eruby
|
| may be this isn't the "same" eruby ???
| I'm confused about that...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail....

iEYEARECAAYFAkgfGDIACgkQxFuRTtCTMvKXeACfZ8TmsXVBtQIaWAy6T8DfPj65
RsAAn2opKjP+g1M846pQe+AYssUwGMpW
=GNiO
-----END PGP SIGNATURE-----

unbewusst.sein

5/5/2008 4:20:00 PM

0

Tiago Macedo <tmacedo@student.dei.uc.pt> wrote:

> root@takk:~# locate eruby.so
> /usr/lib/ruby/1.8/i686-linux/eruby.so

nope, but i do have :
/opt/local/bin/eruby (*)

which i symlinked to :
/opt/local/apache2/cgi-bin/eruby

what sounds strange to me:
previously i had the same setup BUT, reinstalling eruby (same version
numbers) and re-doing the symlink make it working...

I'm running Mac OS X 10.4.11

and also :
/opt/local/include/eruby.h
/opt/local/lib/liberuby.a
/opt/local/lib/ruby/1.8/apache/eruby-debug.rb
/opt/local/lib/ruby/1.8/apache/eruby-run.rb
/opt/local/lib/ruby/1.8/powerpc-darwin8.8.0/eruby.bundle

> This is what apache is requiring.

may be u don't run the same OS ?

--
Une Bévue

Tiago Macedo

5/5/2008 6:07:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't, I use linux but you need the library and for some reason you
don't have it.

Une Bévue wrote:
| Tiago Macedo <tmacedo@student.dei.uc.pt> wrote:
|
|> root@takk:~# locate eruby.so
|> /usr/lib/ruby/1.8/i686-linux/eruby.so
|
| nope, but i do have :
| /opt/local/bin/eruby (*)
|
| which i symlinked to :
| /opt/local/apache2/cgi-bin/eruby
|
| what sounds strange to me:
| previously i had the same setup BUT, reinstalling eruby (same version
| numbers) and re-doing the symlink make it working...
|
| I'm running Mac OS X 10.4.11
|
| and also :
| /opt/local/include/eruby.h
| /opt/local/lib/liberuby.a
| /opt/local/lib/ruby/1.8/apache/eruby-debug.rb
| /opt/local/lib/ruby/1.8/apache/eruby-run.rb
| /opt/local/lib/ruby/1.8/powerpc-darwin8.8.0/eruby.bundle
|
|> This is what apache is requiring.
|
| may be u don't run the same OS ?
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail....

iEYEARECAAYFAkgfTLUACgkQxFuRTtCTMvKPcACeKxsEuPsF8u6cxrbQJwTc1VHl
3O8AnR3sl6YblK8fkSEp93QSFsshJ7a5
=qUvo
-----END PGP SIGNATURE-----