Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: new_notes Type: application/octet-stream Size: 5801 bytes Desc: not available Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/34e20e45/new_notes.obj
Andrew Stone
2006-Jul-23 23:40 UTC
Fwd: [Rails] Kubuntu, Apache 2.2, Mongrel, Mongrel Cluster
Good suggestion, thanks. Also found a small error (lack of a cd command). The following is the entire notes: #~~~~~~~~~~~~~~~ #Starting notes #~~~~~~~~~~~~~~~ #get some necessary packages before beginning #some are used to build ruby, some are required #for gems that will be installed/built later sudo wajig install build-essential libssl-dev ssl-cert libssl0.9.8 openssl slapd ldap-utils libldap2 imagemagick libmagick9 libmagick9-dev libldap2-dev memcached zlib1g zlib1g-dev #dowload apache2.2 source and extract #in apache2.2 source dir #apache 2.2 configure ./configure --prefix=/etc/apache2 --enable-cache --enable-mem-cache --enable-deflate --enable-proxy --enable-proxy-html --enable-proxy-balancer --enable-rewrite make sudo make install #download Ruby source #edit ext/Setup to look like: #~~~~~~~~~~~~~ #begin ext/Setup #~~~~~~~~~~~~~ option nodynamic #Win32API bigdecimal curses dbm digest digest/md5 digest/rmd160 digest/sha1 digest/sha2 #dl etc enumerator fcntl #gdbm iconv #io/wait nkf #pty openssl racc/cparse readline #sdbm socket stringio strscan syck syslog #tcltklib #tk #win32ole zlib #~~~~~~~~~~~~~~~ #end ext/Setup #~~~~~~~~~~~~~~~ #in ruby source dir ./configure make sudo make install #dowload ruby gems source, tar -xvzf ruby-source #in ruby source dir ruby setup.rb #if you receive permission error on creating directories, manually create them gem install rails --include-dependencies gem install daemons gem_plugin mongrel mongrel_cluster sendfile --include-dependencies gem install rmagick postgres-pr memcache-client vim-ruby pdf_writer --include-dependencies #In your rails app dir #create the config/mongrel_cluster.yml #-e : environment (production, development (default)) #-p : port #-a : address (using localhost) #-N : number of clients #-c : work dir (should be RAILS_ROOT dir of application) mongrel_rails cluster::configure -e development -p 8000 -a 127.0.0.1 -N 2 -c /var/www/<your_app> #configure mongrel cluster as system service cd /etc/init.d sudo ln -s /usr/local/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.0/resources/mongrel_cluster mongrel_cluster sudo chmod +x mongrel_cluster sudo /usr/sbin/update-rc.d mongrel_cluster defaults #fyi: to remove #sudo /usr/sbin/update-rc.d mongrel_cluster remove cd /etc sudo mkdir mongrel_cluster cd mongrel_cluster sudo ln -s /var/www/<your app>/config/mongrel_cluster.yml <your_app>.yml #apache configuration sudo cp httpd.conf httpd.conf.orig sudo vi httpd.conf #change DocumentRoot defining htdocs #DocumentRoot "/var/www" #change Directory defining htdocs #Directory "/var/www"> #create a common configuration that applies to all apps sudo vi /etc/apache2/conf/common.conf #~~~~~~~~~~~~~~~ #begin common.conf #~~~~~~~~~~~~~~~ UseCanonicalName Off ServerSignature On <Directory /var/www/> Options FollowSymLinks Allow from all </Directory> #~~~~~~~~~~~~~~~~~ #end common.conf #~~~~~~~~~~~~~~~~~ #vhost definition cd /etc/apache2/conf/extra sudo cp httpd-vhosts.conf httpd-vhosts.conf.orig sudo vi httpd-vhost.conf #~~~~~~~~~~~~~~~~~~ #begin httpd-vhosts.conf #~~~~~~~~~~~~~~~~~~ NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin <your_email> <andrew.n.stone@gmail.com> ServerName <your_app>.com DocumentRoot /var/www/<your_app>/public ErrorLog /var/log/apache2/<your_app>_error_log CustomLog /var/log/apache2/<your_app>_access_log combined <Directory /var/www/<your_app>/public> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> ProxyPass /images ! ProxyPass /stylesheets ! ProxyPass /javascripts ! ProxyPass /favicon.ico ! ProxyPass / balancer://<your_app>_cluster ProxyPreserveHost On <Proxy balancer://<your_app>_cluster> BalancerMember http://127.0.0.1:8000 BalancerMember http://127.0.0.1:8001 </Proxy> RewriteEngine On # Uncomment for rewrite debugging #RewriteLog /var/log/apache2/<your_app>_rewrite_log #RewriteLogLevel 9 # Rewrite index to check for static RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached page RewriteRule ^([^.]+)$ $1.html [QSA] # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://<your_app>_cluster%{REQUEST_URI} [P,QSA,L] # Deflate AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html # Uncomment for deflate debugging #DeflateFilterNote Input input_info #DeflateFilterNote Output output_info #DeflateFilterNote Ratio ratio_info #LogFormat ''"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)'' deflate #CustomLog /var/log/apache2/<your_app>_deflate_log deflate </VirtualHost> #~~~~~~~~~~~ #end httpd-vhosts.conf #~~~~~~~~~~~ cd /etc/apache2/conf sudo vi httpd.conf #first line under Supplemental configuration #include your common.conf Includ conf/common.conf #enable vhosts in /etc/apache2/conf/httpd.conf #uncomment the following Include conf/extra/httpd-vhosts.conf #start/stop by using sudo /etc/apache2/bin/apachectl (start|stop) #~~~~~~~~~~~~~~~ #ending notes #~~~~~~~~~~~~~~~ I really hope this formats okay... -- Andrew Stone -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/5e80ad39/attachment-0001.html
good work... On 7/24/06, Andrew Stone <stonelists@gmail.com> wrote:> > Good suggestion, thanks. Also found a small error (lack of a cd > command). The following is the entire notes: > > #~~~~~~~~~~~~~~~ > #Starting notes > #~~~~~~~~~~~~~~~ > > #get some necessary packages before beginning > #some are used to build ruby, some are required > #for gems that will be installed/built later > sudo wajig install build-essential libssl-dev ssl-cert libssl0.9.8 openssl > slapd ldap-utils libldap2 imagemagick libmagick9 libmagick9-dev libldap2-dev > memcached zlib1g zlib1g-dev > > #dowload apache2.2 source and extract > #in apache2.2 source dir > #apache 2.2 configure > ./configure --prefix=/etc/apache2 --enable-cache --enable-mem-cache > --enable-deflate --enable-proxy --enable-proxy-html --enable-proxy-balancer > --enable-rewrite > make > sudo make install > > #download Ruby source > #edit ext/Setup to look like: > #~~~~~~~~~~~~~ > #begin ext/Setup > #~~~~~~~~~~~~~ > option nodynamic > > #Win32API > bigdecimal > curses > dbm > digest > digest/md5 > digest/rmd160 > digest/sha1 > digest/sha2 > #dl > etc > enumerator > fcntl > #gdbm > iconv > #io/wait > nkf > #pty > openssl > racc/cparse > readline > #sdbm > socket > stringio > strscan > syck > syslog > #tcltklib > #tk > #win32ole > zlib > #~~~~~~~~~~~~~~~ > #end ext/Setup > #~~~~~~~~~~~~~~~ > > #in ruby source dir > ./configure > make > sudo make install > > #dowload ruby gems source, tar -xvzf ruby-source > #in ruby source dir > ruby setup.rb > #if you receive permission error on creating directories, manually create > them > > > gem install rails --include-dependencies > > gem install daemons gem_plugin mongrel mongrel_cluster sendfile > --include-dependencies > > gem install rmagick postgres-pr memcache-client vim-ruby pdf_writer > --include-dependencies > > > #In your rails app dir > #create the config/mongrel_cluster.yml > #-e : environment (production, development (default)) > #-p : port > #-a : address (using localhost) > #-N : number of clients > #-c : work dir (should be RAILS_ROOT dir of application) > mongrel_rails cluster::configure -e development -p 8000 -a 127.0.0.1 -N 2 > -c /var/www/<your_app> > > > #configure mongrel cluster as system service > cd /etc/init.d > sudo ln -s /usr/local/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.0/resources/mongrel_cluster > mongrel_cluster > sudo chmod +x mongrel_cluster > sudo /usr/sbin/update-rc.d mongrel_cluster defaults > #fyi: to remove > #sudo /usr/sbin/update-rc.d mongrel_cluster remove > > cd /etc > sudo mkdir mongrel_cluster > cd mongrel_cluster > sudo ln -s /var/www/<your app>/config/mongrel_cluster.yml <your_app>.yml > > #apache configuration > sudo cp httpd.conf httpd.conf.orig > > sudo vi httpd.conf > #change DocumentRoot defining htdocs > #DocumentRoot "/var/www" > #change Directory defining htdocs > #Directory "/var/www"> > > #create a common configuration that applies to all apps > sudo vi /etc/apache2/conf/common.conf > #~~~~~~~~~~~~~~~ > #begin common.conf > #~~~~~~~~~~~~~~~ > > UseCanonicalName Off > ServerSignature On > > <Directory /var/www/> > Options FollowSymLinks > Allow from all > </Directory> > > #~~~~~~~~~~~~~~~~~ > #end common.conf > #~~~~~~~~~~~~~~~~~ > > > #vhost definition > cd /etc/apache2/conf/extra > sudo cp httpd-vhosts.conf httpd-vhosts.conf.orig > sudo vi httpd-vhost.conf > > #~~~~~~~~~~~~~~~~~~ > #begin httpd-vhosts.conf > #~~~~~~~~~~~~~~~~~~ > NameVirtualHost *:80 > <VirtualHost *:80> > ServerAdmin <your_email> <andrew.n.stone@gmail.com> > ServerName <your_app>.com > DocumentRoot /var/www/<your_app>/public > ErrorLog /var/log/apache2/<your_app>_error_log > CustomLog /var/log/apache2/<your_app>_access_log combined > > <Directory /var/www/<your_app>/public> > Options FollowSymLinks > AllowOverride None > Order allow,deny > Allow from all > </Directory> > > ProxyPass /images ! > ProxyPass /stylesheets ! > ProxyPass /javascripts ! > ProxyPass /favicon.ico ! > ProxyPass / balancer://<your_app>_cluster > ProxyPreserveHost On > > <Proxy balancer://<your_app>_cluster> > BalancerMember http://127.0.0.1:8000 > BalancerMember http://127.0.0.1:8001 > </Proxy> > > RewriteEngine On > > # Uncomment for rewrite debugging > #RewriteLog /var/log/apache2/<your_app>_rewrite_log > #RewriteLogLevel 9 > > # Rewrite index to check for static > RewriteRule ^/$ /index.html [QSA] > > # Rewrite to check for Rails cached page > RewriteRule ^([^.]+)$ $1.html [QSA] > > # Redirect all non-static requests to cluster > RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f > RewriteRule ^/(.*)$ balancer://<your_app>_cluster%{REQUEST_URI} > [P,QSA,L] > > # Deflate > AddOutputFilterByType DEFLATE text/html text/plain text/xml > application/xml application/xhtml+xml text/javascript text/css > BrowserMatch ^Mozilla/4 gzip-only-text/html > BrowserMatch ^Mozilla/4.0[678] no-gzip > BrowserMatch bMSIE !no-gzip !gzip-only-text/html > > # Uncomment for deflate debugging > #DeflateFilterNote Input input_info > #DeflateFilterNote Output output_info > #DeflateFilterNote Ratio ratio_info > #LogFormat ''"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)'' > deflate > #CustomLog /var/log/apache2/<your_app>_deflate_log deflate > </VirtualHost> > > #~~~~~~~~~~~ > #end httpd-vhosts.conf > #~~~~~~~~~~~ > > cd /etc/apache2/conf > sudo vi httpd.conf > #first line under Supplemental configuration > #include your common.conf > Includ conf/common.conf > > #enable vhosts in /etc/apache2/conf/httpd.conf > #uncomment the following > Include conf/extra/httpd-vhosts.conf > > #start/stop by using > sudo /etc/apache2/bin/apachectl (start|stop) > > #~~~~~~~~~~~~~~~ > #ending notes > #~~~~~~~~~~~~~~~ > > I really hope this formats okay... > > -- > Andrew Stone > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060805/b3862895/attachment.html
Nauhaie
2006-Aug-05 08:07 UTC
[Rails] Re: Fwd: Kubuntu, Apache 2.2, Mongrel, Mongrel Cluster
I think the rewrite rules will never be used here... I have run tests and it appears that cached contents are served by Mongrel instead of Apache with such a configuration. You should use either proxy pass exceptions (! rules), or rewrite. But I might be wrong... Proxy pass exceptions are faster for everything that is in the excluded directories, but they just forward everything else to Mongrel, including cached content... But once more, I can be totally wrong... -- Posted via http://www.ruby-forum.com/.
hemant
2006-Aug-08 23:21 UTC
[Mongrel] [Rails] Re: Fwd: Kubuntu, Apache 2.2, Mongrel, Mongrel Cluster
Really? I guess the setup is similar(I am afraid it is identical) to one given by Coda and Erza on their blogs. Can anbody clarify on this?. What should be the rewrite rules so that, static pages are served by Apache.I have benchmarked, Apache2 with fcgi and Apache 2.2 + mongrel + mod_proxy_balancer. To me, it looks like Apache2 + fcgi is winning the race currently. On 8/5/06, Nauhaie <noe.cuneo at laposte.net> wrote:> > I think the rewrite rules will never be used here... I have run tests > and it appears that cached contents are served by Mongrel instead of > Apache with such a configuration. You should use either proxy pass > exceptions (! rules), or rewrite. But I might be wrong... > > Proxy pass exceptions are faster for everything that is in the excluded > directories, but they just forward everything else to Mongrel, including > cached content... > > But once more, I can be totally wrong... > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails at lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060809/fe9662d0/attachment.html
Philip Hallstrom
2006-Aug-08 23:36 UTC
[Mongrel] [Rails] Re: Fwd: Kubuntu, Apache 2.2, Mongrel, Mongrel Cluster
> I guess the setup is similar(I am afraid it is identical) to one given by > Coda and Erza on their blogs. > > Can anbody clarify on this?. > What should be the rewrite rules so that, static pages are served by > Apache.I have benchmarked, Apache2 with fcgi and Apache 2.2 + mongrel + > mod_proxy_balancer. To me, it looks like Apache2 + fcgi is winning the race > currently.We use this to handle rails/mongrel "side-by-side".... RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ $1/ [R] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} \.php RewriteRule ^(.*)$ $1 [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.html -f RewriteRule ^(.*)$ $1/index.html [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.php -f RewriteRule ^(.*)$ $1/index.php [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d RewriteRule ^(.*)[^/]$ $1/ [QSA,L] RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]> > On 8/5/06, Nauhaie <noe.cuneo at laposte.net> wrote: >> >> I think the rewrite rules will never be used here... I have run tests >> and it appears that cached contents are served by Mongrel instead of >> Apache with such a configuration. You should use either proxy pass >> exceptions (! rules), or rewrite. But I might be wrong... >> >> Proxy pass exceptions are faster for everything that is in the excluded >> directories, but they just forward everything else to Mongrel, including >> cached content... >> >> But once more, I can be totally wrong... >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails at lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > > -- > nothing much to talk >
My httpd.conf is almost the same as above,however my log shows that the mod_deflate does not take into effect. I have mentioned this topic at : http://www.ruby-forum.com/topic/86475 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Charles Brian Quinn
2006-Oct-30 22:59 UTC
Re: Fwd: Kubuntu, Apache 2.2, Mongrel, Mongrel Cluster
I think there is a typo, it has been corrected on several guides: BrowserMatch bMSIE !no-gzip !gzip-only should read: BrowserMatch \bMSIE !no-gzip !gzip-only Also, I''m hoping your line got truncated as I did on the mongrel apache2 guide here: AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css That should all be one line. On 10/30/06, ethan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > My httpd.conf is almost the same as above,however my log shows that the > mod_deflate does not take into effect. I have mentioned this topic at : > http://www.ruby-forum.com/topic/86475 > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Charles Brian Quinn self-promotion: www.seebq.com highgroove studios: www.highgroove.com slingshot hosting: www.slingshothosting.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
ethan wrote:> My httpd.conf is almost the same as above,however my log shows that the > mod_deflate does not take into effect. I have mentioned this topic at : > http://www.ruby-forum.com/topic/86475I guess the original config as follows stop mod_deflate from compressing the javascripts,stylesheets,etc for IE BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html Therefore the above three sentences should be commented. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 7/24/06, Andrew Stone <stonelists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> sudo vi httpd.conf > #change DocumentRoot defining htdocs > #DocumentRoot "/var/www" > #change Directory defining htdocs > #Directory "/var/www">what do you mean by #Directory "/var/www"> ? I don''t see anything like that. Could you show me what the whole Directory thing look like? Thanx in advance Pat --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---