From: Osuka Adartse Date: 2004-02-11T12:35:55+09:00 Subject: Re: Help! Useko Netsumi wrote: > Need step by step instruction(and what other windows dlls to get) on how to > get CGI to work with my apache 2.0.48(windows version) for the following > scripting language: ruby, perl, and php. > > Thanks > > > > did this: #in the /apache2/conf/httpd.conf #adjust DocumentRoot "E:/dev/Daemon/Apache2/htdocs" to your dir holding the pages my case DocumentRoot "E:/dev/Daemon/Apache2/htdocs" --> DocumentRoot "e:/dev/webpub" #windows doesn't like .files so dot.htaccess works or whatever fancies you. AccessFileName dot.htaccess --> AccessFileName dot.htaccess --> IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t *.rb **Eruby install only [if you're going to use Eruby ALONE no mod_ruby]** download binary from ruby-mirror/binaries/mswin32|mingw/1.8/ext MSWIN http://www.ibiblio.org/pub/languages/ruby/binaries/mswin32/ext/eruby-1.0.4-i386-mswin32-1.8.zip MINGW http://www.ibiblio.org/pub/languages/ruby/binaries/mingw/1.8/ext/eruby-1.0.5-i386-mingw32-1.8.tar.gz or compile eruby with your compiler(mingw in my case) sources at http://modruby.net/ current: eruby-1.0.5.tar.gz tar -xvzf eruby-1.0.5.tar.gz ruby configure.rb --enable-shared && make && make install in httpd.conf add: AddType application/x-httpd-eruby .rhtml #use your own path to eruby Action application/x-httpd-eruby "e:/usr/local/bin/eruby.exe" AddType application/x-httpd-cgi .rhtml #not really needed AddHandler cgi-script .cgi add "+ExecCGI" directive to pertinent directories sections or add it in the global DocumentRoot(be warned thought, this allows executable cgis in ALL DocumentRoot an subdirs good for localhost but probably not smart for real servers). add as first line to the cgi files(*.rb,*.rhtml...) #!e:/usr/local/bin/eruby.exe <--change to own path, to avoid internal server errors. Save this in docroot as eruby_test.rhtml, run it. ------------------------------------ #!e:/usr/local/bin/eruby.exe <% begin require 'Find' #test to check requiring puts "Welcome to eruby Test
"
val=Dir["*"]
val.each do |entry|
   if FileTest.directory?(entry)
     print '[DIR]  #{entry}\t\t\t#{File.mtime(entry)}\n")
end
puts "
" rescue puts "Content-Type: text/plain" puts "

" puts "Error #{$!}: #{$!.backtrace}
" end ------------------------------------- **Install using mod_ruby + eruby** get mod_ruby binary at: http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/ sources at http://modruby.net/ copy *.so to apache2/modules/ add the line in httpd.conf from the source of eruby copy the /lib/apache + autoreload.rb to the \usr\local\lib\ruby\site_ruby\1.8 LoadModule ruby_module modules/mod_ruby.so Options Indexes FollowSymLinks ExecCGI AllowOverride None Order allow,deny Allow from all RubyRequire "E:/usr/local/lib/ruby/site_ruby/1.8/apache/ruby-run" SetHandler ruby-object RubyHandler Apache::RubyRun.instance SetHandler ruby-object RubyHandler Apache::ERubyRun.instance test file 1.rbx: -------------------- #!e:/usr/local/bin/ruby #print "HTTP/1.1 200 OK\n" #print "Content-Type: text/plain\n\n" require 'cgi' cgi = CGI.new cgi.out { "hello world" } -------------------- :-( been unable to run mod_ruby [Tue Feb 10 20:45:03 2004] [error] access to E:/dev/webpub/ruby/1.rbx failed for (null), reason: file permissions deny server execution OK maybe I'm doing something wrong on the conf file, so the files aren't autorized to execute...check later trying to run eruby_test gives me: [Tue Feb 10 20:47:01 2004] [error] mod_ruby: error in ruby (eval): (eval)uninitialized constant Apache::ERubyRun (NameError) from (eval):0:in `value' the *.so doesn't have eruby support? SO I get my conf back to eruby only, anyway eruby is enough for me, there's fcgi but haven't gotten around installing it. php? install is quite simple, thought(like eruby) but there's files that need to be copied here and there, mostly php4apache2.dll,php4ts.dll to php dir and lots|few changes to php ini depending on your needs, easier to go but, been there...now using eruby. perl, :-O? well never have used it, but it should be as eruby/cgi: #!/usr/bin/perl -code- install Activeperl point your *.pl with a shebang and done hope it helps, btw got around thumbnails? ;-)