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



On Tue, Sep 01, 2020 at 04:08:45PM +0200, tomas@tuxteam.de wrote:
> That depends on context, program, etc. But if you give the program
> an absolute path, every directory from the root down to the file
> has to be readable for your program.

Every directory in the path must have the +x bit for you.  Not necessarily
the +r bit.

The +r bit allows you to *read* the directory, in order to see the names
of the files.

The +x bit allows you to *access* the files in the directory, if you know
their names.  You also need the appropriate bits on the file itself, if
you plan to open it (in either read only or read+write mode).

unicorn:~$ mkdir /tmp/x
unicorn:~$ echo stuff > /tmp/x/file1
unicorn:~$ chmod 100 /tmp/x
unicorn:~$ ls -ld /tmp/x
d--x------ 2 greg greg 4096 Sep  1 10:34 /tmp/x/
unicorn:~$ ls /tmp/x
ls: cannot open directory '/tmp/x': Permission denied
unicorn:~$ cat /tmp/x/file1
stuff


Reply to: