LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   help with symbolic links (https://www.linuxquestions.org/questions/linux-general-1/help-with-symbolic-links-192482/)

sopiaz57 06-11-2004 05:31 PM

help with symbolic links
 
Help! i would like to link a folder in my /home/user folder to my www root folder so apache/the web can read my files

this is only temp. until the domain name registers, so for a short time i would like to have www.site.com/temp refer to /home/users/tempwww

can i do it, possibly with a sym. link??

thank you much in advance

tbeehler 06-11-2004 05:39 PM

I personally have not tried it, but I would imagine as long as you make sure that the directory you want to link to has proper permissions, I think it would work with a sym link. On the other hand, are you sure that you want to do something like this? I am far from the most knowledgable linux security guru, but what you want sounds dangerous as anyone would be able to get into your files and delete/corrupt them and you would be unable to logon properly. But this is just a shot in the dark answer, so please take my advice with a grain of salt. Hope that helps out!

Travis

Dark_Helmet 06-11-2004 06:17 PM

I haven't specifically tried it, but I don't see that there would be a problem with a symlink as long as the directory you point to has the appropriate permissions.

Apache has a feature to look in a user's directory for html files. Perhaps not exactly what you're hoping for (url-wise), but here's what this is how it works. You modify your httpd.conf file to give one or more users permission to use this feature, specify what the directory name would be, restart apache, and you can access the page via "http://your-domain-here/~username". You must make sure the web server has access to the directory and the files. If not, you'll get a permission denied error page when accessing the file.

To set this up, open up your httpd.conf file and look for "UserDir". Mine is set up something like this:
Code:

...

UserDir disable
UserDir enabled user1 user2 ...

UserDir public_html

...

As far as I understand, that configuration prevents the web server from implementing user access except for those users explicitly mentioned on the "enabled" line. You'd also need a public accessible directory named public_html in the user's home directory to hold the html code. And directories leading to that dir must have at least execute permissions to allow the web server to access files (not necessarily read access... just execute). The files need to have read access.


All times are GMT -5. The time now is 11:56 AM.