Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 7th, 2002, 10:36 AM
mcsimon mcsimon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 179 mcsimon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 38 sec
Reputation Power: 9
Send a message via AIM to mcsimon Send a message via Yahoo to mcsimon
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:
You don't have permission to access /blah/blah/blueatone/hspa_la/ on this server.



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

Reply With Quote
  #2  
Old March 7th, 2002, 01:53 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 184
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.

Reply With Quote
  #3  
Old March 7th, 2002, 03:14 PM
mcsimon mcsimon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 179 mcsimon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 38 sec
Reputation Power: 9
Send a message via AIM to mcsimon Send a message via Yahoo to mcsimon
What directory are you talking about?

Reply With Quote
  #4  
Old March 7th, 2002, 03:25 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 184
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)

Reply With Quote
  #5  
Old March 7th, 2002, 03:30 PM
NoXcuz's Avatar
NoXcuz NoXcuz is offline
Wiking
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Sep 2000
Location: Sweden
Posts: 3,608 NoXcuz User rank is Sergeant (500 - 2000 Reputation Level)NoXcuz User rank is Sergeant (500 - 2000 Reputation Level)NoXcuz User rank is Sergeant (500 - 2000 Reputation Level)NoXcuz User rank is Sergeant (500 - 2000 Reputation Level)NoXcuz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 7 h 49 m 27 sec
Reputation Power: 21
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

Reply With Quote
  #6  
Old March 8th, 2002, 06:41 AM
mcsimon mcsimon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 179 mcsimon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 38 sec
Reputation Power: 9
Send a message via AIM to mcsimon Send a message via Yahoo to mcsimon
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

Reply With Quote
  #7  
Old March 8th, 2002, 10:54 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #8  
Old March 8th, 2002, 01:30 PM
mcsimon mcsimon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 179 mcsimon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 38 sec
Reputation Power: 9
Send a message via AIM to mcsimon Send a message via Yahoo to mcsimon
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > symbolic link and permissions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT