MAR
MAR

Reputation: 623

How to add user to www-data on CentOS?

I have a problem with a specific area of my website. I have a server with CentOS on it and basic knowledge of Linux systems.

The problem occurs when the folder is set to 755, but when set to 777 it's working fine. I know 777 is not secure, so I looked it up and apparntely I need to add the admin user to a group called www-data. However, when trying to do that, I'm told www-data group doesn't exist which I imagine has something to do with CentOS being a different distribution of Linux.

It might be worth noting that I already added the user admin to the 'apache' group a few days ago, I'm not sure if it's related or not...

Anyway, how can I add the user to this group on CentOS to fix this permission issue?

Thanks

Upvotes: 0

Views: 16144

Answers (1)

Florin
Florin

Reputation: 6179

Add an Existing User to a Group

 usermod -a -G <groupname> username

In centOS is:

usermod -a -G apache username

Upvotes: 9

Related Questions