Forum: Ruby on Rails Rails & PHP

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.
Jared T. (Guest)
on 2006-03-28 11:47
(Received via mailing list)
Hi there - I wanted to know if anyone has used Rails & PHP on the same
production server and whether they've experienced any problems.

I'm looking to install rails on our production soon, however I would
like to know if there are any issues I need to be aware about.

Many thanks,

Jared.
Dev Random (Guest)
on 2006-03-28 16:20
(Received via mailing list)
Hi,

Jared T. <jared.telling@...> writes:
> Hi there - I wanted to know if anyone has used Rails & PHP on the same
> production server and whether they've experienced any problems.

What do you meen by "the same production server"? Are Rails and PHP
going to run
in different processes on the same machine? This should be no problem.
Are they
going to run behind the same HTTP server? Which?

Regards
Jared T. (Guest)
on 2006-03-28 17:16
(Received via mailing list)
Hi - not sure why i said production - i just mean on the same server. We
currently develop our sites in PHP and would like to start developing
new projects in Rails, once we're up to spead on it. We're going to have
to run both our php and rails sites on the same server so I wanted to
know if this is possible and whether there's any conflicts between them.
I'd assume they'd both run on apache and access mysql.

Hope this makes sense.

Cheers - Jared.
kris (Guest)
on 2006-03-28 17:18
Lighttpd web server can allow some requests to go to Rails and others to
go to PHP, and others to deliver static content. Have a look at a
lighttpd.conf file.

Jared T. wrote:
> Hi - not sure why i said production - i just mean on the same server. We
> currently develop our sites in PHP and would like to start developing
> new projects in Rails, once we're up to spead on it. We're going to have
> to run both our php and rails sites on the same server so I wanted to
> know if this is possible and whether there's any conflicts between them.
> I'd assume they'd both run on apache and access mysql.
>
> Hope this makes sense.
>
> Cheers - Jared.
Jared T. (Guest)
on 2006-03-28 17:24
(Received via mailing list)
thanks - the only thing is we have a dedicated server and it's all
config'd with apache - im not that experienced with servers so im not
sure how easy it will be to install lighttpd - ill check it out though.

cheers.
Michael T. (Guest)
on 2006-03-28 18:36
(Received via mailing list)
Just to keep things simple I used two IP's and bound the PHP stuff to
one IP and the other to Rails.  In my case I'm using Apache for the
PHP stuff and Lighttpd for the Rails stuff.

Michael
David D. (Guest)
on 2006-03-28 19:32
(Received via mailing list)
Rails is essentially a collection of CGI scripts, so there's no reason
PHP
and Rails can't coexist. The way I've done this in the past is that I've
set
up my Rails app somewhere away from my document root, and created a
symbolic
link to the Rails app's public folder from my docroot.

http://mydomain.tld/addressbook/.So if I create the symlink
"addressbook" in
my docroot /home/ddemaree/web/public, pointing to my Rails app in
/home/ddemaree/web/addressbook/public, I can access my Rails app at

Everything else on that domain can be static content, PHP, whatever you
like, and the Rails files can still be managed separately from the
PHP/static files. This is just a simple, clean way to run a Rails app
and
other sorts of web content under the same virtual host.

- DD



On 3/28/06, Jared T. <removed_email_address@domain.invalid> wrote:
> Lighttpd web server can allow some requests to go to Rails and others to
> I'd assume they'd both run on apache and access mysql.
>
>
>


--


David D.
Owner and Web Chef, Practicalmadness
removed_email_address@domain.invalid
Jared T. (Guest)
on 2006-03-28 19:34
(Received via mailing list)
Hi Michael,

Sounds interesting! Cheers for the info.

J.
Jón B. (Guest)
on 2006-03-28 19:39
(Received via mailing list)
Interesting...

Have you ever done the reverse?
That is having the domain.com/ being the rails app such as typo and
then making domain.com/forum to be a php forum app?

Wondering if you could use the apache alias functions to do it or if
there are more elegant solutions.

On 3/28/06, David D. <removed_email_address@domain.invalid> wrote:
> Everything else on that domain can be static content, PHP, whatever you
> >
> go to PHP, and others to deliver static content. Have a look at a
> know if this is possible and whether there's any conflicts between them.
> _______________________________________________
>
>
--
David D. (Guest)
on 2006-03-28 19:52
(Received via mailing list)
I've never tried it personally, but there's no reason it couldn't be
done.
You'd have to fuss with the .htaccess or lighttpd.conf file, however, to
explicitly "escape" that path from Rails routing.

In .htaccess, I'd add this rewrite rule immediately after `RewriteEngine
On`
(assuming that the forum is set up in /forum, either as a symlink or --
what
the hell -- actually living inside your Rails app's public folder):

RewriteRule ^forum/.*$ - [QSA,L]

In lighttpd.conf, you'd need to add an $HTTP['url'] block that routes
requests for `/forum` to your PHP forum software; I don't know the
syntax
off the top of my head but it's not very complicated to do this.

The main difference between doing this under Apache vs. lightty is that
you'll have to set up lighttpd to handle the forum scripts as PHP
(especially if you want to take advantage of fastcgi), whereas Apache
should
be able to pick right up with no further configuration.

- DD



On 3/28/06, Jon Gretar B. <removed_email_address@domain.invalid> wrote:
> On 3/28/06, David D. <removed_email_address@domain.invalid> wrote:
> to
> >
> > it will be to install lighttpd - ill check it out though.
> > Jared T. wrote:
> >
> > removed_email_address@domain.invalid
> > David D.
>
> --
> --------------
> Jon Gretar B.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>



--


David D.
Owner and Web Chef, Practicalmadness
removed_email_address@domain.invalid
Rob M. (Guest)
on 2006-03-28 20:10
(Received via mailing list)
Jared,
     My company is in the same position as yours.  We had a dedicated
box
with all of our PHP and Apache stuff set up and didn't want to introduce
any
breakage or conflicts.  While many people recommend setting up lighttpd
and
proxying from apache to lighthttpd that seemed like too much
administration
and two web servers == 2 times the possible breakages.  We installed
SCGI
and have been happy with the results that we are getting.  It runs well
with
Apache and seems to serve up rails pages just as fast as mod_php does
PHP
pages.

Rob
http://www.migrob.com
Jared T. (Guest)
on 2006-03-28 20:51
(Received via mailing list)
Hi Rob,

Thanks for the info - that sounds like a really interesting option,
which I'll look into.

Cheers,

Jared.
Steve R. (Guest)
on 2006-03-29 04:03
(Received via mailing list)
I'm serving PHP directly through Apache (mod_php) and Rails using
lighttpd
behind the Apache port forward. The idea of symlinking is great, except
that
the PHP and Rails apps are running on two different server processes.

Is there something I'm missing? Being able to softly transition PHP
sites
would really rock.

Thanks
--
View this message in context:
http://www.nabble.com/Rails-PHP-t1354135.html#a3640846
Sent from the RubyOnRails Users forum at Nabble.com.
This topic is locked and can not be replied to.