Mongrel steals my requests for my subversion repo

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

<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

<Directory /var/www/apps/mysite/current/public >
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

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]

Tim B. 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

<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

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 B. 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

<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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs