This is the third installment of a series on BAMP. If you’re coming in the middle, you may want to start at the first in the series where I discuss the benefits of using BIND for local web development. Read More
This is the second part of a series on BAMP. In this part we will configure Apache using a wildcard virtual host and explore virtual document root. This tutorial was made using OS X 10.11.3 El Capitan with Apache 2.4. My text editor of choice is TextMate and it’s command line utility is mate. So when you see that command, substitute the text editor of your preference.
A number of years back I was introduced to BIND by an article titled A Smarter MAMP. In the following tutorials I’ll try and pay the favor forward to those who have yet to discover the awesomeness of running a local DNS server on top of a typical AMP (Apache MySQL PHP) stack. BIND isn’t the only option. If you want a DNS server with little to no configuration then DNSMasq is the better option for you.
Lets take a minute to talk about how we will eventually install the stack in reverse order.
PHP is installed on OS X by default, So we only need to load it’s module in our Apache config file.
MySQL is readily available from www.mysql.com; but I like to install it via Homebrew.
Apache is installed with OS X as well. It just needs a little configuration and to be loaded on boot.
BIND can also be installed via Homebrew
You’re probably familiar with the AMP part but what about the “B”. What can BIND do that you can’t do with out it? Let’s review the old way of doing things versus the new way with BIND.
Recently when trying to install a mod_bonjour module for Apache I encountered the following error:
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain/usr/bin/cc: No such file or directory
It appeared that Xcode was missing a symbolic link. Here’s how to resolve the error:
sudo ln -s XcodeDefault.xctoolchain OSX10.11.xctoolchain
Remember the good old days when OS X ‘s Apache came with mod_bonjour and user sites were broadcast automagically. It can be a useful feature especially in a multiuser or lab setting. Well never fear, you can activate it once again. All you need to do is compile and install mod_bonjour for Apache on El Capitan.
What can mod_bonjour do? It can automate three types of tasks over your LAN:
All of which require zero configuration once the Apache module has been compiled, loaded, and a few directives set. Pretty nifty huh? So let’s get to it. Read More
OS X 10.11 El Capitan introduced a security feature called System Integrity Protection or SIP. It flags certain system directories and files as “Restricted” and they cannot be altered not even using the root account.
|Directories that are jailed by SIP|
|Directories that allow root access for developers|
For better or worse, SIP is a good thing. It not only protects you from malicious intent but it can also protect you from yourself, insuring that only Apple signed software can alter certain system files. And it makes you think twice before meddling where you probably shouldn’t.
If you’re gonna develop on a mac you’ll want to get started by downloading and installing Apple’s developer app Xcode. This will allow you to install nifty command line tools like ruby and git among others. So go ahead and download Xcode via developer.apple.com.
Once you’ve installed Xcode, you can install the line tools by opening Terminal and entering:
You’ll need to launch Xcode from the Finder or Terminal and agree to Apple’s terms of service to complete the process and finalize the installation.
That’s all there is to it.
There are times when navigating the filesystem of a Mac that the Finder comes in handy. Like being able to drag and drop files and folders into Terminal and have the path automagically appear instead to having to type the whole thing. Unfortunately by default, much of the OS is hidden but there are ways way to see it.
You can always use the Finder’s “Go” menubar item to “go to folder” (keystroke: Cmd+Shift+G) to access hidden directories. That can get tedious if you’re repetitively accessing hidden folders. So how do we make the invisibles visible?
Read on to find out how.