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
Recursive Copy of a Specific File Type Maintaining the File Structure in Unix/Linux
When to Use Kernel Threads VS Workqueues in the Linux Kernel
Change Directory and Execute File in One Command
How to Create a File in Linux from Terminal Window
Getting Error on Supervison on Supervisorctl Error (No Such Process)
Attach to a Processes Output for Viewing
How to Make a Public HTML Folder in Ubuntu
Ssh: Could Not Resolve Hostname [Hostname]: Nodename Nor Servname Provided, or Not Known
Ctrl-P and Ctrl-N Behaving Unexpectedly Under Docker
Crontab Day of the Week Syntax
Setting an Environment Variable Through a Perl Script
Linux Shell Script for Each File in a Directory Grab the Filename and Execute a Program
Can't Use a Variable Out of While and Pipe in Bash
Run a Shell Script from Docker-Compose Command, Inside the Container