[Linux] Set apache document root authority and owner

Writing time : 2015-12-27 15:00:52

Set apache document root authority and owner

When I installed CentOS 7.0 and checked the file owner of the Apache document root, both the owner and the group were root.

In order to do web development, you need to be able to access the document root folder and upload or modify files, but it seemed necessary to modify it.

First, I added a group to give permission for web development.

#groupadd webadmin  

And the owner is as root, and the owning group is changed to the newly created webadmin.

#chown root:webadmin /var/www/html/  

The access authority of the file was modified from 755 to 2775 so that access and modification in the webadmin group is possible.

#chmod 2775 /var/www/html/ -R  

Now, add a user for web development and designate the group as webadmin.

In this case, I added an account called webdev that can work in the document root by designating the group as webadmin.

#useradd -g webadmin webdev  

Set the password for webdev.

You can test whether the file addition and modification work with the newly created account.

Reference URL


Previous post

Next post

Other posts in the category