Create a Dropbox clone on Mac OS X Mavericks using OwnCloud

My company uses Dropbox extensively for sharing project files. It truly is an enhancement to our workflow. But, we don’t like the privacy concerns of hosting our contracts and other confidential information in their cloud, nor do we like the cost. We like everything else.

OwnCloud is an open source alternative to Dropbox, and provides the same features.

I decided to install it on our Mac mini server to give it a trial run. Here’s how I did it:

Configure your Mavericks server for a subdomain, and enable SSL. We used a self-signed certificate, though if this trial proves worthy, we may obtain a signed certificate for client use.

Check out the installation section of the OwnCloud documentation.

Add required PHP Extensions

It looks like the only required extension that is missing from Mavericks’ default PHP installation is php54-intl, which provides internationalization support. I’ve documented the installation here.

Install MySQL and configure

Apple chose not to include MySQL with Mavericks server for some nutty reason, so we’ll just download and add it in ourselves. Grab the 64-bit version for Mac OS X 10.7. I like using the .dmg version as it has an installer, a preference panel, and a startup installer. Install it, the pref pane and (if you want to autostart it) the startup item.

Then, edit the /etc/php.ini file and set the socket locations. There are three you need to locate in the file and change:

mysql.default_socket=/tmp/mysql.sock
mysqli.default_socket=/tmp/mysql.sock
pdo_mysql.default_socket=/tmp/mysql.sock

Restart Apache to re-read the /etc/php.ini file:

sudo apachectl restart

 Download and install OwnCloud

Download the bits from OwnCloud.org. I’m not going to restate their well-written installation directions.

Notes:

Mavericks Server 3 stores web files at /Library/Server/Web/Data/Sites

When changing the ownership of the own cloud files, use:

chown -R www:www /path/to/owncloud
sudo chmod -R 774 * /path/to/owncloud

In Server.app, you need to click “Advanced Settings” on your site and enable “Allow overrides using .htaccess files”. This correctly sets AllowOverride All.

For what it’s worth, Server.app writes the configuration files for each virtual host at /Library/Server/Web/Config/apache2/sites

Set up background jobs using cron for best performance:

sudo crontab -u www-data -e

Then, press “i” (no quotes) to enter insert mode, and paste (after modifying the path to fit your installation, of course):

*/15  *  *  *  * php -f /path/to/owncloud/cron.php

Now, type “ZZ” (capital Zs, with no quotes) to save the crontab. You can verify by entering:

sudo crontab -l -u www

That’s it. It’s installed and working!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.