Apache with a folder for documents / var / www is installed on Ubuntu

drwxr-xr-x 2 root root 4096 окт. 21 23:15 www 

As you can see, only root can write to it. It would be convenient for me to create a symbolic link in my ~ / www home folder and give my user rights to write to this folder. How to do it on bash-e?

    2 answers 2

     # ln -s /var/www/username /home/username/dirname # chown -c username /home/username/dirname 

      You can use mod_userdir and not crutches

      • Well, the mod user dir is also cool, but are these crutches right here? - rnd_d
      • Firstly, there is a generally accepted method for solving the problem. Secondly, your method would not byshovets@byshovets-X61:~$ sudo mkdir -p tmp/test/dirbyshovets@byshovets-X61:~$ sudo ln -s tmp/test .byshovets@byshovets-X61:~$ sudo chown -c byshovets testизменён владелец «test» с root на byshovetsbyshovets@byshovets-X61:~$ touch test/dir/filetouch: невозможно выполнить touch для «test/dir/file»: Отказано в доступе : byshovets@byshovets-X61:~$ sudo mkdir -p tmp/test/dirbyshovets@byshovets-X61:~$ sudo ln -s tmp/test .byshovets@byshovets-X61:~$ sudo chown -c byshovets testизменён владелец «test» с root на byshovetsbyshovets@byshovets-X61:~$ touch test/dir/filetouch: невозможно выполнить touch для «test/dir/file»: Отказано в доступе - bva