Permissions for /Var/Www/Html

Permission denied inside /var/www/html when creating a website and it's files with the apache2 server

sudo chown -R $USER:$USER /var/www

this works, it changes the owner to my user instead of root user. I still don't understand because my user already had sudo rights and all those permissions. It was the user I created during the ubuntu18.04 setup, so there shouldn't be an issue, or idk.

permission for var/www/html directory

I solved the problem by running this command

a2enmod rewrite

then restart apache server.

Thanks to everybody tryed to help me :)

How can I give access of var/www/html to another user using AWS?

I cannot totally get what are you requiring. But I think this would be a pure Linux permission problem, not an AWS problem.
For changing the permission of a folder in AMZ Linux, you could do it just like that you can assign the permission to a single user or a group in other universal Linux version with chmod command.

Here are some sample snippets for your reference:

sudo chmod [the_new_user_you_created] 755 -R /var/www/html

sudo chown -R ec2-user:apache /var/www

For the best practice, you could find the recommendation for initializing a web server in AWS from this official link:
To set file permissions for the Apache web server

Is it safe to change permissions of /var, how is it done if so? What can I do instead if not?

Change into the html/ directory and execute the following command

chmod 766 UBERNET 

You have now enabled reading from and writing to that folder. Only the owner of yje folder can execute any file in the folder (if there are executable files) which should be fairly safe for your application.

permission denied to write into /var/www/ folder

Don't do that (777).

Be granular (see comments above).

touch /var/www/.cache
chgrp www-data /var/www/.cache
chmod g+w /var/www/.cache


Related Topics



Leave a reply



Submit