Problem with permissions when syncing to sites directory

  • Question
    Anonymous
    Inactive

    Is there a way to symbolically link a directory using ln to my ~/Sites/ directory on OS X so that the permissions are correct so it may be viewed in a web browser when I’m doing web development on a local machine?

    This is what I did ln -s ~/code/web/yolkportfolio ~/Sites/yolkportfolio I then chmod 755 on the directory but it still isn’t readable.

    Any help would be greatly appreciated.

    The problem was with my apache config. Here is what allowed it to work, just the FollowSymLinks rule.

    <Directory "/Users/Joe/Sites/">     Options Indexes MultiViews FollowSymLinks     AllowOverride None     Order allow,deny     Allow from all </Directory> 

    You have a couple of options:

    1. If you are running apache with a different user (not yours), and definitively want the DocumentRoot to point to some directory inside your home, you meed to change permissions to your home directory (defaults must be 750 or 700) to 755

    I’d only recommend this if this is your laptop or your personal computer and no one else has access to it.

    2. The first one is not an option but you still want the DocumentRoot inside your home, then you can change the user who runs apache. Edit its configuration file and look for directives User and Group.

    3. Second one is still not an option, and still … you want things inside your home. Use apache’s mod_userdir. With the following configuration:

    <IfModule mod_userdir.c>         UserDir public_html         UserDir disabled root          <Directory /home/*/public_html>                 AllowOverride FileInfo AuthConfig Limit Indexes                 Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec                 <Limit GET POST OPTIONS>                         Order allow,deny                         Allow from all                 </Limit>                 <LimitExcept GET POST OPTIONS>                         Order deny,allow                         Deny from all                 </LimitExcept>         </Directory> </IfModule> 

    This is the default configuration for Apache’s mod_userdir on Debian. You will be able to access:

    /home/your-username/public_html/* 

    on your browser at the following address:

    http://somewhere/your-username/* 

    4. Finally, you could place DocumentRoot somewhere else (/srv/www, /opt/www or whatever) and setup permissions as needed.

    6

    • I’ve done what you said with permissions but I’m still getting problems while trying to access the directory. I still get 403: Forbidden

    • Can you post your apache’s config files ?

    • My apache config file may be seen here.

    • Post the exact command you used to change permissions

    • chmod -R 755 ~/Sites/yolkportfolio/ which is symlinked to my ~/code directory.

  • You must be logged in to reply to this topic.