Ruby and Apache on Windows - RubyAddPath

401 views
Skip to first unread message

Zeno R.R. Davatz

unread,
Jan 12, 2011, 9:28:43 AM1/12/11
to RubyInstaller
Does anybody have some good tips on Ruby and Apache on Windows. It is
the first time I am doing this on Windows.

I need a RubyAddPath setting in my httpd.conf. My VirtualHost goes

<VirtualHost *:80>
DocumentRoot "C:\Ruby-1.8.6-oniguruma\lib\ruby\gems\1.8\gems
\de.oddb-2.0.0\doc"
ServerName de.oddb.localhost
DirectoryIndex index.rbx
RubyAddPath "C:\Ruby-1.8.6-oniguruma\lib\ruby\gems
\1.8\gems\de.oddb-2.0.0\lib"
RubyRequire 'sbsm/trans_handler'
SetHandler ruby-object
RubyTransHandler SBSM::ZoneTransHandler.instance
SetEnv DEFAULT_FLAVOR oddb
SetEnv DRB_SERVER druby://localhost:11000
Alias /rss C:\Ruby-1.8.6-oniguruma\lib\ruby\gems\1.8\gems
\de.oddb-2.0.0\var\rss
Alias /images C:\Ruby-1.8.6-oniguruma\lib\ruby\gems\1.8\gems
\de.oddb-2.0.0\var\images
Alias /captcha C:\Ruby-1.8.6-oniguruma\lib\ruby\gems\1.8\gems
\de.oddb-2.0.0\var\captcha
</VirtualHost>

and the RubyAddPath is not recognized.

Best
Zeno

James Cowlishaw

unread,
Jan 12, 2011, 9:45:53 AM1/12/11
to rubyin...@googlegroups.com
Zeno,

mod_ruby [1] looks like a dead/dormant project now, but I suspect you'll need to download and build it using the devkit.

I'd suggest running a couple of mongrel_service instances, fronted by your Apache installation.

Good luck,
James.



--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.


Zeno R.R. Davatz

unread,
Jan 12, 2011, 9:49:14 AM1/12/11
to RubyInstaller
Dear James

On 12 Jan., 15:45, James Cowlishaw <ja...@securstar.com> wrote:

> mod_ruby [1] looks like a dead/dormant project now, but I suspect you'll
> need to download and build it using the devkit.
>
> I'd suggest running a couple of mongrel_service instances, fronted by your
> Apache installation.

I just reached the same conclusion. Thank you for your help! I guess I
can do this with gcc-3.4.5

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 12, 2011, 9:57:13 AM1/12/11
to RubyInstaller
Ok, it is starting bad.

Doing

rake ruby18:dependencies devkit:sh

then

sh-3.1$ ./configure.rb
checking for a BSD compatible install... $(RUBY) c:/Users/zdavatz/
software/mod_ruby-1.3.0/install-rb -c
checking whether we are using gcc... yes
checking Ruby version... 1.8.6
checking for static Apache module support... no
checking for dynamic Apache module support... ./configure.rb:518:in
``': No such file or directory - apxs -q INCLUDEDIR (Errno::ENOENT
from ./configure.rb:518

I guess I need some Apache-Include-Dir.

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 12, 2011, 10:32:15 AM1/12/11
to RubyInstaller
Ok I am doing

./configure.rb --with-apxs=/c/Users/zdavatz/software/httpd-2.2.17/
support

in

sh-3.1$ pwd
/c/Users/zdavatz/software/mod_ruby-1.3.0

but again it results in

checking for dynamic Apache module support... ./configure.rb:518:in
``': Permission denied - c:/Users/zdavatz/software/httpd-2.2.17/
support -q INCLUDEDIR (Errno::EACCES)
from ./configure.rb:518

I excluded all the directories

c:/Users/zdavatz/software/
c:/Users/zdavatz/software/httpd-2.2.17/
c:/Users/zdavatz/software/httpd-2.2.17/support

from my Microsoft Security Essentials. Still no success. Anything else
I have to pay attention to?

Any hints?

Best
Zeno

James Cowlishaw

unread,
Jan 12, 2011, 10:36:27 AM1/12/11
to rubyin...@googlegroups.com
On 12 January 2011 15:32, Zeno R.R. Davatz <zda...@gmail.com> wrote:
Ok I am doing

 ./configure.rb --with-apxs=/c/Users/zdavatz/software/httpd-2.2.17/
support

in

sh-3.1$ pwd
/c/Users/zdavatz/software/mod_ruby-1.3.0

but again it results in

checking for dynamic Apache module support... ./configure.rb:518:in
``': Permission denied - c:/Users/zdavatz/software/httpd-2.2.17/
support -q INCLUDEDIR (Errno::EACCES)

You could try running the command prompt or bash as administrator (right-click 'run as administrator') from explorer in Windows Vista/7.

James.

Zeno R.R. Davatz

unread,
Jan 12, 2011, 10:53:36 AM1/12/11
to RubyInstaller
Dear James

On 12 Jan., 16:36, James Cowlishaw <ja...@securstar.com> wrote:

> You could try running the command prompt or bash as administrator
> (right-click 'run as administrator') from explorer in Windows Vista/7.

Same freaking error, I done as you said! But when I do

/c/Users/zdavatz/software/mod_ruby-1.3.0/configure.rb --with-
apxs=apxs.in

from here

/c/Users/zdavatz/software/httpd-2.2.17/support

I get a different error:

checking for dynamic Apache module support... c:/Users/zdavatz/
software/mod_ruby-1.3.0/configure.rb:518:in ``': Exec format error -
apxs.in -q INCLUDEDIR (Errno::ENOEXEC)
from c:/Users/zdavatz/software/mod_ruby-1.3.0/configure.rb:518

I downloaded the unix sources from Apache from here

http://mirror.switch.ch/mirror/apache/dist//httpd/httpd-2.2.17.tar.bz2

I as figure in the

rake ruby18:dependencies devkit:sh

I should be able to use those.

The mod_ruby helpfile says:

You can use Apache 2.0 also, but there are some restrictions.

* You should build mod_ruby as a DSO module. (Please use --with-apxs
option instead of --with-apache option when running configure.rb.)

That is what I am trying. Do I need to use different Apache sources?

Best
Zeno

James Cowlishaw

unread,
Jan 12, 2011, 11:03:36 AM1/12/11
to rubyin...@googlegroups.com
I'm sorry, I haven't built Apache myself, so this would be new ground for me too.

As Luis said, mongrel_service is probably a better trod route; one likely to have more google hits and help, should things not go smoothly. Apache configuration should not impact your application too much, though I do see the appeal of a passenger-style deployment. 

James.

Luis Lavena

unread,
Jan 12, 2011, 9:32:53 AM1/12/11
to rubyin...@googlegroups.com
On Wed, Jan 12, 2011 at 11:28 AM, Zeno R.R. Davatz <zda...@gmail.com> wrote:
> Does anybody have some good tips on Ruby and Apache on Windows. It is
> the first time I am doing this on Windows.
>
> I need a RubyAddPath setting in my httpd.conf. My VirtualHost goes
>

apache mod_ruby.c, you need to check if is compiled or not. Most likely is not.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Zeno R.R. Davatz

unread,
Jan 12, 2011, 11:24:21 AM1/12/11
to RubyInstaller
On 12 Jan., 15:32, Luis Lavena <luislav...@gmail.com> wrote:
> On Wed, Jan 12, 2011 at 11:28 AM, Zeno R.R. Davatz <zdav...@gmail.com> wrote:
>
> > Does anybody have some good tips on Ruby and Apache on Windows. It is
> > the first time I am doing this on Windows.
>
> > I need a RubyAddPath setting in my httpd.conf. My VirtualHost goes
>
> apache mod_ruby.c, you need to check if is compiled or not. Most likely is not.

Do you recommend the Win32 sources or the Unix-Sources of Apache? I am
asking because they have different line endings.

Apache guys say:

http://mirror.switch.ch/mirror/apache/dist//httpd/

Note; the -win32-src.zip versions of Apache are nearly identical to
the .tar.gz versions. However, they offer the source files in DOS/
Windows CR/LF text format, and include the Win32 build files. These -
win32-src.zip files do NOT contain binaries! See the binaries/win32/
directory for the Windows binary distributions.

Best
Zeno

Luis Lavena

unread,
Jan 12, 2011, 10:06:41 AM1/12/11
to rubyin...@googlegroups.com
On Wed, Jan 12, 2011 at 11:57 AM, Zeno R.R. Davatz <zda...@gmail.com> wrote:
> Ok, it is starting bad.
>
> Doing
>
> rake ruby18:dependencies devkit:sh
>
> then
>
> sh-3.1$ ./configure.rb
> checking for a BSD compatible install... $(RUBY) c:/Users/zdavatz/
> software/mod_ruby-1.3.0/install-rb -c
> checking whether we are using gcc... yes

To build any apache modules you need to build apache too, and build
apache is not an easy task.

James suggestion was go on a different way, since ModRuby is dead and
been like that for long time.

Zeno R.R. Davatz

unread,
Jan 12, 2011, 11:37:36 AM1/12/11
to RubyInstaller
On Jan 12, 4:06 pm, Luis Lavena <luislav...@gmail.com> wrote:

> To build any apache modules you need to build apache too, and build
> apache is not an easy task.

Well that is gonna need more digging then.

> James suggestion was go on a different way, since ModRuby is dead and
> been like that for long time.

well not quite. mod_ruby is ready for Ruby 1.9 ;) And mod_ruby is
_a_lot_faster then fcgi or fastcgi! We tested that quite extensively
and we do have decent loads on our Linux-Server.

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 12, 2011, 12:00:08 PM1/12/11
to RubyInstaller
You know what I believe Luis: RubyInstaller should come with mod_ruby
precompiled. The reason is simple.

http://url.ba/bmtx

Missing mod_ruby on Windows hurts Ruby.

mod_php is all over the place. Why isn't mod_ruby?

Ruby_Installer on Windows is great! But with mod_ruby it would be
Rocking!

Best
Zeno

Luis Lavena

unread,
Jan 12, 2011, 12:07:13 PM1/12/11
to rubyin...@googlegroups.com
On Wed, Jan 12, 2011 at 2:00 PM, Zeno R.R. Davatz <zda...@gmail.com> wrote:
> You know what I believe Luis: RubyInstaller should come with mod_ruby
> precompiled. The reason is simple.
>
> http://url.ba/bmtx
>

Please, don't use 2008 article to back *your* need for something.

If you look at Rubyinstaller group and previous rubyinstaller-devel
and -users list, noone required this.

Passenger was created after that article, and for sure changed the way
people deploy Ruby applications behind Apache.

> Missing mod_ruby on Windows hurts Ruby.
>

That is your appreciation based on your needs.

> mod_php is all over the place. Why isn't mod_ruby?
>

Because nobody on Windows uses it?

mod_ruby hooks into your Apache process and there is no easy way to
track or restart individual processes. That is why mongrel_service
proven to be a more viable and useful solution for admins.

> Ruby_Installer on Windows is great! But with mod_ruby it would be
> Rocking!
>

RubyInstaller, don't add underscores where there is. And again, is
your need, not RubyInstaller project.

Please refer to the bundling policies related to RubyInstaller in our FAQ:

https://github.com/oneclick/rubyinstaller/wiki/FAQ

In all the years working and deploying applications on Windows never
used Apache, and will not start doing it now.

Again, it is time you get your hands dirty if you really need it. And
again, please restrict from posting emails on every pebble you find in
your way, mailing list is not IRC.

Zeno R.R. Davatz

unread,
Jan 12, 2011, 2:59:59 PM1/12/11
to RubyInstaller
I figure with this is should work:

http://httpd.apache.org/docs/2.0/programs/apxs.html

httpd -l

says:

Compiled in modules:
core.c
mod_win32.c
mpm_winnt.c
http_core.c
mod_so.c

this should do the trick.

apxs -i -a -c mod_ruby.c

but I still need to find the command.

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 13, 2011, 5:19:04 AM1/13/11
to RubyInstaller
Ok I got apxs installed but it seems that I need a different compiler,
not mingw.

C:\Users\zdavatz\software\mod_ruby-1.3.0>apxs.pl -i -a -c mod_ruby.c
Use of uninitialized value in concatenation (.) or string at C:
\Apache2.2\bin\apxs.pl line 471.
C:/MinGW/bin/gcc.exe /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D
NDEBUG -I"C:\Apache2.2\include" /c /Fomod_ruby.lo mod_ruby.c
gcc.exe: /nologo: No such file or directory
gcc.exe: /MD: No such file or directory
gcc.exe: /W3: No such file or directory
gcc.exe: /O2: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: WIN32: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: _WINDOWS: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: NDEBUG: No such file or directory
gcc.exe: /c: No such file or directory
gcc.exe: /Fomod_ruby.lo: No such file or directory
In file included from mod_ruby.c:33:0:
mod_ruby.h:33:18: fatal error: ruby.h: No such file or directory
compilation terminated.
apxs:Error: Command failed with rc=65536

C:\Apache2.2\bin>apxs.pl
Usage: apxs -g [-S <var>=<val>] -n <modname>
apxs -q [-v] [-S <var>=<val>] <query> ...
apxs -c [-S <var>=<val>] [-o <dsofile>] [-D <name>[=<value>]]
[-I <incdir>] [-L <libdir>] [-l <libname>] [-
Wc,<flags>]
[-Wl,<flags>] [-p] <files> ...
apxs -i [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...
apxs -e [-S <var>=<val>] [-a] [-A] [-n <modname>] <dsofile> ...

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 13, 2011, 5:24:18 AM1/13/11
to RubyInstaller
This is the error I get if I try it from the mod_ruby side:

configure goes nice:

C:\Users\zdavatz\software\mod_ruby-1.3.0>configure.rb
checking for a BSD compatible install... $(RUBY) C:/Users/zdavatz/
software/mod_ruby-1.3.0/install-rb -c
checking whether we are using gcc... yes
checking Ruby version... 1.8.7
checking for static Apache module support... no
checking for dynamic Apache module support... Das System kann den
angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
yes
creating Makefile
creating libruby.module
creating doc/Makefile

but make throws me this error

C:\Apache2.2\include/apr.h:57:0: warning: ignoring #pragma warning
request.c:794:13: error: conflicting types for 'mode_t'
c:\mingw\bin\../lib/gcc/mingw32/4.5.0/../../../../include/sys/types.h:
99:17: note: previous declaration of 'mode_t' was here
request.c: In function 'request_finfo':
request.c:877:17: warning: assignment makes integer from pointer
without a cast
request.c:878:17: warning: assignment makes integer from pointer
without a cast
request.c: In function 'request_send_fd':
request.c:1580:5: warning: passing argument 2 of 'apr_os_file_put'
from incompatible pointer type
C:\Apache2.2\include/apr_portable.h:340:27: note: expected 'void **'
but argument is of type 'int *'
make: *** [request.o] Error 1

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 13, 2011, 3:38:49 PM1/13/11
to RubyInstaller
Any hints where I can find cl.exe for download?

Best
Zeno

Luis Lavena

unread,
Jan 13, 2011, 3:40:52 PM1/13/11
to rubyin...@googlegroups.com
On Thu, Jan 13, 2011 at 5:38 PM, Zeno R.R. Davatz <zda...@gmail.com> wrote:
> Any hints where I can find cl.exe for download?
>

cl.exe is Visual Studio, You need exact same version of the one used
to compile Apache, and we start all over again since you need a Ruby
compiled with Visual Studio to be able to compile the extension...

Jon

unread,
Jan 13, 2011, 3:42:07 PM1/13/11
to rubyin...@googlegroups.com

> Any hints where I can find cl.exe for download?
>
> Best
> Zeno

Command line compilers and other very useful tools are now provided by MSFT as part of their Windows SDK.

A ton of links from Google, but here's a good start: http://msdn.microsoft.com/en-us/windows/bb980924

Jon

---
blog: http://jonforums.github.com/

Zeno R.R. Davatz

unread,
Jan 14, 2011, 2:32:02 AM1/14/11
to RubyInstaller
Dear Jon, Luis

Thanks for the hints.

What I did was install apxs via Perl because it was the only win32
binary I could find:

http://www.apachelounge.com/download/apxs_win32.zip

I am used to compiling because we only use Gentoo/Funtoo on our
servers, desktops but I still do not fully understand the relations
between mingw and cl.exe

Basically this guy got mod_ruby-1.1.1 with Apache httpd-2.0.47-win32-
src.zip* running. But the downloaded apache sources 2.0.47 have no lib
directory. They only have the include directory. So all of his patches
won't apply.

http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/

Moriq also offers a compiled version of mod_ruby.so but that does not
load in my Apache on Windows.

I also contacted Shugo, the author of mod_ruby. Again I am willing to
pay to get a working binary for mod_ruby on Windows with Apache 2.2.17
and I am willing to share the resulted work with others as well.

If I run configure from the mod_ruby-1.3.0 side I get the above
mentioned error.

My search continues.

Best
Zeno

*[http://archive.apache.org/dist/httpd/httpd-2.0.47-win32-src.zip]

Zeno R.R. Davatz

unread,
Jan 14, 2011, 3:35:37 AM1/14/11
to RubyInstaller
Ok I reinstalled apxs and now I get a complete new error, apxs does
not want cl anymore.

C:\Users\zdavatz\software\mod_ruby-1.3.0>apxs -c mod_ruby.c
C:/MinGW/bin/gcc.exe /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D
NDEBUG -I"C:\Apache2.2\include" /c /Fomod_ruby.lo mod_ruby.c
gcc.exe: /nologo: No such file or directory
gcc.exe: /MD: No such file or directory
gcc.exe: /W3: No such file or directory
gcc.exe: /O2: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: WIN32: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: _WINDOWS: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: NDEBUG: No such file or directory
gcc.exe: /c: No such file or directory
gcc.exe: /Fomod_ruby.lo: No such file or directory
In file included from mod_ruby.c:33:0:
mod_ruby.h:33:18: fatal error: ruby.h: No such file or directory
compilation terminated.
apxs:Error: Command failed with rc=65536

any hints? I also contacted the authors of the apxs_win32 packge Bill
Rowe and Randy Kobes and told them I am willing to pay for their help
on windows to get this working with mingw.

In the mean time I am documenting here:

http://dev.ywesee.com/wiki.php/Apache/Apxs

Best
Zeno

Boško Ivanišević

unread,
Jan 14, 2011, 3:56:24 AM1/14/11
to rubyin...@googlegroups.com
Even though apxs does not require cl and uses gcc instead it still uses switches for cl. Switch /MD for example means creating multi-threaded application that uses shared run-time libraries, /W3 sets warning to level 3, /nologo supresses display of sign-on banner, etc. GCC doesn't understand any of them.


--
Regards,
Boško Ivanišević

Zeno R.R. Davatz

unread,
Jan 14, 2011, 4:18:41 AM1/14/11
to RubyInstaller
Dear Boško

Thanks for your hint! Very helpful!

On 14 Jan., 09:56, Boško Ivanišević <bosko.ivanise...@gmail.com>
wrote:

> Even though apxs does not require cl and uses gcc instead it still uses
> switches for cl. Switch /MD for example means creating multi-threaded
> application that uses shared run-time libraries, /W3 sets warning to level
> 3, /nologo supresses display of sign-on banner, etc. GCC doesn't understand
> any of them.

So you say I should start looking at the switches? So where should I
start looking in what file?

I copied some more files over like so

defines.h
missing.h
intern.h
version.h
rubyio.h
util.h

this then results in

gcc.exe: /nologo: No such file or directory
gcc.exe: /MD: No such file or directory
gcc.exe: /W3: No such file or directory
gcc.exe: /O2: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: _WINDOWS: No such file or directory
gcc.exe: /D: No such file or directory
gcc.exe: NDEBUG: No such file or directory
gcc.exe: /c: No such file or directory
gcc.exe: /Fomod_ruby.lo: No such file or directory
apxs:Error: Command failed with rc=65536

It seems that I am not that far away. Again: I am willing to donate to
get this done. mod_ruby on Windows is really missing out and it would
be a great added feature to enhance Ruby for Windows with mod_ruby for
Apache for Windows.

Best
Zeno

Dušan Majkić

unread,
Jan 14, 2011, 4:20:26 AM1/14/11
to rubyin...@googlegroups.com
> apxs:Error: Command failed with rc=65536
>
> any hints?

in apxs_win32.pl

change

CFLAGS = /nologo /MD /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG
CXXFLAGS =
LTFLAGS =
LDFLAGS = kernel32.lib /nologo /subsystem:windows /dll /machine:I386
/libpath:"%APACHE2%\lib"

to something gcc unredstands, like:

CFLAGS = -Wall -O2 -D WIN32 -D _WINDOWS -D NDEBUG
CXXFLAGS =
LTFLAGS =
LDFLAGS = -lkernel32.lib -shared -Wl, -soname, mod_ruby.dll -o mod_ruby.dll

This is just a hint. Original uses cl.exe (MS VC Compiler) to build this dll,
which can't be done now, since ruby installers are compiled from mingw-gcc.

You will probably have to ask mod_ruby author to try port to mingw-gcc
compiler,
in a way that resulting dll can be loaded to msvc based apache. If it
can be done at all.

Zeno R.R. Davatz

unread,
Jan 14, 2011, 4:43:13 AM1/14/11
to RubyInstaller
Dear Dušan

Thanks for your help! Please see below:
I done as you told me and reinstalled apxs like this

pwd (location is)
C:\Users\zdavatz\software\apxs_win32\apxs>
perl Configure.pl --with-apache-prog=httpd.exe

Set up gcc environment - 4.5.0

Use "C:\Apache2.2" for your Apache2 directory? [yes]

apxs.bat has been created under C:\Apache2.2\bin.
apr-1-config.pl.bat has been created under C:\Apache2.2\bin.
apu-1-config.pl.bat has been created under C:\Apache2.2\bin.

And that resulted in the same error as above with less error-output
thanks to your help:

C:\Users\zdavatz\software\mod_ruby-1.3.0>apxs -c mod_ruby.c
C:/MinGW/bin/gcc.exe -Wall -O2 -D WIN32 -D _WINDOWS -D NDEBUG -I"C:
\Apache2.2\include" /c /Fomod_ruby.lo mod_ruby.c
gcc.exe: /c: No such file or directory
gcc.exe: /Fomod_ruby.lo: No such file or directory
In file included from C:\Apache2.2\include/ap_config.h:25:0,
from C:\Apache2.2\include/httpd.h:43,
from mod_ruby.h:104,
from mod_ruby.c:33:
C:\Apache2.2\include/apr.h:57:0: warning: ignoring #pragma warning
apxs:Error: Command failed with rc=65536

So now I am for the hunt of omod_ruby.lo

I guess I need to copy that to the directory of mod_ruby-1.3.0 as well
and try again.

Best
Zeno

James Cowlishaw

unread,
Jan 14, 2011, 5:10:09 AM1/14/11
to rubyin...@googlegroups.com
Zeno,

It seems like I'm watching someone climb a mountain the hard way, not for the challenge, but to reach the cafe at the top. I also see that you're missing the footpath round the corner, and the mountain railway on the other side. It's not clear at this point that you will get to the top.

Several people on the list have tried to help you, pointing out current or easier practices along the way (Oniguruma gem, mod_ruby vs Mongrel/Apache).
Unless you really are up for the challenge of resurrecting or porting several non-trivial projects, you should step back and see what you are trying to achieve. I'm sure much of this time could be better spent updating or improving your application.

I think we've all thrown time and resources at a brick wall before, so we know the "solution is just round the corner" feeling.

I'm sure people will continue to try and help you (myself included, where I can); as long as you're trying to help yourself too.

Good luck,

James.


Zeno R.R. Davatz

unread,
Jan 14, 2011, 5:32:31 AM1/14/11
to RubyInstaller
Dear James

Thank you for your reply.

On 14 Jan., 11:10, James Cowlishaw <ja...@securstar.com> wrote:

> It seems like I'm watching someone climb a mountain the hard way, not for
> the challenge, but to reach the cafe at the top. I also see that you're
> missing the footpath round the corner, and the mountain railway on the other
> side. It's not clear at this point that you will get to the top.

I indeed do like to climb the mountains with my snowboard on my
back ;)

> Several people on the list have tried to help you, pointing out current or
> easier practices along the way (Oniguruma gem, mod_ruby vs Mongrel/Apache).
> Unless you really are up for the challenge of resurrecting or porting
> several non-trivial projects, you should step back and see what you are
> trying to achieve. I'm sure much of this time could be better spent updating
> or improving your application.

Our application works just fine with mod_ruby on linux. Mod_Ruby does
a fine job of handling loads of Traffic. Our setup is more stable and
more reliable to traffic then ie Rubinius and ActiveRecord, so I know
what is awaiting me on top of the mountain and I sure do hope that it
is not a cafe! ;) I am Swiss.

We spent more hard times comparing fcgi and fastcgi to mod_ruby and
mod_ruby just is a lot faster and stable if you have many concurrent
users. At the moment we have about 900 sessions (26 threads) open on
just one VirtualHost and the App is going just fine.

> I think we've all thrown time and resources at a brick wall before, so we
> know the "solution is just round the corner" feeling.

I am sure you have, me too. Unfortunately Shugo does not have a
Windows box yet, or he has not discovered the wonderful VirtualBox
V4.0 for Linux where he could install Windows as VM. ;)

> I'm sure people will continue to try and help you (myself included, where I
> can); as long as you're trying to help yourself too.

It is worth the climb.

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 14, 2011, 5:36:37 AM1/14/11
to RubyInstaller
Ok, so I tried according to Apache to generate a apxs foo project as
so:

http://httpd.apache.org/docs/2.0/programs/apxs.html

C:\Users\zdavatz\software>apxs -g -n foo
Creating [DIR] foo
Creating [FILE] foo/Makefile
Creating [FILE] foo/mod_foo.c
Creating [FILE] foo/.deps

and then I done

C:\Users\zdavatz\software\foo>apxs -c -i mod_foo.c

that resulted in

C:/MinGW/bin/gcc.exe -Wall -O2 -D WIN32 -D _WINDOWS -D NDEBUG -I"C:
\Apache2.2\include" /c /Fomod_foo.lo mod_foo.c
gcc.exe: /c: No such file or directory
gcc.exe: /Fomod_foo.lo: No such file or directory
In file included from C:\Apache2.2\include/ap_config.h:25:0,
from C:\Apache2.2\include/httpd.h:43,
from mod_foo.c:40:
C:\Apache2.2\include/apr.h:57:0: warning: ignoring #pragma warning
apxs:Error: Command failed with rc=65536

So this is a clear sign that the troubles are not with the source but
with the apxs_win32.pl or somewhere around there.

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 14, 2011, 7:47:42 AM1/14/11
to RubyInstaller
Just a short note: This does seem to work for Apache 2.0.64

http://url.ba/k6h8

Will test it now, if it works with our App.

Best
Zeno

Zeno R.R. Davatz

unread,
Jan 14, 2011, 8:46:07 AM1/14/11
to RubyInstaller
seems to work just fine, and it is version mod_ruby/1.2.4 in that
Windows-Installer file. Also Apache 2.0.64 just got released in
October 2010 so that should be fine to!

Lovely! Thanks for all your input.

My bounty still stands for getting mod_ruby 1.3.0 working on Apache
2.2.17 on Windows with mingw.

It it will work I will chip in an extra bonus for Luis Lavena because
his RubyInstaller is so great.

BTW: Where is that donate button for RubyInstaller? I think it is
really time to chip in some beer, coffee or other money for you guys!

Best
Zeno

Zeno R.R. Davatz

unread,
Feb 9, 2011, 3:56:53 AM2/9/11
to RubyInstaller
Hi Guys

Ok, mod_ruby (compiled with MinGW 3.4.5 on Windows Vista) now should
work on Apache 2.2.17 on Windows as well.

These are the steps how I done it:

http://dev.ywesee.com/wiki.php/Apache/Libapr-1

Thanks to the kind support of the Apache-Dev people who also taught me
some valuable lessons about windows.

If you load mod_ruby.so on Windows do not forget to add Ruby to your
System Path: http://url.ba/wees

Also Carsten told me a valuable lesson about Apache: http://url.ba/0ie8

This is the Thread: http://url.ba/45f8

Thanks again to you guys, specially Luis, without your help I also
would not have gotten this far.

Best
Zeno

Zeno R.R. Davatz

unread,
Feb 11, 2011, 9:05:27 AM2/11/11
to RubyInstaller
Ok, to round this of mod_ruby on Windows does not seem to be such a
smart idea after all. It is a fundamental Apache difference between
Windows and Linux.

http://url.ba/a0ni

The reason: Apache on Windows runs in a single process opening many
threads, whereas Apache on Linux serves requests from many processes.

http://httpd.apache.org/docs/2.2/platform/windows.html#cust

I find this quite intriguing.

Best
Zeno

Luis Lavena

unread,
Feb 11, 2011, 9:15:05 AM2/11/11
to rubyin...@googlegroups.com

I think you're interpreting the information incorrectly.

Apache on Linux uses multiple threads *and* multiple process, but due
the nature of Ruby -- not been multi-thread friendly -- mod_ruby is
run across the processes and not across threads.

That is why you get concurrent request with mod_ruby on Linux but that
can't happen on Windos since Apache is single process and mod_ruby
can't spawn multiple Ruby VMs per-thread.

One thing I would recommend for your application is look at Rack, and
build your HTTP communication form your application to the world using
it:

http://rack.rubyforge.org/

When using Rack, you can leverage not only on FastCGI (which allow
multiple long lived processes) or in tools like Thin, Mongrel or even
Passenger (mod_rails) on Linux.

That will put your software up to this decade in tool strategies.

Reply all
Reply to author
Forward
0 new messages