Forum: Ruby on Rails Newbie - Help Please

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.
Joe P. (Guest)
on 2006-03-09 23:48
I am just getting off the ground with RoR. (actually just walking out to
the runway)
I want to setup a development / test environment as close to the
production environment as possible except for OS (Win XP for Dev, Linux
for Prod).
I have Apache, MySQL, PhP installed and operating close enough to the
production environment that all the PhP stuff I've done in the past
seems to work fine.
I have installed Ruby, Gems, and Rails, and maybe (not quite sure)
FastCGI on my home (development) machine running Windows XP.

There are two things that I need help with:
1)  I need to use my development Apache Server for RoR development &
testing as well as maintenance and improvements to my existing PhP based
site.  All of the apache configuration advice I have read seems to want
to point apache only to a single RoR app by changing the document root.
How can I make it so that i can go to www.myphpdomain.tst I get the php
site, and when i go to www.myrailsdomain.tst I get the ralis app.
Extending the concept, I'd like to be able to go to
www.my2ndrailsdomain.tst and get a 2nd rails app.  To date I'm using the
host file to route www.myphpdomain.tst to 127.0.0.1.  I don't mind if
the urls for the sites point to subordinate folders (like
www.mydomain.tst/railsapp)

2)How can I tell if I have FastCGI installed and configured correctly
(apache2)?

I know that I do not need to tackle these problems to learn RoR, but If
I cannot tackle them then learning RoR may be a pointless exercise for
me.

Thanks in advance!
joe
Josh on Rails (Guest)
on 2006-03-10 00:01
(Received via mailing list)
On 3/9/06, Joe P. <removed_email_address@domain.invalid> wrote:
>
> I want to setup a development / test environment as close to the
> production environment as possible except for OS (Win XP for Dev, Linux
> for Prod). [...] I know that I do not need to tackle these problems to learn
> RoR, but If I cannot tackle them then learning RoR may be a pointless
> exercise for me.


Honestly, the easiest thing to do, is use WebBrick on your development
machine. The "different dev / prod environment" issues are *extremely*
minor
in most cases. With WebBrick, you access your Rails site at
localhost:3000/
and your PHP site at localhost:80/

How can I make it so that i can go to www.myphpdomain.tst I get the php
> site, and when i go to www.myrailsdomain.tst I get the ralis app.


 I'd create a virtual host for myrailsdomain that points to
/home/you/rails-app/public . For multiple rails apps, substitute
"rails-app1" for "rails-app".

How can I tell if I have FastCGI installed and configured correctly
> (apache2)?
>

Change public/.htaccess from "dispatch.cgi" to "dispatch.fcgi" and see
what
happens?



-- Joshua
Joe P. (Guest)
on 2006-03-10 01:03
Josh on Rails wrote:
<snip>
>
> Honestly, the easiest thing to do, is use WebBrick on your development
> machine. The "different dev / prod environment" issues are *extremely*
> minor
> in most cases. With WebBrick, you access your Rails site at
> localhost:3000/
> and your PHP site at localhost:80/
>

<snip>
>

> -- Joshua

Thanks Joshua.
I'd use WebBrick but I'm going to want to try to integrate some PHP
scripts into the site as well... I don't want to re-write the universe
if I can avoid it.
joe
Neil D. (Guest)
on 2006-03-10 01:45
(Received via mailing list)
Joe P. wrote:
>
> if I can avoid it.
> joe
>
I am using lighttpd with fastcgi, the only trouble I had is that I
needed to compile the fastcgi from source as the RPM wasn't correct.
But it has been working for some time now without any troubles at all,
and php can also be used if needed.

It is reasonable fast, on my 800MHz computer it manages to serve a
complex page (4 different tables involved) in about 0.7 secs, tested
with the apache test program 'ab'.

Regards Neil.
Josh on Rails (Guest)
on 2006-03-10 05:11
(Received via mailing list)
On 3/9/06, Joe P. <removed_email_address@domain.invalid> wrote:
>
> Thanks Joshua.
> I'd use WebBrick but I'm going to want to try to integrate some PHP
> scripts into the site as well...
>

Sure, but you're going to link to the PHP pages, right?
"myphpdomain.tst/script.php"
or something, I think? How is that different/better than
"localhost:80/script.php" ?
Joe P. (Guest)
on 2006-03-10 07:05
Josh on Rails wrote:
> On 3/9/06, Joe P. <removed_email_address@domain.invalid> wrote:
>>
>> Thanks Joshua.
>> I'd use WebBrick but I'm going to want to try to integrate some PHP
>> scripts into the site as well...
>>
>
> Sure, but you're going to link to the PHP pages, right?
> "myphpdomain.tst/script.php"
> or something, I think? How is that different/better than
> "localhost:80/script.php" ?

I must confess that I am not yet familiar enough with RoR capabilities
or limitations to adequately describe any particular problem.  However,
just as an example say I have an existing SMF forum and use their SSI
PHP functions to display recent posts in pages that have their emphasis
focused in areas other than the forum. I'd prefer to use these functions
to the degree possible rather than re-inventing them in rials... perhaps
I'm just being unrealistically lazy ;-)
joe
This topic is locked and can not be replied to.