Benches macOS

3

Serving apache files from alternate directories with symbolic links

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hello,

I'm trying to serve some files in my Documents directory from within my apache Sites directory by using symbolic links, and it isn't working.

Things I've done:

Linked to Documents directory:

ln -s /Users/username/Documents/test/ /Users/username/Sites/test

Made sure FollowSymLinks was turned on in /etc/apache2/users/username.conf:

<Directory "/Users/username/Sites/">

Options Indexes MultiViews FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

Changed permissions on linked directory and its files:

chmod -R a+rx /Users/username/Documents/test

(I've also even tried to change the owner and group to www, still to no avail)

Restarted apache many times.

Every time I try to access
http://localhost/~username/test/, I get a 403 -- and my apache log says this:

[error] [client ::1] Symbolic link not allowed or link target not accessible: /Users/username/Sites/test

Any ideas?

Regards,

Jeff

3 replies

Sign in or join Beachball Help to reply.

  1. 0

    Byron Formwalt

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Jeff,

    Your posted username.conf file is properly configured. I had this problem, as well. It comes down to a permissions problem with your Documents directory. If you do 'ls -al' in your home directory, you will probably notice either "drwxr--r--" or ""drwxr--r--+" for the permissions of your Documents directory. If you execute 'chmod a+rx Documents' from your home directory, you will probably solve this problem. It worked for me. Please, let me know if it works for you, as well.

    Take care,

    Byron

  2. 0

    jeffinmotion

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Byron,

    Thank you so much, this was exactly the solution to my issue. It wasn't enough that the linked directory had the correct permissions -- Indeed, the +entire path+ needed the correct permissions for Apache to navigate the link!

    Best,

    Jeff

  3. 0

    mhale62

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi,

    My question is possibly analogous to
    jeffinmotion's in that I'm wanting to use symbolic links to four firewire drives in such a way as to represent them as one big drive to an NMT (Popcorn Hour) in my case. Ideally, there's a way that I can put symlinks in a folder/directory and mount that as one folder.

    Is that doable?

    The problem is that the PH's firmware will only see one shared device at a time, i.e., my a/v content is spanning four 1 TB HDs and if I want to watch a vid on a volume other than that which is currently mounted, I have to back out to the Source menu and select and mount the desired drive; cumbersome, to be kind.

    Regrettably I've so little experience w/Terminal and UNIX that I don't have the vocabulary to properly phrase my questions.

    I'm more than willing to reiterate though 😉