|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
symbolic link and permissions
Hi All
I hope this an appropriate thread for the apache forum: I currently have a symbolic link under my public_html pointing to a directory of files outside of the web root. I can access the directory with no problems via a web browser. Apache follows the symbolic link with NO PROBLEMS. This is what I want! However, I want to create random named symbolic links for each visitor to the website to make it difficult for people to share the content from my site. But when I try to create a symbolic link via PHP, PERL etc. it doesn't work. The only difference I see between creating a symbolic link via telnet and a scripting language is the owner:group. When I create a link from telnet, I have my default permissions set myname:mygroup, which matches the permissions of the target directory myname:mygroup. But when I create a symbolic link via a scripting language I get nobody:nobody . After creating a symbolic link (blueatone ->some directory outside the webroot) via PHP, I got this error: Quote:
Does the symbolic link have to have the same owner:group as the target? My intuition says yes. IF that's the case, what can I do? Any help/feedback? Thanks |
|
#2
|
|||
|
|||
|
nope, symbolic links inherit the permissions of the file they point at. it is probably the directory´s permissions that make the problems...
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
|||
|
|||
|
What directory are you talking about?
|
|
#4
|
|||
|
|||
|
the directory the TARGET of your link resides in...
you cannot access files in a directory if you only have permission to access this file but not to access the directory it is in (or any parent directories) |
|
#5
|
||||
|
||||
|
And since it's Apache (PHP/PERL) that creates the link in /blah/blah/blueatone/hspa_la/, it's the user who runs the httpd that needs write permissions...
//NoXcuz
__________________
UN*X is sexy! who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep |
|
#6
|
|||
|
|||
|
I'll admit that I appreciate the feedback, but I'm not sure all of what you are saying. I'm not sure that my explanation is clear
![]() Is there a way for me to do what I described? Are the problems I'm explaining part of the learning process? Is this a result of the hosting companie's configuration? Thanks |
|
#7
|
|||
|
|||
|
What's not clear? The user Apache runs as need to have permission to the target file. You can't do this:
ln -sf /etc/master.passwd /blah/blah/blueatone/hspa_la/master.passwd |
|
#8
|
|||
|
|||
|
Thanks for the feedback
![]() I created .htaccess file containing the following line: Options +FollowSymLinks I didn't need to change permissions anywhere. Now, all works well. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > symbolic link and permissions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|