the kind folks on irc have tried to solve this for awhile and we have gotten very close to the problem. My config file for apache is working, except mongrel tries to interpret my request (myserver.com/svn) as a request for a page on my site, and, not finding anything, returns a 404. Basically, if i turn the rewrite engine off, then my svn works great. however, it seems like this would be a common problem and i thought i would ask here if there is something simpler than me writing a custom RewriteRule. thanks for any help. tim Here is my site.conf <Proxy balancer://mongrel_cluster> BalancerMember http://127.0.0.1:8000 BalancerMember http://127.0.0.1:8001 </Proxy> <VirtualHost *:80> ServerName mysite.com DocumentRoot /var/www/apps/mysite/current/public ErrorLog /var/log/apache2/svn-error_log CustomLog /var/log/apache2/svn-access_log combined <location /svn> DAV svn SVNPath /svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </location> <Directory /var/www/apps/mysite/current/public > Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> RewriteEngine On # Check for mx file RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Rewrite index to check for static RewriteRule ^/$ /index.html [QSA] # Rewrite to check from Rails cached page RewriteRule ^([^.]+)$ $1.html [QSA] # redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] </VirtualHost> -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Tim Booher writes:> > the kind folks on irc have tried to solve this for awhile and wehave> gotten very close to the problem. > > My config file for apache is working, except mongrel tries tointerpret> my request (myserver.com/svn) as a request for a page on my site,and,> not finding anything, returns a 404. > > Basically, if i turn the rewrite engine off, then my svn worksgreat.> however, it seems like this would be a common problem and i thoughti> would ask here if there is something simpler than me writing acustom> RewriteRule. > > thanks for any help. > > tim > > Here is my site.conf > <Proxy balancer://mongrel_cluster> > BalancerMember http://127.0.0.1:8000 > BalancerMember http://127.0.0.1:8001 > </Proxy> > > <VirtualHost *:80> > ServerName mysite.com > > DocumentRoot /var/www/apps/mysite/current/public > > ErrorLog /var/log/apache2/svn-error_log > CustomLog /var/log/apache2/svn-access_log combined > > > <location /svn> > DAV svn > SVNPath /svn > > AuthType Basic > AuthName "Subversion Repository" > AuthUserFile /etc/apache2/dav_svn.passwd > Require valid-user > > </location> > > <Directory /var/www/apps/mysite/current/public > > Options FollowSymLinks > AllowOverride All > Order allow,deny > Allow from all > </Directory> > > > RewriteEngine On > > > # Check for mx file > RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f > RewriteCond %{SCRIPT_FILENAME} !maintenance.html > RewriteRule ^.*$ /system/maintenance.html [L] >I suggest you fix this by forcing Apache to process the SVN urls here. Create your REWRITE rule to catch the SVN requests and stop it [L] from being processed in subsequent rules. -- Long http://FATdrive.tv/wall/trakb/10-Long http://FATdrive.tv/ - store, play, share --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
For future googlers and those who are following this: solution was to stop the RewriteRule from happening -- not to redirect svn and then stop -- this causes a dreaded 301 error since the subversion repo wants http://mysite.com/svn and apache gives it http://mysite.com/svn/. anyway here is my workaround: # redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^/svn RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] HTH, tim Long wrote:> Tim Booher writes: >> >> the kind folks on irc have tried to solve this for awhile and we > have >> gotten very close to the problem. >> >> My config file for apache is working, except mongrel tries to > interpret >> my request (myserver.com/svn) as a request for a page on my site, > and, >> not finding anything, returns a 404. >> >> Basically, if i turn the rewrite engine off, then my svn works > great. >> however, it seems like this would be a common problem and i thought > i >> would ask here if there is something simpler than me writing a > custom >> </Proxy> >> <location /svn> >> <Directory /var/www/apps/mysite/current/public > >> # Check for mx file >> RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f >> RewriteCond %{SCRIPT_FILENAME} !maintenance.html >> RewriteRule ^.*$ /system/maintenance.html [L] >> > > I suggest you fix this by forcing Apache to process the SVN urls here. > Create your REWRITE rule to catch the SVN requests and stop it [L] > from being processed in subsequent rules. > > -- Long > http://FATdrive.tv/wall/trakb/10-Long > http://FATdrive.tv/ - store, play, share-- 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?hl=en -~----------~----~----~----~------~----~------~--~---