I accidentally set the permissions to /var/www folder as chmod -R 775 /var/www instead of chmod -R 755 /var/www for a new user (not ROOT - but a new super user) I created on my VPS server.

Is there a way to reset the permissions to its original settings?

I am having multiple domains hosted on my VPS and I need to give permissions to website folders individually.

Kindly suggest. Thank you.


1 Answer 1


If the goal is to reset the Apache directories to what they typically are after installation, you can do this:

  1. Ensure the /var/www directories and files have the correct read/write permissions:
    sudo chmod -R 755 /var/www
  2. Ensure the /var/www directories and files belong to the correct owner and group:
    sudo chown -R www-data:www-data /var/www

That is all.

  • This is not all, this will make every file executable, I suggest you do not do this.
    – pwned
    Feb 10 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.