I updated my php version 5 to 7 in the aws ec2 server. After I have updated my root folder permission, it has been changed to drwxr-sr-x when I try to change permission I got error like
chmod: changing permissions of ‘/mnt/my-data/webroot/’: Operation not permitted
And one more thing here I have used separate folder to access my website means that I am not using /var/www/html instead of that I have created one more folder like /mnt/my-data/webroot/.
And after installation of php 7 I got one more error like
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/virtual-hosts.conf:1
Here I have created virtual hosts and it is working fine. Now how to solve issue and how can I give 755 permission to /mnt/my-data/webroot/ this folder and when ever try any chmod operation I got an error like
chmod: changing permissions of ‘/mnt/my-data/webroot/’: Operation not permitted
How can I solve this?
11 Answer
To correct permissions, run the following commands on your EC2 instance:
sudo chown root:root /home sudo chmod 755 /home sudo chown ec2-user:ec2-user /home/ec2-user -R sudo chmod 700 /home/ec2-user /home/ec2-user/.ssh sudo chmod 600 /home/ec2-user/.ssh/authorized_keysTo correct permission for specific folder and all it's contents run this command, this is a very powerful command and please mind what you're giving permissions to!
sudo chmod ugo+rwx /home/ec2-user/specific-folder/.*