You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Robin Becker <ro...@reportlab.com> on 2004/06/09 20:49:57 UTC

same repository using http & https

What Apache config do I use for

http://host/svn/public world readonly
https://host/svn/public developer writable

http://host/svn/private invisible
https://host/svn/private developer readable/writable

I'm using the following and it fails to allow a valid login.

in httpd.conf
<Location /svn/public>
         DAV svn
         SVNPath /svn/public
         <LimitExcept GET PROPFIND OPTIONS REPORT>
                 Order deny,allow
                 deny from all
         </LimitExcept>
</Location>


in the ssl.conf
<Location /svn>
         DAV svn
         SVNParentPath /svn
         AuthzSVNAccessFile /HTTPD/etc/svn_access
         Satisfy Any
         AuthType Basic
         AuthName "Subversion Repository"
         AuthUserFile /HTTPD/etc/passwd
         Require valid-user
</Location>

I can check out public anonymously using http, but not using https.
I get requested for a password, but although it's the right one I don't 
get authenticated. If I remove the section in httpd.conf I can checkout 
using https, but then obviously I can't use http.

Can I only have one /svn location? What am I doing wrong?
-- 
Robin Becker

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: same repository using http & https

Posted by Robin Becker <ro...@reportlab.com>.
Toby Johnson wrote:
> Robin Becker wrote:
> 
......
> Probably your biggest problem here is the fact that ssl.conf isn't 
> really a separate configuration file that Apache uses for only https. 
> Rather, it gets wholly included into httpd.conf at startup. Look for a 
> line like "Include conf.d/*.conf" in httpd.conf; in effect, that line 
> gets replaced with the contents of all .conf files in the conf.d 
> directory. Some Linux distros do this to make managing httpd-specific 
> packages easier (they can just create the .conf files they need instead 
> of editing the monolithic httpd.conf), but I always find it annoying and 
> just make one httpd.conf with all my settings, and remove the "Include" 
> line.
> 
> So, your general "Location /svn" block is getting wiped out by the more 
> specific "Location /svn/public" block for ALL requests, whether http or 
> https. I believe the way to achieve what you want is to create two 
> separate <VirtualHost> blocks. They can both use the same IP, but 
> different ports (80 and 443 for http and https, respectively).
> 
> <VirtualHost 10.1.2.3:80>
>    DocumentRoot /www/docs/host.foo.com
>    ServerName host.foo.com
>       ....
> 
> <VirtualHost 10.1.2.3:443>
>    DocumentRoot /www/docs/host.foo.com
>    ServerName host.foo.com
>    SSLEngine on
>       ....

..... I think you may be right about the /svn/public vs /svn, however, my 
sslconf stuff is inside a virtual host.

I have a 'solution' as follows

httpd.conf
<Location /svn>
         DAV svn
         SVNParentPath /svn
         Satisfy Any
         AuthzSVNAccessFile /HTTPD/etc/svn_access
         AuthType Basic
         AuthName "Subversion Repository"
         AuthUserFile /dev/null  #TRICK to fail all users
         Require valid-user
</Location>

ssl.conf
<Location /svn>
         DAV svn
         SVNParentPath /svn
         AuthzSVNAccessFile /HTTPD/etc/svn_access
         Satisfy Any
         AuthType Basic
         AuthName "Subversion Repository"
         AuthUserFile /HTTPD/etc/passwd
         Require valid-user
</Location>

now both http https have similar setups, but no password can be successful for 
the http route; both http and https can read the public repository without a 
password, but anything that requires a password fails under http and may succeed 
  via https. I would prefer that the http password requests should fail 
immediately, but am unable to see a way to prevent read access to 
http://host/svn/private without using the AuthzSVNAccessFile.
-- 
Robin Becker

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: same repository using http & https

Posted by Toby Johnson <to...@etjohnson.us>.
Robin Becker wrote:

> What Apache config do I use for
>
> http://host/svn/public world readonly
> https://host/svn/public developer writable
>
> http://host/svn/private invisible
> https://host/svn/private developer readable/writable
>
> I'm using the following and it fails to allow a valid login.
>
> in httpd.conf
> <Location /svn/public>
>         DAV svn
>         SVNPath /svn/public
>         <LimitExcept GET PROPFIND OPTIONS REPORT>
>                 Order deny,allow
>                 deny from all
>         </LimitExcept>
> </Location>
>
>
> in the ssl.conf
> <Location /svn>
>         DAV svn
>         SVNParentPath /svn
>         AuthzSVNAccessFile /HTTPD/etc/svn_access
>         Satisfy Any
>         AuthType Basic
>         AuthName "Subversion Repository"
>         AuthUserFile /HTTPD/etc/passwd
>         Require valid-user
> </Location>

Probably your biggest problem here is the fact that ssl.conf isn't 
really a separate configuration file that Apache uses for only https. 
Rather, it gets wholly included into httpd.conf at startup. Look for a 
line like "Include conf.d/*.conf" in httpd.conf; in effect, that line 
gets replaced with the contents of all .conf files in the conf.d 
directory. Some Linux distros do this to make managing httpd-specific 
packages easier (they can just create the .conf files they need instead 
of editing the monolithic httpd.conf), but I always find it annoying and 
just make one httpd.conf with all my settings, and remove the "Include" 
line.

So, your general "Location /svn" block is getting wiped out by the more 
specific "Location /svn/public" block for ALL requests, whether http or 
https. I believe the way to achieve what you want is to create two 
separate <VirtualHost> blocks. They can both use the same IP, but 
different ports (80 and 443 for http and https, respectively).

 <VirtualHost 10.1.2.3:80>
    DocumentRoot /www/docs/host.foo.com
    ServerName host.foo.com
       ....

 <VirtualHost 10.1.2.3:443>
    DocumentRoot /www/docs/host.foo.com
    ServerName host.foo.com
    SSLEngine on
       ....


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org