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.
Hi, Jared Telling <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
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. Dev Random wrote:> Hi, > > Jared Telling <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 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/748257b5/attachment-0001.html
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 Telling 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.-- Posted via http://www.ruby-forum.com/.
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. kris wrote:> 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 Telling 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. >> > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/baf05bc6/attachment.html
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
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 Telling <jaredtelling@hotmail.com> wrote:> > 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. > > > kris wrote: > > 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 Telling 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. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- David Demaree Owner and Web Chef, Practicalmadness david@practicalmadness.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/8a505141/attachment.html
Hi Michael, Sounds interesting! Cheers for the info. J. Michael Trier wrote:> 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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
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 Demaree <david@practicalmadness.net> wrote:> 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 Telling <jaredtelling@hotmail.com> wrote: > > > > 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. > > > kris wrote: > 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 Telling 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. > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > -- > > > David Demaree > Owner and Web Chef, Practicalmadness > david@practicalmadness.net > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- -------------- Jon Gretar Borgthorsson
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 Borgthorsson <jon.borgthorsson@gmail.com> wrote:> > 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 Demaree <david@practicalmadness.net> wrote: > > 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 Telling <jaredtelling@hotmail.com> wrote: > > > > > > > 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. > > > > > > kris wrote: > > 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 Telling 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. > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > -- > > > > > > David Demaree > > Owner and Web Chef, Practicalmadness > > david@practicalmadness.net > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > -------------- > Jon Gretar Borgthorsson > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- David Demaree Owner and Web Chef, Practicalmadness david@practicalmadness.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/fe74ebda/attachment-0001.html
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 On 3/28/06, David Demaree <david@practicalmadness.net> wrote:> > 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 Borgthorsson <jon.borgthorsson@gmail.com> wrote: > > > > 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 Demaree <david@practicalmadness.net> wrote: > > > 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 Telling <jaredtelling@hotmail.com > wrote: > > > > > > > > > > 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. > > > > > > > > > kris wrote: > > > 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 Telling 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. > > > > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > David Demaree > > > Owner and Web Chef, Practicalmadness > > > david@practicalmadness.net > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > -- > > -------------- > > Jon Gretar Borgthorsson > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > > > > David Demaree > Owner and Web Chef, Practicalmadness > david@practicalmadness.net > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- c++: the power, elegance and simplicity of a hand grenade -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/6d0f28f3/attachment.html
Hi Rob, Thanks for the info - that sounds like a really interesting option, which I''ll look into. Cheers, Jared. Rob Merrell wrote:> 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 > > > On 3/28/06, *David Demaree* < david@practicalmadness.net > <mailto:david@practicalmadness.net>> wrote: > > 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 Borgthorsson* <jon.borgthorsson@gmail.com > <mailto:jon.borgthorsson@gmail.com>> wrote: > > Interesting... > > Have you ever done the reverse? > That is having the domain.com/ <http://domain.com/> being the > rails app such as typo and > then making domain.com/forum <http://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 Demaree <david@practicalmadness.net > <mailto:david@practicalmadness.net> > wrote: > > 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 Telling < jaredtelling@hotmail.com > <mailto:jaredtelling@hotmail.com>> wrote: > > > > > > > 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. > > > > > > kris wrote: > > 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 Telling 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. > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > > http://lists.rubyonrails.org/mailman/listinfo/rails > <http://lists.rubyonrails.org/mailman/listinfo/rails> > > > > > > > > > > > > > > -- > > > > > > David Demaree > > Owner and Web Chef, Practicalmadness > > david@practicalmadness.net <mailto:david@practicalmadness.net> > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > -- > -------------- > Jon Gretar Borgthorsson > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > > > > David Demaree > Owner and Web Chef, Practicalmadness > david@practicalmadness.net <mailto:david@practicalmadness.net> > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org <mailto:Rails@lists.rubyonrails.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > c++: the power, elegance and simplicity of a hand grenade > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060328/e03977ff/attachment-0001.html
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.