Mac OS X

Solved: Apache won't serve files from external drive on macOS

If you've tried to develop a website and the files are on an external drive, you might find that httpd will refuse to serve the files. In your browser you'll see:

Forbidden
You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe

And in your Apache error log you'll read:

[core:crit] [pid 45683] (1)Operation not permitted: [client 127.0.0.1:56234] AH00529: /Volumes/externaldrive/website/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/Volumes/externaldrive/website/' is executable

The trouble is, you've checked that the directory is readable and it is. Permissions are correct! You might even have messed with the "Ignore ownership on this volume" checkbox but it doesn't fix the problem.

For me, the issue was caused by macOS's builtin Security and Privacy controls. I'm using MacPorts to install my development stack. I have MacPorts set to use launchctl to start my httpd server in /Library/LaunchDaemons/org.macports.apache2.plist. This plist uses the daemondo wrapper to start httpd.

After giving daemondo (and thus its child process, httpd) Full Disk Access, everything was happy.

How to Install Canon ip4000R Wireless Printer Driver on OS X 10.9

We have a wireless Canon PIXMA ip4000R printer that has served us well. However, a new computer with OS X 10.9 Mavericks did not recognize it, and Canon did not have a driver for it.

I ended up moving the following components from an existing computer on which the printer was already working:

/Library/Printers/Canon
/Library/Printers/PPDs/Contents/Resources/Canon*
/Library/CFMSupport
/System/Library/Extensions/BJUSBLoad.kext

I fixed the permissions:

sudo chown -R root:admin /Library/CFMSupport/
sudo chown -R root:wheel /System/Library/Extensions/BJUSBLoad.kext
sudo chown -R root:admin /Library/Printers/PPDs/

And finally, a link is needed for cups to work:

sudo ln -s /Library/Printers/Canon/BJPrinter/Plugins/BJNP/canonijnetwork.bundle/Contents/MacOS/canonijnetwork /usr/libexec/cups/backend/canonijnetwork

Before I was able to add the printer, I had to connect it via USB to the printer and add the USB version of the printer.

I was then able to add the Canon ijnetwork printer using the normal method of adding a printer in System Preferences. And delete the USB version.

Edit: now tested with OS X 10.10 Yosemite as well.

Solved: Apple Mail, Smart Mailboxes, and Exchange Junk Email

One of the nice features of Mail, the bundled OS X mail client, is Smart Mailboxes. A smart mailbox is a filtered view of your mail based on your own criteria.

I have both IMAP and Exchange accounts and use Mail for both.

The trouble I was having was creating a view of recent mail from all inboxes that did not include mail from the Exchange Junk E-Mail box. When I created a rule for "Message is not in Mailbox" and specified the "Junk E-Mail" box from my Exchange account and saved the smart mailbox attributes, it wouldn't take. In other words, the next time I opened the smart mailbox settings it said "No mailbox selected":

To solve this problem, I went to Mail / Preferences / Junk Mail and changed my selection for "When junk mail arrives" from "Mark as junk mail , but leave it in my Inbox" to "Move it to the Junk mailbox".

Now my smart mailbox works as expected and remembers its rules. And I don't have to use Outlook.

Reference: Smart Mailboxes not working with Exchange Folders?

Configuring syslog for Drupal 7 on OS X 10.7 or 10.8 or 10.9

I'm running OS X 10.7 Lion. Today I'm working on some database-heavy code that also creates lots of watchdog entries. So I decided to turn off Drupal's database logging and turn on syslog.

I created a file for the log entries to go into:

sudo touch /var/log/drupal.log

I added one line to /etc/syslog.conf to tell OS X to put messages coming to the local3 logging facility into the new file.

local3.* /var/log/drupal.log

I rebooted. If I had a neckbeard I would have used launchctl instead.

Then I enabled syslog module on Drupal's module administration screen, went to Administration / Configuration / Development / Logging and errors and set the Syslog facility to LOG_LOCAL3.

And I turned off the database logging module.

Now I can happily watch incoming watchdog entries in a terminal with

tail -f /var/log/drupal.log

UPDATE: OS X 10.8 Mountain Lion and OS X 10.9 Mavericks are slightly different:

1. Just like above, create the log file with

sudo touch /var/log/drupal.log

2. Instead of adding a line to /etc/syslog.conf, add the following line to /etc/asl.conf:

# Drupal logging
? [= Facility local3] file /var/log/drupal.log

3. Restart logging with

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

Pages

Subscribe to RSS - Mac OS X