K
K
khodos_dmitry2022-01-27 16:42:43
linux
khodos_dmitry, 2022-01-27 16:42:43

How to create a symbolic link for a folder and all its nested files and folders?

In this way, I create a symbolic link to the folder with the files:

ln -s /home/mam/imgs/ /home/mam/web/mam.ru/public_html/imgs

But the file mam.ru/imgs/1.jpg is not available. How to make all files and folders from /home/mam/imgs/ accessible.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2022-01-27
@pfg21

understand file permissions, etc.
1. the ****mam.ru/imgs/1.jpg file may not be readable by the program where you put it (I correctly understood this http-server under a separate user )
2. the program that tries to access the file is limited by the directory (chroot) /home/mam/web/mam.ru/public_html and does not have the right to read the file in directories outside the specified path.
then instead of a link use 3. plus still there are restrictions through SELinux. therefore, I advise you to store working sites not in a hamster, but in standard directories, to which SELinux permissions are usually specified for the http server. and for convenience, you can already link the directory from there to your hamster. etc. etc. study :) mount --bind

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question