Forum: Ruby on Rails Rails on Apache

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
622e17215446e2c8c688b7476e856d1d?d=identicon&s=25 pverhoye (Guest)
on 2005-11-15 00:05
(Received via mailing list)
Hi all,

I'm new to rails (and ruby) so be kind :-)

I have a small server running W2K on which apache (2.0.x) is running
with
the latest version of ruby and rails (I followed the howto on
rubyonrails.org <http://rubyonrails.org>). However, I want to do the
following:
I have a domain (www.domain.org <http://www.domain.org>) configured on
the
server as follows:
<VirtualHost *:80>
 ServerAdmin webmaster@domain.org
 DocumentRoot D:/data/www/domain.org
 ServerName www.domain.org <http://www.domain.org>
 ErrorLog logs/www.domain.org-error_log
 CustomLog logs/www.domain.org-access_log common
 Alias /h2o d:/data/www/rails.domain.org/h2o/public/
 <Directory "d:/data/www/rails.domain.org/h2o/public/">
 Options ExecCGI FollowSymLinks
 AllowOverride all
 Allow from all
 Order allow,deny
 AddHandler cgi-script .cgi
 AddHandler fastcgi-script .fcgi
 </Directory>
</VirtualHost>

What I want to do is to serve the h2o application from a different
documentroot than the normal website (which is plain html). No, I don't
know
if this makes sense or not but bear with me if it remotely does :-)

The dispatch.fcgi in the public folder has as first line
#!D:/data/apps/ruby/bin/rubyw
As mentioned in the HOWTO

The .htaccess file looks lik this:
# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain
requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]

# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On

# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
# Alias /myrailsapp /path/to/myrailsapp/public
# RewriteBase /myrailsapp

#Alias /h2o d:/data/www/rails.apro.be/h2o/public/
RewriteBase /h2o

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which
will
be rendered instead
#
# Example:
# ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to
start properly"

Now, the problem is that the application does not work. The URL to start
is
htt://www.domain.org/h2o/account/login. However, this page gives me a
timeout in the logs.

Can someone help me with this?

Many thanks!

BB
Peter
622e17215446e2c8c688b7476e856d1d?d=identicon&s=25 pverhoye (Guest)
on 2005-11-15 16:11
(Received via mailing list)
Hi all,

I'm new to rails (and ruby) so be kind :-)

I have a small server running W2K on which apache (2.0.x) is running
with
the latest version of ruby and rails (I followed the howto on
rubyonrails.org <http://rubyonrails.org>). However, I want to do the
following:
I have a domain (www.domain.org <http://www.domain.org>) configured on
the
server as follows:
<VirtualHost *:80>
 ServerAdmin webmaster@domain.org
 DocumentRoot D:/data/www/domain.org
 ServerName www.domain.org <http://www.domain.org>
 ErrorLog logs/www.domain.org-error_log
 CustomLog logs/www.domain.org-access_log common
 Alias /h2o d:/data/www/rails.domain.org/h2o/public/
 <Directory "d:/data/www/rails.domain.org/h2o/public/">
 Options ExecCGI FollowSymLinks
 AllowOverride all
 Allow from all
 Order allow,deny
 AddHandler cgi-script .cgi
 AddHandler fastcgi-script .fcgi
 </Directory>
</VirtualHost>

What I want to do is to serve the h2o application from a different
documentroot than the normal website (which is plain html). No, I don't
know
if this makes sense or not but bear with me if it remotely does :-)

The dispatch.fcgi in the public folder has as first line
#!D:/data/apps/ruby/bin/rubyw
As mentioned in the HOWTO

The .htaccess file looks lik this:
# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain
requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]

# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On

# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
# Alias /myrailsapp /path/to/myrailsapp/public
# RewriteBase /myrailsapp

#Alias /h2o d:/data/www/rails.apro.be/h2o/public/
RewriteBase /h2o

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which
will
be rendered instead
#
# Example:
# ErrorDocument 500 /500.html

ErrorDocument 500 "<h2>Application error</h2>Rails application failed to
start properly"

Now, the problem is that the application does not work. The URL to start
is
htt://www.domain.org/h2o/account/login. However, this page gives me a
timeout in the logs.

Can someone help me with this?

Many thanks!

BB
Peter
C618e1d9ffa1bd1a6b6edc8ad4edec63?d=identicon&s=25 mannl (Guest)
on 2005-11-15 17:00
(Received via mailing list)
Someone correct me if I'm wrong, but as far as I know Apache 2.0.x is
not very stable with fastcgi. People usually find Apache 1.3.x works
better.


My personal preference is to use "ruby script/server" for
development, and lighttpd on the production server (I have a Virtual
Private Server).

Apache only gave me headaches.


That doesn't exactly help you out with your issue, just a tip :)
cheers, Rob
2d52c69580d87a6e570637a48ee82b09?d=identicon&s=25 chartjes (Guest)
on 2005-11-15 17:42
(Received via mailing list)
I haven't had any problems with Apache2 and fastcgi at all, both on my
iBook (development environment) and on the host where it runs (AMD64
box running Apache2 under Gentoo Linux).

I've been having far more difficulty getting lighttpd to work properly
on my iBook with a slightly non-standard (read: no examples on the
net) configuration.

On 11/15/05, Robert <mannl@gmx.com> wrote:
>
>
> That doesn't exactly help you out with your issue, just a tip :)
> cheers, Rob
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Chris Hartjes

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard
5b2bde5812466012d9dde870c258254f?d=identicon&s=25 fabienpenso (Guest)
on 2005-11-15 22:44
(Received via mailing list)
On 11/15/05, Robert <mannl@gmx.com> wrote:
> Someone correct me if I'm wrong, but as far as I know Apache 2.0.x is
> not very stable with fastcgi. People usually find Apache 1.3.x works
> better.

Apache 2.0 works fine with fastcgid (not fastcgi), which kills old
fastcgi process.

I use a frontend apache because I want to deliver compressed page
through mod_gzip, and as far as I've seen it, lighttpd doesn't support
that (someone confirm?).
09b87770d7b50f3a7f913984477eea23?d=identicon&s=25 speechexpert (Guest)
on 2005-11-15 23:20
(Received via mailing list)
Can someone tell me a host where I can deploy a Rails app?
What is the easiest way to do this?
Am I stuck with a colocated server or are there hosted platforms that
make
it easier to deploy and scale?
Anyone?
Thanks in advance!
John B
PS - I know this has multiple answers - just looking for opinions..
5cfd7e9223637ea26c81c2cc3e43799e?d=identicon&s=25 craig (Guest)
on 2005-11-15 23:26
(Received via mailing list)
On 15 Nov 2005, at 22:16, speechexpert wrote:
> Can someone tell me a host where I can deploy a Rails app?
> What is the easiest way to do this?
> Am I stuck with a colocated server or are there hosted platforms
> that make it easier to deploy and scale?
> Anyone?
> Thanks in advance!

At the moment I know of planet argon and Xeriom.
We're still testing our Rails platform so you might be better going
for them:
http://www.planetargon.com/

Yours,
Craig
--
Craig Webster | t: +44 (0)131 516 8595 | e: craig@xeriom.net
Xeriom.NET    | f: +44 (0)709 287 1902 | w: http://xeriom.net
B84d42a3a5c343f8fc6ab7d7f47fd3f5?d=identicon&s=25 robby.lists (Guest)
on 2005-11-15 23:47
(Received via mailing list)
On Tue, 2005-11-15 at 22:24 +0000, Craig Webster wrote:
> for them:
> http://www.planetargon.com/

You can ping us on IRC as well...

#planetargon on irc.freenode.net...

or via our site:

- http://www.planetargon.com/chat.html

We don't just hand you the keys to your ssh account and wish you luck...
we'll help make sure your site is running smoothly. (been known to even
assist with making a few code changes to help optimize client
applications).

http://www.planetargon.com/hosting.html (rates/plans)

Also, we've recently begun offering private IP addresses for +$3/mo so
that you can run Lighttpd on your own port WITHOUT mod_proxy through our
Apache servers. It makes Rails apps just a tad bit faster. :-D

I've heard good things about Site5 (www.site5.com) as well... but they
don't offer PostgreSQL. ;-)

Good luck on your quest for good hosting. I know it can be tough.

Cheers,

-Robby


--
/******************************************************
* Robby Russell, Founder.Developer.Geek
* PLANET ARGON, Rails Development, Consulting & Hosting
* Portland, Oregon  | p: 503.351.4730 | f: 815.642.4068
* www.planetargon.com | www.robbyonrails.com
* Programming Rails   | www.programmingrails.com
*******************************************************/
This topic is locked and can not be replied to.