[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why can't I move the document root for a site in Apache 2? [SOLVED]



elvis wrote: 
> 
> On 1/9/20 6:29 pm, tomas@tuxteam.de wrote:
> > On Mon, Aug 31, 2020 at 04:57:28PM -0400, Gary Dale wrote:
> > 
> > [...]
> > 
> > > Just to be clear, the folder I had to change permissions on is the
> > > <folder containing all the web sites. This is many levels above the
> > > document root,
> > To be able to access a file given its path, you need to have read
> > access to each directory [1] along that path. There isn't another
> > way, and this is a Good Thing [TM]
> 
> I don't know if this is a silly question or not, but can you access a file
> not given its path?
> 
> 
> I have the same problem as the OP sometimes and wonder what rules there are
> for allowing access to directories further along the path.

A file can only have one set of ownership and permissions
(modulo extended attributes), but it can appear in multiple
paths.

There are two ways of doing this: a hard link, and a symbolic
link. Both are created with ln.

A hard link is a new actual name for the same file. It must
exist on the same underlying filesystem. Moving the original
file does not invalidate a hard link. Deleting the original
filename does not invalidate a hard link; the file itself
continues to exist as long as at least one hard link exists
somewhere. If you can create a hard link to a file, you can get
to it from the new link's path.

A symbolic link points to the original file's path location.
It's an alias to the location and name, not to the underlying
file. If you delete the file, the symlink becomes invalid; if
you move the file, the symlink is invalid. If you delete the
file and create a new one in the same path with the same name,
the symlink is valid again for the new file.

-dsr-


Reply to: