Monday, September 15, 2014

Getting your local user site available through native Apache on OS X (10.9,10.10)

Edit the following files to get your local user site working:

In http.conf, uncomment the following lines:

LoadModule userdir_module libexec/apache2/

# User home directories
Include /private/etc/apache2/extra/httpd-userdir.conf

In the following file  - "/private/etc/apache2/extra/httpd-userdir.conf", uncomment the following line:

Include /private/etc/apache2/users/*.conf

In your /private/etc/apache2/users directory, create a file with the syntax "your_username.conf". Note to replace the "your_username" with your actual username.

In this file, add the following entries (note again to change the "your_username" entry).
<directory "/Users/your_username/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Require all granted
    #Order allow,deny
    #Allow from all

This is the quickest way to expose your local Sites directory through Apache. You can now access your local directory through a url: http://localhost/~your_username/

You can further refine access rights, but this is the quickest way to get the behavior of user account web sharing back into OS X.