You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dick Davies <ra...@hellooperator.net> on 2005/01/07 23:45:16 UTC

[users@httpd] we dont' need no steenkin docroot

Hi, there - long time poster, first time asker....


I have a subversion repo vhost, it looks like this:


<VirtualHost repo.box>

        ServerName repo.box
        ServerAdmin rasputnik@hellooperator.net

        # subversion repos
        <Location /repos>
          DAV svn
          SVNParentPath /path/to/repos
        </Location>

</VirtualHost>

This will absolutely refuse to work because I have no documentroot
defined anywhere in httpd.conf. 

More precisely, it seems to be because I have a 

<Directory />
    AllowOverride None
    Order Deny,Allow
    Deny from all 
</Directory>

up in section 2, so any filesystem access will fail. 

Lets' leave aside the fact that we aren't really touching the fs here, and
move on to the really silly bit. In order for this to work, I need an 
'Allow from all' somewhere (this is a snippet, we have *plenty* of security 
here in reality). But 'Allow from all' applies to Directory entries, *not*
Location entries, so I need a new section to get subversion working:


DocumentRoot /opt/www/defaulthost/docs
<Directory /opt/www/defaulthost/docs>
    Options Indexes
    AllowOverride None
    Order Deny,Allow
    Allow from all 
</Directory>


This is defined up in section 2 - I suppose I can stick a 'there is no content
on this server. go away.' message up there, but it's a hack and a half, isn't it?

I mean, the Directory mentioned has no relation to the SVNParentPath mentioned,
it's not even it's parent, so why does the change above suddenly allow access?

Have I missed a trick, or is this just a bit clanky?
(This looks like an old assumption somewhere in apache that every request path
will map to a file/directory eventually, which is'nt true in a lot of cases - so
does mod_proxy code around this, for example?)

Is there another equivalent for a Directory's Allow attribute i can use?


-- 
'When you have to kill a man it costs nothing to be polite.'
		-- Winston Churchill, On formal declarations of war
Rasputin :: Jack of All Trades - Master of Nuns

---------------------------------------------------------------------
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] we dont' need no steenkin docroot

Posted by Leif W <wa...@usa.net>.
> Rich Bowen; 2005 January 10 Monday 07:53
>
> |>You can put Allow and Deny directives in Location sections.
> |
> | Then the docs need fixing,
> http://httpd.apache.org/docs-2.0/mod/mod_access.html#allow
> | says its directory (and .htaccess) only.
>
> Right, but if you read the clarification of that at
> http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Context it 
> says
>
> "A directive marked as being valid in this context may be used inside
> <Directory>, <Location>, and <Files>  containers in the server
> configuration files."
>
> Yes, that can be a little confusing.

Also, the Location reference uses Allow in the example code but doesn't 
seem to mention it explicitly.

http://httpd.apache.org/docs-2.0/mod/core.html#location

Context notes can make it very clear if they're correct, and very 
confusing if not.

Leif



---------------------------------------------------------------------
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] we dont' need no steenkin docroot

Posted by Rich Bowen <rb...@rcbowen.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

|>You can put Allow and Deny directives in Location sections.
|
| Then the docs need fixing,
http://httpd.apache.org/docs-2.0/mod/mod_access.html#allow
| says its directory (and .htaccess) only.

Right, but if you read the clarification of that at
http://httpd.apache.org/docs-2.0/mod/directive-dict.html#Context it says

"A directive marked as being valid in this context may be used inside
<Directory>, <Location>, and <Files>  containers in the server
configuration files."

Yes, that can be a little confusing.

- --
Rich Bowen - rbowen@RCBowen.com
Apache Administrators Handbook - http://apacheadmin.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB4nq9XP03+sx4yJMRAkN6AKDqcTWK1MKJ1STQGofYfKJvFevx/QCg5yWZ
u2xTDNG40cFmfnNSwCF1F3c=
=YLnk
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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] we dont' need no steenkin docroot

Posted by Dick Davies <ra...@hellooperator.net>.
* Rich Bowen <rb...@rcbowen.com> [0123 12:23]:
> EnigmailDick Davies wrote:

> | I have a subversion repo vhost, it looks like this:
> |
> | <VirtualHost repo.box>
> |         ServerName repo.box
> |         ServerAdmin rasputnik@hellooperator.net
> |
> |         # subversion repos
> |         <Location /repos>
> |           DAV svn
> |           SVNParentPath /path/to/repos
> |         </Location>
> | </VirtualHost>

> | This will absolutely refuse to work because I have no documentroot
> | defined anywhere in httpd.conf.
> 
> What error message(s) are you receiving when you try?

403s all over the shop.  Also a wierd 

client denied by server configuration: /www/

in the apache error log, which I assume is the compile time default docroot
on this build.

> | ..... silly bit. In order for this to work, I need an
> | 'Allow from all' somewhere (this is a snippet, we have *plenty* of
> security
> | here in reality). But 'Allow from all' applies to Directory entries, *not*
> | Location entries, so I need a new section to get subversion working:
> 
> You can put Allow and Deny directives in Location sections.

Then the docs need fixing, http://httpd.apache.org/docs-2.0/mod/mod_access.html#allow
says its directory (and .htaccess) only. 

> server-status and server-info, for example. What error messages(s) are
> you receiving when you try this?

First thing I do on a new install is prune out all the crap in the default httpd.conf,
which in my case includes server-status and server-info :)

Thanks a lot, Rich - all working now with a simple allow/deny pair, and I can lose
that voodoo docroot..

-- 
'...and then we wrote scripts to write the configs for us, and using
these scripts, we made mistakes in a faster, more automated manner.'
		-- A Gentle Introduction to Cricket, on MRTG configuration
Rasputin :: Jack of All Trades - Master of Nuns

---------------------------------------------------------------------
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] we dont' need no steenkin docroot

Posted by Rich Bowen <rb...@rcbowen.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

EnigmailDick Davies wrote:
| Hi, there - long time poster, first time asker....
|
|
| I have a subversion repo vhost, it looks like this:
|
|
| <VirtualHost repo.box>
|
|         ServerName repo.box
|         ServerAdmin rasputnik@hellooperator.net
|
|         # subversion repos
|         <Location /repos>
|           DAV svn
|           SVNParentPath /path/to/repos
|         </Location>
|
| </VirtualHost>
|
| This will absolutely refuse to work because I have no documentroot
| defined anywhere in httpd.conf.

What error message(s) are you receiving when you try?

| More precisely, it seems to be because I have a
|
| <Directory />
|     AllowOverride None
|     Order Deny,Allow
|     Deny from all
| </Directory>
|
| up in section 2, so any filesystem access will fail.
|
| Lets' leave aside the fact that we aren't really touching the fs here, and
| move on to the really silly bit. In order for this to work, I need an
| 'Allow from all' somewhere (this is a snippet, we have *plenty* of
security
| here in reality). But 'Allow from all' applies to Directory entries, *not*
| Location entries, so I need a new section to get subversion working:

You can put Allow and Deny directives in Location sections. There are
examples of that in the default configuration file, regarding
server-status and server-info, for example. What error messages(s) are
you receiving when you try this?

| This is defined up in section 2 - I suppose I can stick a 'there is no
content
| on this server. go away.' message up there, but it's a hack and a
half, isn't it?
|
| I mean, the Directory mentioned has no relation to the SVNParentPath
mentioned,
| it's not even it's parent, so why does the change above suddenly allow
access?
|
| Have I missed a trick, or is this just a bit clanky?
| (This looks like an old assumption somewhere in apache that every
request path
| will map to a file/directory eventually, which is'nt true in a lot of
cases - so
| does mod_proxy code around this, for example?)
|
| Is there another equivalent for a Directory's Allow attribute i can use?

Hmm. I've done this pretty much exactly as you describe, when an entire
server is handled by mod_perl handlers. I suppose if you could give some
error messages, that might suggest what the problem is.

- --
Rich Bowen
rbowen@rcbowen.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB4SCEXP03+sx4yJMRAvCXAKDb/dHKB1i9+lPHUPdSZKNTncbqZgCg3Q5J
a1HXyybrcErydObs1F08h1s=
=SQGi
-----END PGP SIGNATURE-----

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