Who is SUPPOSED to be the owner of /var/www ?

Support for security such as Firewalls and securing linux
Post Reply
lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Who is SUPPOSED to be the owner of /var/www ?

Post by lightman47 » 2018/07/24 12:26:11

On my system it is apache, though as you progress further into the sub directories it changes to root. I suspect it should be root, and that this happened several years ago with an errant command (in the wrong directory).

It's my only web server so I haven't another with which to check.

Thank you.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Who is SUPPOSED to be the owner of /var/www ?

Post by TrevorH » 2018/07/24 12:35:20

So /var/www is owned the httpd package and you can see what files have changed their permissions/ownership by using rpm -V httpd. You can use rpm --setperms|--setugids to reset the permissions on all files/directories owned by an rpm.

Mine is:

Code: Select all

drwxr-xr-x. 3 root root 4096 Jun 23 21:05 .
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Who is SUPPOSED to be the owner of /var/www ?

Post by lightman47 » 2018/07/24 12:43:26

I will change it back to root. I have a special group assigned that contains myself and my son with 'rwx' which I need to remain, so I don't want to change that.

Thanks - saving this for future reference.

Post Reply