编译安装了Apache 2.2.17,忘记在httpd.conf中更改默认的user,结果导致httpd无权操作Magento Cache目录。
首先,在CentOS中建立用户www。
groupadd www useradd --shell /sbin/nologin -g www www
其次,在Apache配置文件httpd.conf中设置User,Group。
# # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will 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
最后,设置网站文件的用户和用户组为www。
#假设网站部署在/home/www下 cd /home/www/ chown -R www:www .
0 个评论
662 次阅读