You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Iacopo Benesperi <ia...@iacchi.org> on 2009/11/15 12:33:31 UTC

[users@httpd] Apache error if using Basic AuthType under Location directive

Hi,
I have a WebSVN installation and I want to enable a per repository
authentication. At this page:
http://demo.websvn.info/filedetails.php?repname=WebSVN&path=/trunk/doc/install.html#authentication
there's the WebSVN documentation on how to do that. Since my ISP
(DreamHost) doesn't provide SSPI authentication, I've tried to use the
Basic authentication method instead and added these lines to my .htaccess:

<Location /wsvn/[repo name]/>
AuthType Basic
AuthName "Repository svn"
AuthUserFile /home/liberenote/svn/materiale.passwd
Require valid-user
</Location>

and I was planning to add a Location section for every repository I have.

Unfortunately, if I add the lines above Apache gives me an error 500,
and its log says:

/home/liberenote/svnfolder/.htaccess: <Location not allowed here

I'd like to know if basic authentication isn't allowed in the location
directive, if no authentication method is allowed (and so the websvn
documentation doesn't tell the truth) or if it's the dreamhost apache
server which is misconfigured.

many thanks,
Iacopo Benesperi

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache error if using Basic AuthType under Location directive

Posted by Iacopo Benesperi <ia...@iacchi.org>.
Krist van Besien ha scritto:
> So technically the OP could just dump the following .htaccess file in
> the top WebSVN directory:
> 
> AuthType Basic
> AuthName "Repository svn"
> AuthUserFile /home/liberenote/svn/materiale.passwd
> Require valid-user

You're right, but I want to access several repos with the same WebSVN
installation, so I need a different [repo].passwd for each repo; this is
why I was triing the location section in the first instance. Waiting for
a solution (if there's one) I've put a .htpasswd in the WebSVN root
folder which contain a merge of all repos .passwd, but in this way every
user can open every repo, and I don't want that if possible.

bye,
Iacopo

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache error if using Basic AuthType under Location directive

Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Nov 16, 2009 at 10:53 AM, André Warnier <aw...@ice-sa.com> wrote:
> LuKreme wrote:
> ...
>
>>
>> To do hat you want though, the simplest solution is to put a htaccess file
>> in the folder you want to protect.
>>
> No, it is not, because in the OP's case there is not really a directory to
> protect and to put a .htacess file inside of.
> It is a URL that needs protecting, so it has to be done via a <Location>
> section.
> Unfortunately, if the Ophas no access to the Apache configuration files,
> then he has a problem.

WebSVN is a set of PHP scripts, that you install somewhere on your filesystem.

So technically the OP could just dump the following .htaccess file in
the top WebSVN directory:

AuthType Basic
AuthName "Repository svn"
AuthUserFile /home/liberenote/svn/materiale.passwd
Require valid-user

Krist




-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache error if using Basic AuthType under Location directive

Posted by André Warnier <aw...@ice-sa.com>.
LuKreme wrote:
...

> 
> To do hat you want though, the simplest solution is to put a htaccess file in the folder you want to protect.
> 
No, it is not, because in the OP's case there is not really a directory 
to protect and to put a .htacess file inside of.
It is a URL that needs protecting, so it has to be done via a <Location> 
section.
Unfortunately, if the Ophas no access to the Apache configuration files, 
then he has a problem.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Apache error if using Basic AuthType under Location directive

Posted by LuKreme <kr...@kreme.com>.
On 15-Nov-2009, at 12:22, Eric Covener wrote:
> On Sun, Nov 15, 2009 at 11:42 AM, Iacopo Benesperi <ia...@iacchi.org> wrote:
>> Eric Covener ha scritto:
>>> As the error message says, You can't put <location> in htaccess.  It's
>>> got nothing to do with what's inside the <location>.
>> 
>> So where can I use the location directive?
> 
> Inside the configuration file read by Apache at startup (nominally
> httpd.conf, but may be a series of files in your installation)

Inside ANY of the configuration files, to be clear. Users generally have a specific conf file in /etc/httpd/user/user.conf and this is what you would need to put a <Location> in.

To do hat you want though, the simplest solution is to put a htaccess file in the folder you want to protect.


-- 
"It's like those French have a different word for *everything*" -
	Steve Martin


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache error if using Basic AuthType under Location directive

Posted by Iacopo Benesperi <ia...@iacchi.org>.
Eric Covener ha scritto:
> No clue if you can't modify the configuration and the location of the
> htaccess isn't related to the files you want to protect.

Ok thanks: I don't have access to httpd.conf. Let's see if someone has
an idea.

Iacopo

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache error if using Basic AuthType under Location directive

Posted by Eric Covener <co...@gmail.com>.
On Sun, Nov 15, 2009 at 11:42 AM, Iacopo Benesperi <ia...@iacchi.org> wrote:
> Eric Covener ha scritto:
>> As the error message says, You can't put <location> in htaccess.  It's
>> got nothing to do with what's inside the <location>.
>
> So where can I use the location directive?

Inside the configuration file read by Apache at startup (nominally
httpd.conf, but may be a series of files in your installation)

> Or, better: what should I
> write in the .htaccess to write a rule based on the url and not on the
> folder (<directory>)? Is there a way to protect the url the way I want?

No clue if you can't modify the configuration and the location of the
htaccess isn't related to the files you want to protect.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache error if using Basic AuthType under Location directive

Posted by Iacopo Benesperi <ia...@iacchi.org>.
Eric Covener ha scritto:
> As the error message says, You can't put <location> in htaccess.  It's
> got nothing to do with what's inside the <location>.

So where can I use the location directive? Or, better: what should I
write in the .htaccess to write a rule based on the url and not on the
folder (<directory>)? Is there a way to protect the url the way I want?

thanks,
Iacopo

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache error if using Basic AuthType under Location directive

Posted by Eric Covener <co...@gmail.com>.
On Sun, Nov 15, 2009 at 6:33 AM, Iacopo Benesperi <ia...@iacchi.org> wrote:

> [...] to my .htaccess:
>
> <Location /wsvn/[repo name]/>

> /home/liberenote/svnfolder/.htaccess: <Location not allowed here
>
> I'd like to know if basic authentication isn't allowed in the location
> directive, if no authentication method is allowed (and so the websvn
> documentation doesn't tell the truth) or if it's the dreamhost apache
> server which is misconfigured.
>

As the error message says, You can't put <location> in htaccess.  It's
got nothing to do with what's inside the <location>.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org