XAMPP Apache to Serve RoR on Windows?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP Apache to Serve RoR on Windows?

Postby rquaid.pro » 03. September 2010 12:44

Hello all,

After much wrestling and whatnot I've finally managed to get RoR to work on my Windows-based server. I'm attempting to get a RoR app that a friend wrote to work but I've run into some problems. Right now, I can get it to fire using WEBrick, but I'd like to get it to work through Apache (from an XAMPP package) if possible. When I try to load it from Apache, it dumps the dispatch.fcgi file to the browser in plain text. I've tried to find a solution on various forums but the only thing that I've found is a suggestion to add the following to the httpd.conf file:

Code: Select all
Listen 3000
LoadModule rewrite_module modules/mod_rewrite.so
#################################
# RUBY SETUP
#################################
<virtualHost *:3000>
ServerName rails
DocumentRoot "c:/xampp/htdocs/kcseneschal/public"
<Directory "c:/xampp/htdocs/kcseneschal">

Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi

</Directory>
</VirtualHost>
#################################
# RUBY SETUP
#################################


I've also tried adding that to httpd-vhosts.conf but I get the same result. Is there a solution to this or will I have to use another program to serve RoR apps?

Thanks in advance for any help,
-Quaid
rquaid.pro
 
Posts: 4
Joined: 01. September 2010 09:04

Re: XAMPP Apache to Serve RoR on Windows?

Postby JonB » 03. September 2010 14:32

AFAIK - FastCGI is incompatible with the thread-safe compilation of Apache/PHP that is shipped with XAMPP

FastCGI assumes a persistent model, Apache Software Foundation's Win32 compiles are threaded, VC6 variants. FastCGI does work with IIS 6 & 7. (and probably some 'other' Apache for Windows & PHP compiles)

That is probably why there is no fastcgi executable shipped wth XAMPP. (you need an executable to run FastCGI, again - AFAIK) PHP as a CGI makes it a program running under the CGI model, no longer an Apache DLL. :idea:

The relevant parts of the Apache configuration are in xammp\apache\conf\extra\xampp-httpd.conf
Note this: C:/xampp/php/php5ts.dll

Code: Select all
# PHP-Module setup
#
LoadFile "C:/xampp/php/php5ts.dll"
LoadModule php5_module modules/php5apache2_2.dll

<IfModule php5_module>
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>

    PHPINIDir "C:/xampp/php"
</IfModule>

#
# PHP-CGI setup
#
<IfModule !php5_module>
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php-cgi
    </FilesMatch>
    <IfModule actions_module>
        Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
    </IfModule>
</IfModule>


The best persons to ask would probably be Oswald. I'll see if he can check my facts.

Good Luck
:)

http://www.apachelounge.com/viewtopic.php?t=3616
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 55 guests