阅读背景:

AWS - 将所有文件的权限更改为ec2-user和wordpress现在不上传或拥有任何文件

来源:互联网 

I was not able to upload any files in filezilla.. so i changed permission of all files under /var/www/html to ec2-user

我无法上传filezilla中的任何文件..所以我将/ var / www / html下所有文件的权限更改为ec2-user

I ran this command - chown -R ec2-user /var/app/current

我运行了这个命令 - chown -R ec2-user / var / app / current

After that Filezilla was working but it burnt the apache.

在Filezilla工作之后,它烧掉了apache。

Now wordpress doesnt create any files in wordpress directory. It says it doesnt have any permission. I guess i killed permission of apache on those files. How can revert back the changes? or atleast how can i give the permissions back as it was?

现在wordpress不会在wordpress目录中创建任何文件。它说它没有任何许可。我想我杀死了这些文件的apache权限。如何恢复变更?或者至少如何才能恢复权限?

1 个解决方案

#1


0  

  • Add ec2-user to apache group : sudo usermod -a -G apache ec2-user

    将ec2-user添加到apache组:sudo usermod -a -G apache ec2-user

    Logout and Re-login to instance

    注销并重新登录实例

    • Change the group ownership of /var/www and its contents to the apache group.
    • 将/ var / www及其内容的组所有权更改为apache组。

    sudo chown -R ec2-user:apache /var/www

    sudo chown -R ec2-user:apache / var / www

    • To add group write permissions and to set the group ID on future subdirectories, change the directory permissions of /var/www and its subdirectories.
    • 要添加组写入权限并在未来的子目录上设置组ID,请更改/ var / www及其子目录的目录权限。

    sudo chmod 2775 /var/www find /var/www -type d -exec sudo chmod 2775 {} \;

    sudo chmod 2775 / var / www find / var / www -type d -exec sudo chmod 2775 {} \;

    • To add group write permissions, recursively change the file permissions of /var/www and its subdirectories:
    • 要添加组写权限,请递归更改/ var / www及其子目录的文件权限:

    find /var/www -type f -exec sudo chmod 0664 {} \;

    find / var / www -type f -exec sudo chmod 0664 {} \;

Pleae Refer to this AWS Documentation

请参阅此AWS文档


分享到: