Home
Friends

> Recent Entries
> Archive
> Friends
> User Info
> photos!!

Advertisement

December 21st, 2009


brocklisoup
02:52 pm - Running Multiple Sites in MAMP

Originally published at Brock Boland. Please leave any comments there.

I’ve got a few development sites running on my laptop, and I generally want them to be at the document root to mimic the live site as much as possible (ie, at http://localhost/ instead of http://localhost/Clients/ClientA/). Until today, I’ve been switching the Document Root in MAMP every time I switch projects, which is fine when you only switch projects once in a while. I just made some config changes to make this easier and a little more sensical, and I thought I’d write about it here in case anyone else is looking for ideas on the Googles.

First, open /private/etc/hosts and add hosts for each client you want to host, so your machine knows to look for the domain on your own computer. I use local.clientname.com because it’s unlikely that most sites have a local subdomain, but you can use something different. My host file has these two lines at the bottom:

127.0.0.1       local.clienta.com
127.0.0.1       local.buffalostuff.net

Then run this in Terminal to flush your DNS cache:

dscacheutil -flushcache

Now, you can navigate to those URLs (http://local.clienta.com and http://local.buffalostuff.net in my case) and MAMP will serve up whatever it has.

That’s half the job. Now, you need to configure Virtual Hosts for the domains. In the MAMP Preferences, on the Apache tab, make sure the Document Root is set to your Sites directory (in my case, /Users/bboland/Sites/). Then, open /Applications/MAMP/conf/apache/httpd.conf, and add a virtual host at the bottom of the file for each domain:

NameVirtualHost *

<VirtualHost *>
ServerName local.clienta.com
DocumentRoot /Users/bboland/Sites/ClientA
</VirtualHost>

<VirtualHost *>
ServerName local.buffalostuff.net
DocumentRoot /Users/bboland/Sites/BuffaloStuff
</VirtualHost>

Stop and re-start the servers in MAMP. Now you can navigate to those two sites and actually get the right content.

The biggest problem I see with this is maintenance: any time you take on a new project, you need to make sure you update the hosts file and Apache config. But, since you only need to do it once, it’s not that bad.


 

December 18th, 2009


brocklisoup
07:17 pm - Blog Bankruptcy

Originally published at Brock Boland. Please leave any comments there.

Not unlike last time, I’ve been putting off posting because there are more important things I haven’t had a chance to write about. So, I’m declaring blog bankruptcy yet again, with the understanding that I feel bad that I haven’t written about:

  • Our awesome wedding
  • Our awesome honeymoon
  • Turning 26
  • Being in DC for four full years
  • Leaving the job I’ve had for those four years
  • Starting a new job
  • Paying off my credit cards (thanks entirely to Erin)
  • Various other more minor things

I still intend to write about that stuff soon-ish, but I’m not going to feel bad about posting about other, smaller stuff in the meantime.


Tags:

 

December 15th, 2009


afterannabel
11:54 pm
Not going to the East coast this month, pretty upset about it and don't want to talk about it right now.

I'll be in St. Augustine, Florida June 4-6 for Slayage Conference. I'm waiting to hear back on SWTX/PCA (St. Louis, Missouri March 31-April 3) and PCA/ACA (Albuquerque, New Mexico February 10-13) before I make any future plans to see friends and family.

This hurts.

(Leave a comment)


> Go to Top
LiveJournal.com