LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to create a shorcut to a folder and its subfolders..? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-a-shorcut-to-a-folder-and-its-subfolders-4175462116/)

javier_ns 05-15-2013 11:33 AM

How to create a shorcut to a folder and its subfolders..?
 
Hi, I'm a newbie in linux, but reading a lot and with trial and error, I was able to setup a CentOS server.. :D
But there is something that I havent been able to do... and I'm posting here so maybe you guys can help me, and give me any direction about these..
I have a folder with images, css, etc.. that is common for all the pages I'm seting up, but I dont want to make a new copy of the folder each time a new page comes up, but instead, just link them to the main folders, so I Though about create shorcuts to the folders... (Image Attached)

http://i256.photobucket.com/albums/h...pse77db082.jpg

And I use:
ln -s /var/www/html/carpetas_html/index.php /var/www/html/prueba1/sistema/html/index.php

And it was ok, but when I tried the same with the folders, it seems that it doesn't find the content inside the folder... :(
Is there a way of doing these, or maybe I shoud try any other method...?
Thanks a lot in advance..!!

jpollard 05-15-2013 12:50 PM

It may depend on the options specified for Apache. If you have "followsymlinks" it should work as long as the apache UID/GID has access to the directory and files within that directory.

It also may depend on what the link is named (as apache does do interpretation on that) and the target directory. What is the symbolic link that doesn't work?

HOWEVER, on some systems (RH mostly), access to files and directories is also controlled by SELinux, and files/directories to be accessed by Apache must also have the correct security label.

javier_ns 05-15-2013 02:15 PM

Hi, Thanks a lot for your quick answer... the name of the folders are exactly the same as in the image attached before... this is a screenshot of how it look after I made the shorcuts.. http://i256.photobucket.com/albums/h...psbe9b25c6.jpg
And I'm not quite sure wich one of them its not woking, because the index.php, is redirecting, but after that I got an HTTP 500 (Internal Server Error), and since I haven't create any virtualhost yet, I havent use the followsymlinks option... one more thing, I am working from webmin, and in the screenshot, it seems that the folders css and images got no icon at all.. its that normal, some webmin issue, or maybe something to lookup..?

Thanks again for your help..!!

jpollard 05-15-2013 05:51 PM

You have to use the followsymlinks option. It isn't a default.

I don't use webmin as I find it hides too much information necessary. OK for casual stuff.

On my system I have the following for the web server root document:
Code:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

If that "Options FollowSymLinks" isn't there, then it will not use symbolic links, and it will give you an error in the apache logs.


All times are GMT -5. The time now is 01:09 AM.