Sunday, July 30, 2017

linux - Permissions/Owernship issue on local LAMP install











I have a local dev environment set up with a LAMP stack, it's used for WordPress development.



Now, whenever I want to edit a file in /var/www/mysite I need to type in sudo before I can edit anything. This is obviously a unnecessary, and I was wondering what I need to set up to fix this issue.


Answer



You can add yourself into the www-data group



Then you would have to make all files writeable for the group www-data: sudo chmod g+w * -R, but if wordpress creates new files those will have the wrong permissons again. To avoid that you have to set the umask, check this link for further information:
https://wordpress.stackexchange.com/questions/2200/cant-install-new-plugins-because-of-the-error-could-not-create-directory




or since you are on your local system and don't have to fear the evil internet, you could run apache under your user.



Most often you can find the settings in httpd.conf, there you will find two options:



User www-data
Group www-data


Hope I could help


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...