add-memberalign-toparrow-leftarrow-rightbellblockcalendarcamerachatchevron-leftchevron-rightchevron-small-downchevron-upcircle-with-crosscomposecrossfacebookflagfolderglobegoogleimagesinstagramkeylocation-pinmedalmoremuplabelShape 3 + Rectangle 1pagepersonpluspollsImported LayersImported LayersImported LayersshieldstartwitterwinbackClosewinbackCompletewinbackDiscountyahoo

Re: [ruby-99] Running Rails 3.0 and PHP site on the same domain

From: Noah
Sent on: Sunday, May 2, 2010 9:57 AM
  I don't, but it sounds pretty straightforward.   How do you plan to distinguish between the two?  Directory names?  Subdomains?  Rails 3.0 (and Rails 2.3, for that matter) are heavily Rack-ified, so it should be really easy to put in a very small Rack shim to trim off the leading directory name if you don't want to use it in your routing.  Or you could just write your routing table assuming it, if it's your app rather than something third-party you don't want to modify.

  I use NGinX.  I haven't used it with PHP, but I don't see any reason it would be difficult to use the two together.  Getting NGinX to route requests in a given directory to one backend, and a different directory (or subdomain) to a different backend, is really easy.  I assume Apache can do this too if you can figure out the Apache config files :-)

  The one difficult thing I'm seeing is if you want to run your PHP app in a subdirectory (rather than a subdomain), I'm not sure how to rewrite the URLs properly before it sees them.  In Rails, the answer would be "write a tiny little rack adapter to do it."  In PHP, I just don't know.  There's probably also some way to get NGinX to do it for you -- maybe "rewrite" without the "permanent" flag?  And again, in Apache you're on your own :-)

--- On Sun, 5/2/10, Bala Paranj <[address removed]> wrote:

> From: Bala Paranj <[address removed]>
> Subject: [ruby-99] Running Rails 3.0 and PHP site on the same domain
> To: [address removed]
> Date: Sunday, May 2, 2010, 9:10 AM
> Hello,
> I would like to run Expression Engine 2.0 CMS and Rails 3.0
> based site
> on the same domain. oes anyone have experience with this
> kind of
> project?
> Thanks,
> Bala
> --
> Please Note: If you hit "REPLY", your message will be sent
> to everyone on this mailing list ([address removed])
> http://www.meetup...­
> This message was sent by Bala Paranj ([address removed])
> from Silicon Valley Ruby Meetup.
> To learn more about Bala Paranj, visit his/her member
> profile: http://www.meetup...­
> To unsubscribe or to update your mailing list settings,
> click here: http://www.meetup...­
> Meetup, PO Box 4668 #37895 New York, New York[masked] |
> [address removed]


Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy