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/mod_userdir.so

# 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
</directory>


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.

Tuesday, November 12, 2013

Linking frameworks to app bundles in Cocoa (via Xcode)

If you're looking to link a framework to an app bundle, here's the easiest way to achieve it in 3 quick steps (applies for OS X 10.5 and up):


  • For the framework you're linking, setup the installation directory with @rpath 
  • For the application that's going to use the framework
    • Copy the framework to the Frameworks directory under the app bundle
    • Add the following entry into the App's Linking section. Essentially where to look for the framework within the bundle


And that's it - you're done. Lots of articles on the web on this (and of-course Apple's documentation).