Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Need help with symbolic link

Need help with symbolic link
Thread Tools
MDWeezer
Forum Regular
Join Date: Feb 2005
Status: Offline
Reply With Quote
Jan 22, 2006, 03:27 PM
 
Hello,

I've created a standard symbolic link using the following command:
Code:
ln -s /Users/matthewwilliams/Music/iTunes/ iTunes
This in turn created a "iTunes" folder witthin my "Sites" folder for Apache to access.

When I attempt to navigate to http://127.0.0.1/matthewwilliams/iTunes I get a "Unauthorized access" message from Apache.

How would I configured Apache to give me full access to my iTunes library from the web? I'm writing some software that needs access to it via the web.

Thanks!
     
Tesseract
Grizzled Veteran
Join Date: Apr 2002
Location: california
Status: Offline
Reply With Quote
Jan 22, 2006, 07:40 PM
 
cd ~/Sites
ln -s ~/Music/iTunes iTunes

turn on Personal Web Sharing in System Preferences' Sharing pane
navigate to http://localhost/~your_short_user_name/iTunes/

I'm not sure if Apache directory indexing is on by default. If it's not, you'll get an error message and you will have to use the URL of a specific file.
     
MDWeezer  (op)
Forum Regular
Join Date: Feb 2005
Status: Offline
Reply With Quote
Jan 22, 2006, 07:47 PM
 
That did the same thing I did, didn't it?

I'm still getting the same message. I would like the ability to navigate in my browser, so I guess I need the correct httpd.conf?
     
si_lance
Dedicated MacNNer
Join Date: Nov 2003
Location: SoCal
Status: Offline
Reply With Quote
Jan 22, 2006, 09:09 PM
 
I believe the apache daemon runs as user nobody so the Music dir is inaccessible. Did you try chmod o+x /Users/matthewwilliams/Music
     
Mithras
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Jan 22, 2006, 11:42 PM
 
You need to change your /etc/httpd.conf. Read more in the Apache documentation.
Briefly: Add a section with
<Directory /Users/matthewwilliams/Music/iTunes>
Allow All
</Directory>

to permit reading in that directory. Otherwise, the default permissions are set to deny read access to all directories unless specifically overridden.
     
Gavin
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Jan 23, 2006, 02:11 AM
 
To expand on what mythras said:

By default apache will not follow symbolic links.
try adding this to the directory settings:

Options FollowSymLinks
You can take the dude out of So Cal, but you can't take the dude outta the dude, dude!
     
MDWeezer  (op)
Forum Regular
Join Date: Feb 2005
Status: Offline
Reply With Quote
Jan 23, 2006, 09:04 PM
 
I've tried editing my httpd.conf file with the following:

Code:
<Directory /> Options FollowSymLinks Allow All </Directory>
However whenever I make the change to the config I can't restart apache, when I try to start it, it just hangs but when I comment it out it starts up fine.

Hmmm
     
[APi]TheMan
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Jan 24, 2006, 01:32 AM
 
Originally Posted by MDWeezer
I've tried editing my httpd.conf file with the following:

Code:
<Directory /> Options FollowSymLinks Allow All </Directory>
However whenever I make the change to the config I can't restart apache, when I try to start it, it just hangs but when I comment it out it starts up fine.

Hmmm
Well, I wouldn't do that exactly... just make the "Directory" directive for your music directory, like Mithras said.

Also, if you're restarting "Personal Web Sharing" from System Preferences, you won't get any verbose error messages... it might be more helpful to restart apache from the command line like this:
Code:
sudo apachectl graceful
.

Graceful, by the way, is where Apache re-reads its configs and spawns httpd processes from that point on with the new settings, but doesn't kill the existing ones (they may be in the middle of serving a webpage).
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:05 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,