Forum: Ruby on Rails lighttpd and Apache .. will they play together?

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.
John N. Alegre (Guest)
on 2006-02-24 18:18
(Received via mailing list)
Can someone point me to a tutorial or web example of doing this ...

I want to have a site that is normally pure content served via Apache
and I
want to set up a Rails app on the same box that is served via lighttpd.
Now
I want the Apache site to be able to retrieve formatted pages for MySQL
database queries by the Rails app.  I will also be using ActionMailer
under
the Rails app.

How can I get those two things to work together.  The Apache server
talks to
the default port 80 and I have the lighttpd talking to another port on
the
same machine.  The port that lighttpd talks to is not open to the
Firewall
but can be reached with localhost:XXXX.

All comments welcome
john
James L. (Guest)
on 2006-02-24 18:24
(Received via mailing list)
On 2/24/06, John N. Alegre <removed_email_address@domain.invalid> wrote:
> same machine.  The port that lighttpd talks to is not open to the Firewall
> but can be reached with localhost:XXXX.

http://wiki.rubyonrails.org/rails/pages/HowToInsta...

I have no idea if this actually works or not, but I've been doing some
reading because I have the exact situation coming up soon.  (i.e. PHP
apps running behind Apache virtual hosts, with the need to add
lighttpd+Rails on a new virtual host on the same box)

-- James
Brian V. Hughes (Guest)
on 2006-02-24 19:03
(Received via mailing list)
James L. wrote:
> On 2/24/06, John N. Alegre <removed_email_address@domain.invalid> wrote:
>> How can I get those two things to work together.  The Apache server talks to
>> the default port 80 and I have the lighttpd talking to another port on the
>> same machine.  The port that lighttpd talks to is not open to the Firewall
>> but can be reached with localhost:XXXX.
>
> 
http://wiki.rubyonrails.org/rails/pages/HowToInsta...
>
> I have no idea if this actually works or not, but I've been doing some
> reading because I have the exact situation coming up soon.

Yes, the Apache config on that HowTo page will work just fine. I'm not
sure I
fully agree with the use of RewriteEngine, when ProxyPass should work
just fine,
with less memory impact on your Apache processes, but if you need to
send any
custom HTTP headers in to your Rails app, from the Apache side, then
mod_rewrite
is what you need to use.

This is what I do, using a really nice writeup from James Duncan
Davidson:

<http://duncandavidson.com/essay/2006/01/railsRever...

He's doing Apache front-ending for his Rails apps in the same way that I
am.

-Brian
John N. Alegre (Guest)
on 2006-02-24 20:47
(Received via mailing list)
Brian,

Thanks for the pointers.

Considering the Apache problems with FastCGI and the issue of drag
with a relaunch of the Ruby interpreter for each CGI call it would be
my opinion that for a small App doing what we are talking about here,
i.e. running the Rails app under lighttpd and have Apache talk to it
would be pretty common.

On another note.  What would be the issues changed if lighttpd was on
another box on the same LAN ??

Thanks for your continued comments.

john
Ezra Z. (Guest)
on 2006-02-24 21:32
(Received via mailing list)
On Feb 24, 2006, at 8:24 AM, James L. wrote:

>> ActionMailer under
> http://wiki.rubyonrails.org/rails/pages/
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


	Here is an example of the apache vhosts I use to do this same thing.
One for apache 1.3 and one for 2.X.:

http://brainspl.at/articles/2005/11/08/apache-vhos...
lighttpd-on-a-higher-port


	You will need to do some fiddling if you want to proxy not
everything but just a few urls.

Cheers-
-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid
This topic is locked and can not be replied to.