Saturday, December 5, 2009

Configuring my new MacBook Pro for development

I'm setting up my new —well, used, thanks JB!— MacBook Pro with Snow Leopard for development. I'm using MacPorts for simplicity, but of course, one always runs into something that baffles and confounds.

For future reference and benefit as I struggle through this:

Setting up the MAMP environment for Apache

  1. Don't forget to install XCode before installing MacPorts.
  2. This MacPorts guide is a good starting point.
  3. My first struggle was to get the right Apache launching, NOT the built-in Mac version.
  4. Make sure that the "web sharing" is off in System Preferences. This should be done before installing the apache2 macport.
  5. To check if you're running the right httpd (Apache daemon process) in terminal:
    ps -ax | grep httpd
    you want to see /opt/local/apache2/bin/httpd

    you don't want to see /private/etc/apache2
  6. To get apachectl commands working in terminal, I couldn't get the alias working, I had to add the path to .profile like this:
    export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/apache2/bin:$PATH
    That includes the paths that MacPorts wrote.
  7. To see if you're going to execute the right apachectl, use this command in terminal:
    which apachectl
    and you'll see which one is first in line to execute. Very handy little command.
  8. I couldn't get my virtual hosts working until I edited /private/etc/hosts to assign them to as described here. It wasn't enough to configure vhosts or my username.conf file and include it in httpd.conf.

No comments:

Post a Comment