I have been attempting to set proper permissions during the configuration of a virtual host but keep running into a 404 page error. It only occurs during permission changes. What is the best directory permission for multiple virtual hosts?
/var/www/vhosts/website1/httpdocs /var/www/vhosts/website2/httpdocs
Currently, I am copying the default skeleton directory and then using useradd to set the home directory to those identified above and then adding each user to the www-data group. Once I do this, even changing ownership to the user:www-data and permissions as 0770 I start seeing the 404 page.
Any good guides that explain permissions for web root directories?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Disregard. Finally figured it out. <br> <br># Add user with a pre-determined home directory <br>sudo useradd -s /bin/false -d /var/www/vhosts/website1 -m user1 <br> <br># Add the user to the www-data group <br>sudo usermod -aG www-data user1 <br> <br># Change password <br>sudo passwd user1 <br> <br># Change the owner of website1 to the user and www-data <br>sudo chown -R user1:www-data /var/www/vhosts/website1 <br> <br># Change permissions owner = all, group = all, anyone = r+x <br>sudo chmod -R 0775 /var/www/vhosts/website1 <br> <br># Make all changes below this directory inherit same permissions <br>sudo chmod g+s /var/www/vhosts/website1 <br> <br>This is what I have so far. Open to suggestions.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.