Hello, Does anyone have a tutorial on how to set up a mongrel_rails cluster with apache for instiki? I have mongrel rails and apache working for two other ROR projects, but the setup for instiki is so far eluding me. Charlie -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instiki-users/attachments/20071030/6f0b0b47/attachment.html
I don''t know about doing a mongrel cluster, but running instiki on mongrel should be exactly the same as running instiki on any rails app. Apache shouldn''t know the difference (assuming you''re using apache for reverse proxy or similar). Andy Selvig ________________________________ From: instiki-users-bounces at rubyforge.org [mailto:instiki-users-bounces at rubyforge.org] On Behalf Of Charlie Caroff Sent: Tuesday, October 30, 2007 11:59 PM To: instiki-users at rubyforge.org Subject: [Instiki] mongrel_rails and apache for instiki Hello, Does anyone have a tutorial on how to set up a mongrel_rails cluster with apache for instiki? I have mongrel rails and apache working for two other ROR projects, but the setup for instiki is so far eluding me. Charlie -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instiki-users/attachments/20071031/7e571fd0/attachment.html
Well, I tried to use apache as explained on the instiki.org site. I put something like this into a name virtual host container in my apache 2.2./extra/httpd- vhosts.conf file: ServerName wiki.mydomain.com ProxyRequests Off ProxyPass / http://127.0.0.1:2500/ ProxyPassReverse / http://127.0.0.1:2500/ <Proxy http://127.0.0.1:2500/*> Order deny,allow Allow from all </Proxy> And it works, sort of. Every time instiki wants to do a redirect, it wants to redirect to https, and it fails, because a different host is set up using https. But, when I take the "s" out of http, and reload the page -- all the pages work. I have ssl set up for one of my rails projects on this machine, but not for this one. I have another project set up without ssl on that same machine, and that project works just fine. The two working projects -- one ssl, one not -- are both running on mongrel_rails and apache, which I like. So I decided to set my instiki project up with the same config. Trouble is -- I don''t understand what the setup for instiki would be doing. I guess I probably need to set up a Virtual Host container inside my httpd-vhosts.conf file, with the mongrel config, and the reverse proxy config. But when I try to do that, I get the same problem as without the mongrel config -- every request tries to go through https. Is the problem that this reverse proxy config will simply not work on a machine that is running ssl for a different domain? Charlie On 10/31/07, Selvig, Andy <Andy.Selvig at goodrich.com> wrote:> > I don''t know about doing a mongrel cluster, but running instiki on > mongrel should be exactly the same as running instiki on any rails app. > Apache shouldn''t know the difference (assuming you''re using apache for > reverse proxy or similar). > > > Andy Selvig > > ------------------------------ > *From:* instiki-users-bounces at rubyforge.org [mailto: > instiki-users-bounces at rubyforge.org] *On Behalf Of *Charlie Caroff > *Sent:* Tuesday, October 30, 2007 11:59 PM > *To:* instiki-users at rubyforge.org > *Subject:* [Instiki] mongrel_rails and apache for instiki > > Hello, > > Does anyone have a tutorial on how to set up a mongrel_rails cluster with > apache for instiki? I have mongrel rails and apache working for two other > ROR projects, but the setup for instiki is so far eluding me. > > > Charlie > > _______________________________________________ > Instiki-users mailing list > Instiki-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/instiki-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instiki-users/attachments/20071031/a3544832/attachment-0001.html
Not sure about SSL. I have a machine with 3 rails apps, all on mongrel, behind an apache reverse proxy. I''m not using virtual hosts, though. Here''s my (Windows) setup, if it helps: In the apache conf file, each rails app (including instiki) gets something like this: ## wiki Alias /wiki "C:\wiki\instiki\public" <Directory "C:\wiki\instiki\public"> Options Indexes FollowSymLinks AllowOverride none Order allow,deny Allow from all </Directory> ProxyPass /wiki/images ! ProxyPass /wiki/stylesheets ! ProxyPass /wiki/javascripts ! ProxyPass /wiki/ http://127.0.0.1:2500/wiki/ ProxyPassReverse /wiki/ http://127.0.0.1:2500/wiki/ # reverse proxy link mapping ProxyHTMLURLMap http://127.0.0.1:2500/ /wiki <Location /wiki/> #ProxyPassReverse / SetOutputFilter proxy-html ProxyHTMLURLMap / /wiki/ ProxyHTMLURLMap /wiki /wiki RequestHeader unset Accept-Encoding </Location> Each app has a different port, name, and directory. To run mongrel for the above example:> mongrel_rails start --prefix=/wiki -p 2500 -e productionThe prefix option for mongrel and the fact that the ProxyPass/ProxyPassReverse directives are a bit different than recommended is to make rails redirects work properly. I could never get it to work right the way you had it set up. Hope this helps. Andy Selvig ________________________________ From: instiki-users-bounces at rubyforge.org [mailto:instiki-users-bounces at rubyforge.org] On Behalf Of Charlie Caroff Sent: Wednesday, October 31, 2007 11:21 AM To: Instiki-users Subject: Re: [Instiki] mongrel_rails and apache for instiki Well, I tried to use apache as explained on the instiki.org site. I put something like this into a name virtual host container in my apache 2.2 ./extra/httpd-vhosts.conf file: ServerName wiki.mydomain.com ProxyRequests Off ProxyPass / http://127.0.0.1:2500/ ProxyPassReverse / http://127.0.0.1:2500/ <Proxy http://127.0.0.1:2500/*> Order deny,allow Allow from all </Proxy> And it works, sort of. Every time instiki wants to do a redirect, it wants to redirect to https, and it fails, because a different host is set up using https. But, when I take the "s" out of http, and reload the page -- all the pages work. I have ssl set up for one of my rails projects on this machine, but not for this one. I have another project set up without ssl on that same machine, and that project works just fine. The two working projects -- one ssl, one not -- are both running on mongrel_rails and apache, which I like. So I decided to set my instiki project up with the same config. Trouble is -- I don''t understand what the setup for instiki would be doing. I guess I probably need to set up a Virtual Host container inside my httpd-vhosts.conf file, with the mongrel config, and the reverse proxy config. But when I try to do that, I get the same problem as without the mongrel config -- every request tries to go through https. Is the problem that this reverse proxy config will simply not work on a machine that is running ssl for a different domain? Charlie On 10/31/07, Selvig, Andy <Andy.Selvig at goodrich.com> wrote: I don''t know about doing a mongrel cluster, but running instiki on mongrel should be exactly the same as running instiki on any rails app. Apache shouldn''t know the difference (assuming you''re using apache for reverse proxy or similar). Andy Selvig ________________________________ From: instiki-users-bounces at rubyforge.org [mailto:instiki-users-bounces at rubyforge.org] On Behalf Of Charlie Caroff Sent: Tuesday, October 30, 2007 11:59 PM To: instiki-users at rubyforge.org Subject: [Instiki] mongrel_rails and apache for instiki Hello, Does anyone have a tutorial on how to set up a mongrel_rails cluster with apache for instiki? I have mongrel rails and apache working for two other ROR projects, but the setup for instiki is so far eluding me. Charlie _______________________________________________ Instiki-users mailing list Instiki-users at rubyforge.org http://rubyforge.org/mailman/listinfo/instiki-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instiki-users/attachments/20071031/56e23da2/attachment.html
Ok, I figured out the problem. I have a line in my httpd.conf RequestHeader set X-Forwarded-Proto "https" I set that to RequestHeader set X-Forwarded-Proto "http" in my VirtualHost for my instiki and all became hunky dory. I got the clue from your RequestHeader unset Accept-Encoding line. Also, I do have some minor redirecting issues -- I''m going to tackle those now with your hints. Thanks, Charlie On 10/31/07, Selvig, Andy <Andy.Selvig at goodrich.com> wrote:> > > Not sure about SSL. I have a machine with 3 rails apps, all on mongrel, behind an apache reverse proxy. I''m not using virtual hosts, though. Here''s my (Windows) setup, if it helps: > > In the apache conf file, each rails app (including instiki) gets something like this: > > > ## wiki > Alias /wiki "C:\wiki\instiki\public" > <Directory "C:\wiki\instiki\public"> > Options Indexes FollowSymLinks > AllowOverride none > Order allow,deny > Allow from all > </Directory> > > ProxyPass /wiki/images ! > ProxyPass /wiki/stylesheets ! > ProxyPass /wiki/javascripts ! > > ProxyPass /wiki/ http://127.0.0.1:2500/wiki/ > ProxyPassReverse /wiki/ http://127.0.0.1:2500/wiki/ > > # reverse proxy link mapping > ProxyHTMLURLMap http://127.0.0.1:2500/ /wiki > <Location /wiki/> > #ProxyPassReverse / > SetOutputFilter proxy-html > ProxyHTMLURLMap / /wiki/ > ProxyHTMLURLMap /wiki /wiki > RequestHeader unset Accept-Encoding > </Location> > > > Each app has a different port, name, and directory. To run mongrel for the above example: > > > mongrel_rails start --prefix=/wiki -p 2500 -e production > > > The prefix option for mongrel and the fact that the ProxyPass/ProxyPassReverse directives are a bit different than recommended is to make rails redirects work properly. I could never get it to work right the way you had it set up. > > Hope this helps. > > > Andy Selvig > > > ________________________________From: instiki-users-bounces at rubyforge.org [mailto:instiki-users-bounces at rubyforge.org] On Behalf Of Charlie Caroff> Sent: Wednesday, October 31, 2007 11:21 AM > To: Instiki-users > Subject: Re: [Instiki] mongrel_rails and apache for instiki > > > > Well, I tried to use apache as explained on the instiki.org site. I put something like this into a name virtual host container in my apache 2.2 ./extra/httpd-vhosts.conf file: > ServerName > wiki.mydomain.com > ProxyRequests Off > ProxyPass / http://127.0.0.1:2500/ > ProxyPassReverse / http://127.0.0.1:2500/ > > <Proxy http://127.0.0.1:2500/*> > Order deny,allow > Allow from all > </Proxy> > And it works, sort of. Every time instiki wants to do a redirect, it wants to redirect to https, and it fails, because a different host is set up using https. But, when I take the "s" out of http, and reload the page -- all the pages work. > > I have ssl set up for one of my rails projects on this machine, but not for this one. I have another project set up without ssl on that same machine, and that project works just fine. > > The two working projects -- one ssl, one not -- are both running on mongrel_rails and apache, which I like. So I decided to set my instiki project up with the same config. > > Trouble is -- I don''t understand what the setup for instiki would be doing. I guess I probably need to set up a Virtual Host container inside my httpd-vhosts.conf file, with the mongrel config, and the reverse proxy config. But when I try to do that, I get the same problem as without the mongrel config -- every request tries to go through https. > > Is the problem that this reverse proxy config will simply not work on a machine that is running ssl for a different domain? > > Charlie > > > > > On 10/31/07, Selvig, Andy <Andy.Selvig at goodrich.com> wrote: > > > > > > I don''t know about doing a mongrel cluster, but running instiki on mongrel should be exactly the same as running instiki on any rails app. Apache shouldn''t know the difference (assuming you''re using apache for reverse proxy or similar). > > > > > > Andy Selvig > > > > > > ________________________________From: instiki-users-bounces at rubyforge.org [mailto:instiki-users-bounces at rubyforge.org] On Behalf Of Charlie Caroff> > Sent: Tuesday, October 30, 2007 11:59 PM > > To: instiki-users at rubyforge.org > > Subject: [Instiki] mongrel_rails and apache for instiki > > > > > > Hello, > > > > Does anyone have a tutorial on how to set up a mongrel_rails cluster with apache for instiki? I have mongrel rails and apache working for two other ROR projects, but the setup for instiki is so far eluding me. > > > > > > Charlie > > _______________________________________________ > > Instiki-users mailing list > > Instiki-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/instiki-users > > > > > _______________________________________________ > Instiki-users mailing list > Instiki-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/instiki-users >
hello charlie, here is the setup we use for instiki on our servers using mongrel_cluster --- user: mongrel cwd: /var/www/sites/instiki.org/instiki log_file: log/mongrel.log port: "12000" environment: production group: mongrel address: instiki.5uper.net pid_file: tmp/pids/mongrel.pid servers: 1 should be quite self-explaining. you might want to use mod_proxy_balancer (if you are on apache2) see http://blog.innerewut.de/2006/04/21/scaling-rails-with-apache-2-2-mod_proxy_balancer-and-mongrel for a better performance, you might want to try nginx (http://nginx.net/) which is said to have a better performance than apache2 and should compile on most systems without any problems (no dependencies). we are planning to move the main instiki site to nginx soon. regards, matthias On 10/31/07, Charlie Caroff <charlie.caroff at gmail.com> wrote:> Hello, > > Does anyone have a tutorial on how to set up a mongrel_rails cluster with > apache for instiki? I have mongrel rails and apache working for two other > ROR projects, but the setup for instiki is so far eluding me. > > > Charlie > _______________________________________________ > Instiki-users mailing list > Instiki-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/instiki-users >