#1
  1. 300lb Bench!
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2001
    Location
    New York
    Posts
    2,350
    Rep Power
    61

    Symbolic link not allowed error for mounted drive


    Here's what I'm trying to accomplish. I have a macbook and want to place a symlink from my Sites directory (which apache can see) to my mounted usb drive. In the past, I just had everything locally under Sites and all was fine. So it was

    /Users/my_user/Sites/directory/httpdocs/(my stuff)

    I now want

    /Users/my_user/Sites/(symlink)

    and "symlink" points to my mounted usb drive (which has the same stuff as before). I created the symlink no problem. I set it up as a virtual host, so I modified my /etc/hosts file to add

    127.0.0.1 mylocalsite.com

    my httpd.conf file references my virtual hosts file, which has an entry for my site as so

    Code:
    <VirtualHost *:80>
        DocumentRoot "/Users/my_user/Sites/directory/httpdocs"
        ServerName mylocalsite.com
        ErrorLog "/private/var/log/apache2/mylocalsite.com-error_log"
        CustomLog "/private/var/log/apache2/mylocalsite.com-access_log" common
        <Directory "/Users/my_user/Sites/directory/httpdocs">
          Options            FollowSymLinks
          AllowOverride      All 
        </Directory>
    </VirtualHost>
    All of this worked fine and dandy until I tried replacing my local files with a symlink. I've googled for hours to no avail. I set FollowSymLinks. All of the directories on the mounted drive have 755 (or greater) access from the root directory up to the directory that has my site. My apache user is _www (which is standard I believe for Mac Os X), but my files are owned by "my_user", although this was never an issue when the files were local.

    Everything I'm reading says that at this point I probably just have a permissions issue, but I don't see it. I even made my index file 777 access. Any thoughts?
    Correspondence chess
    nothingbutchess.com
  2. #2
  3. 300lb Bench!
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2001
    Location
    New York
    Posts
    2,350
    Rep Power
    61
    After a little thought, I figured out what my problem was. My directory structure is

    /Users/my_user/Sites/directory/httpdocs/(my stuff)

    with everything under "Sites" being a symlink. However, my directive says

    Code:
    <VirtualHost *:80>
        DocumentRoot "/Users/my_user/Sites/directory/httpdocs"
        ServerName mylocalsite.com
        ErrorLog "/private/var/log/apache2/mylocalsite.com-error_log"
        CustomLog "/private/var/log/apache2/mylocalsite.com-access_log" common
        <Directory "/Users/my_user/Sites/directory/httpdocs">
          Options            FollowSymLinks
          AllowOverride      All 
        </Directory>
    </VirtualHost>
    The problem was the Directory part. This tells apache to follow all symlinks under httpdocs. Well my symlink starts at "directory". So I solved the problem by making "directory" a regular directory. So now /Users/my_user/Sites/directory is just a plain old directory. Then, I made "httpdocs" point to httpdocs on my thumbnail drive. Finally, I changed

    <Directory "/Users/my_user/Sites/directory/httpdocs">

    to

    <Directory "/Users/my_user/Sites/directory">

    So now it will follow all symlinks under "directory", which is what I was after.

    Btw, usb drives are SLOW! I need to get myself a faster firewire or thunderbolt drive! Anyway, hopefully this will help save someone the hours of confusion I wasted on this matter.
    Correspondence chess
    nothingbutchess.com

IMN logo majestic logo threadwatch logo seochat tools logo