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

Support for security such as Firewalls and securing linux
Post Reply
lightman47
Posts: 738
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.
"The more I learn, the behinder I get"

User avatar
TrevorH
Forum Moderator
Posts: 23849
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 .
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

lightman47
Posts: 738
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.
"The more I learn, the behinder I get"

Post Reply