CentOS set user for Apache httpd

Source: Internet
Author: User

First, create a user www in CentOS.

The code is as follows Copy Code

Groupadd www
Useradd--shell/sbin/nologin-g www www

Second, set up User,group in the Apache configuration file httpd.conf.

The code is as follows Copy Code

#
# If you are wish httpd to run as a different user or group, your must run
# httpd as Root initially and it'll switch.
#
# user/group:the name (or #number) of the User/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User www
Group www

Finally, the users and user groups that set up the Web site files are www.

  code is as follows copy code

#假设网站部署在/ Home/www the
cd/home/www/
chown-r www:www.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.