Search blog

Sunday, March 26, 2017

[SOLVED] - Add Currently Logged in User to Apache User & Group [www-data:www-data]

If you are experiencing permission issues with your web directories and files, use the following commands to resolve it, This solution is very helpful if you are trying to run Wordpress/Other CMS in localhost environment:

1. Adds the currently logged in user to the www-data group.

 sudo usermod -aG www-data $USER  

2. Changes the ownership of the /var/www directory to www-data group.
 sudo chown -R www-data:www-data /var/www directory_name

3. Sets the proper permissions so you can upload files via sftp, manage files via command-line, and upload plugins and media directly in WordPress.
 sudo chmod -R 774 /var/www directory_name

No comments:

Post a Comment

Thank you for your Feedback!
www.evagabond.me

Top 5 Posts (Weekly)