I would like to be able to edit the source code of my website from my editor and also allow the website to load in the browser. With sudo chown -R 'www-data':'www-data'the code is not editable but loads on the browser and with sudo chown -R 'username':'username' the other way around.
How can I get both?
Asked
Active
Viewed 66 times
0
Shakur
- 101
1 Answers
0
First, give the ownership to www-root using the command:
sudo chown -R 'www-data':'www-data' /var/www
Then, give permissions to group members using the command:
sudo chmod -R g+rw /var/www
Finally add your username to the www-data group using this command:
sudo adduser
your_usernamewww-data
This way, you will be able load on the browser as well as edit the files.
myusuf
- 130