[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rails and Apache

slunky

5/1/2006 7:15:00 PM

I'm looking for a tutorial or some tips on getting RoR to play nice with
Apache. This is a virtual host, and I have access to my httpd.conf. I've
looked at a few, but they're all very vague. The tutorial on
wiki.rubyonails.com just confuses me. Does anyone have an idea on how to
get it to work? Maybe I should ask on an Apache group?

--
-slunky
11 Answers

greg.kujawa

5/1/2006 7:47:00 PM

0

slunky wrote:

> I'm looking for a tutorial or some tips on getting RoR to play nice with
> Apache. This is a virtual host, and I have access to my httpd.conf. I've
> looked at a few, but they're all very vague. The tutorial on
> wiki.rubyonails.com just confuses me. Does anyone have an idea on how to
> get it to work? Maybe I should ask on an Apache group?


Are you talking about this tutorial -->
http://wiki.rubyonrails.org/rails/page... ? It goes through what
to put into the Apache configuration file so that the Rails app folders
can be accessed. Then you can increase performance via tweaking the CGI
by switching over to FastCGI. This is done by changing a Rails dispatch
configuration file.

I haven't setup Rails on Apache in awhile (like almost a year now) but
IIRC it wasn't too involved once everything was installed. I also
recommend posting this question to the Rails mailing list
(http://lists.rubyonrails.org/mailma...) as your replies might
come quicker.

greg.kujawa

5/1/2006 7:51:00 PM

0

Here's another link that goes over some of the work that needs to be
done to get Rails to work with Apache -->
http://wiki.rubyonrails.com/rails/pages/Fast+CGI+and+Apache2+for+....

slunky

5/1/2006 7:54:00 PM

0

_/ gregarican wrote \_
> Are you talking about this tutorial -->
> http://wiki.rubyonrails.org/rails/page... ?

That's the one. I don't understand what to put under path/application/
Do I link it to the app/ directory?

> It goes through what
> to put into the Apache configuration file so that the Rails app folders
> can be accessed. Then you can increase performance via tweaking the CGI
> by switching over to FastCGI. This is done by changing a Rails dispatch
> configuration file.

I'll try that tool.

> I haven't setup Rails on Apache in awhile (like almost a year now) but
> IIRC it wasn't too involved once everything was installed. I also
> recommend posting this question to the Rails mailing list
> (http://lists.rubyonrails.org/mailma...) as your replies might
> come quicker.

I prefer newsgroups, but if I get desperate I will. Thanks for the info.
I think I'll just set it down. I've been working on this for two days,
and maybe I just need a chear head.

--
-slunky

greg.kujawa

5/1/2006 8:06:00 PM

0

Here are some pertinent lines from my httpd.conf file:

httpd.conf
--------------

<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>

<IfModule mod_ruby.c>
# for Apache::RubyRun
RubyRequire apache/ruby-run
RubyRequire apache/eruby-run
</IfModule>

# exec files under /ruby as ruby scripts
<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options +ExecCGI
</Location>

# handle files under /eruby as eRuby files
<Location /eruby>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Location>

# exec *.rbx as ruby scripts
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>

# handle *.rhtml files as eRuby files
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>

<VirtualHost *:8080>
ServerAdmin me@my-email-address.com
ServerName rails
DocumentRoot "c:/program files/apache
group/apache2/htdocs/po/public"
ErrorLog logs/rails_error.log
<Directory "c:/program files/apache
group/apache2/htdocs/po/public">
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AllowOverride all
Order allow,deny
Allow from 10.0.0.0/255.255.0.0
</Directory>
</VirtualHost>

So you would point the Apache server to your public folder created
under your Rails application name. In my case I have a 'po' Rails app
name (it's a purchase order app), so I point Apache to .../po/public.
The allow/deny stuff allows only local private IP's to conenct to my
Rails virtual host.

The other lines in the config file mostly setup how Apache processes
Ruby code embedded in its web content. Is this becoming any clearer?

Morten

5/1/2006 9:17:00 PM

0


Apache is easy to setup with SCGI.
http://wiki.rubyonrails.org/rails/pages/SCGI+Rails+Runner+with+Apache+...

Alternatively, it's even simpler to run Rails using Mongrel and ProxyPass:

<VirtualHost a.b.c.d>
ServerName www.mydomain.com
ProxyPass / http://127.0...
ProxyPassReverse / http://127.0...
</VirtualHost>


> I prefer newsgroups, but if I get desperate I will. Thanks for the info.
> I think I'll just set it down. I've been working on this for two days,
> and maybe I just need a chear head.

Check out gmane.org for a newsgroup (NNTP) interface to lots and lots of
mailing lists.

Morten

slunky

5/1/2006 9:33:00 PM

0

_/ Morten wrote \_
> Apache is easy to setup with SCGI.
> http://wiki.rubyonrails.org/rails/pages/SCGI+Rails+Runner+with+Apache+...
>
> Alternatively, it's even simpler to run Rails using Mongrel and ProxyPass:

Problem with that is I'm not an administrator on this system, I only
have Apache and FastCGI, and could request more packages, but probably
nothing as grand as a new http server.

> Check out gmane.org for a newsgroup (NNTP) interface to lots and lots of
> mailing lists.

I will. Thanks.

--
-slunky

slunky

5/2/2006 5:11:00 AM

0

> Ruby code embedded in its web content. Is this becoming any clearer?

Yes, this has been a great help. I'm going to try it out tommorrow, and
I'll get back and make sure to share my configuration. There doesn't
seem to be a lot this type of thing out there.

--
-slunky

P. Rajah

11/14/2009 3:57:00 AM

0

harmony wrote:

> hey, i just heard today barck obama's half brother, who is total balck,

He's not a "total balck", you ignorant half-wit! His mother is a white
Jewish-American.

> lives in china, married to a chinese woman. it's happening in china, which
> now is well disposed to my advice that calls for chinese investment in black
> education.

No doubt Mark Obama received his education at the well known Chinese
universities, Brown, Stanford and Emory.

> needless to say that it is a proven fact that when people listen
> to me they are known to be happy.

How can you prove something based on false assumptions? The only people
who've listened to you are the ones you exhorted to go out and stab
Indian Muslims and Christians, and it's doubtful just how happy they
are. I suspect that they have cruelly tortured minds, much as you do.

rst0wxyz

11/16/2009 3:33:00 AM

0

On Nov 13, 7:10 pm, "harmony" <a...@hotmail.com> wrote:
> hey, i just heard today barck obama's half brother, who is total balck,
> lives in china, married to a chinese woman. it's happening in china, which
> now is well disposed to my advice that calls for chinese investment in black
> education. needless to say that it is a proven fact that when people listen
> to me they are known to be happy.

Who are you? and why would they listen to you?

>
> "Penang" <kalamb...@gmail.com> wrote in message
>
> news:39536158-7c62-4796-bcfe-0948d339ac9f@u16g2000pru.googlegroups.com...
> I can't stop shaking my head when I read that piece.
>
> Racism?
>
> Keeping to oneself is racism?

That is the truest form of racism, keeping everyone out except your
own kind.

>
> Why should one open its border to apes and monkeys just because one
> wants to be a "non-racist"?
>
> Germany, nay, the Western Europe is drowning under a deluge of black
> and brown skinned people. Every single day, over 20,000 of blacks and
> browns flock to Europe.
>
> And we ain't start to count those black / brown babies born  there.
>
> In England, there are more brown/black babies born than the white
> babies, do you know that?
>
> And in America, things don't fare better either.

Yes, they do fare better. One of them is the president of the United
States.

> The brown and blacks
> are soooooooooo many !!
>
> They are everywhere !

You must be claustrophobic, the brown and black people are all around
you, HELP!!!

>
> Worse of all, most of them not only not contributing to the society,

Many are contributing to society. You just refused to see it.

> they are burdening it.
>
> Seeing what is happening in Europe and United States, why should
> Japan, Korea and China open their borders to those apes?

Because we ALL came from the apes!!!!

>

harmony

11/16/2009 6:40:00 PM

0


"rst0wxyz" <rst0wxyz@yahoo.com> wrote in message
news:ee3ec292-faba-4331-b68b-7649642ea9c6@d9g2000prh.googlegroups.com...
On Nov 13, 7:10 pm, "harmony" <a...@hotmail.com> wrote:
> hey, i just heard today barck obama's half brother, who is total balck,
> lives in china, married to a chinese woman. it's happening in china, which
> now is well disposed to my advice that calls for chinese investment in
> black
> education. needless to say that it is a proven fact that when people
> listen
> to me they are known to be happy.

<<Who are you? and why would they listen to you?>>

for now it is enough to know - from the various examples i have cited in
past - that that they are listening to me - and are happy because of it.
there is nobody better suited to train the black people (who need a lot of
regimentation) than the chinese (who are among the most disciplined people).


>
> "Penang" <kalamb...@gmail.com> wrote in message
>
> news:39536158-7c62-4796-bcfe-0948d339ac9f@u16g2000pru.googlegroups.com...
> I can't stop shaking my head when I read that piece.
>
> Racism?
>
> Keeping to oneself is racism?

That is the truest form of racism, keeping everyone out except your
own kind.

>
> Why should one open its border to apes and monkeys just because one
> wants to be a "non-racist"?
>
> Germany, nay, the Western Europe is drowning under a deluge of black
> and brown skinned people. Every single day, over 20,000 of blacks and
> browns flock to Europe.
>
> And we ain't start to count those black / brown babies born there.
>
> In England, there are more brown/black babies born than the white
> babies, do you know that?
>
> And in America, things don't fare better either.

Yes, they do fare better. One of them is the president of the United
States.

> The brown and blacks
> are soooooooooo many !!
>
> They are everywhere !

You must be claustrophobic, the brown and black people are all around
you, HELP!!!

>
> Worse of all, most of them not only not contributing to the society,

Many are contributing to society. You just refused to see it.

> they are burdening it.
>
> Seeing what is happening in Europe and United States, why should
> Japan, Korea and China open their borders to those apes?

Because we ALL came from the apes!!!!

>