Archive for November, 2007

setting up a testing server on your mac (updated)

Well its been a long time since the last posts - but Ive been a busy boy. I’m currently building a few Drupal sites and have got myself a new MacBook to help with the process. Here’s a tip for building a nice testing environment on your machine.

  1. Download and install MAMP, you can get it all working with the built in server if you like - but using MAMP makes lots of things much easier. You can switch between php 4 and 5 and upgrading your system will be simple as everything is contained in one directory. In addition everything starts up and shuts down by clicking a button (apache and MySQL).
  2. I switched the default Apache root to my sites folder in my user directory - but this is really your preference, and i’m sure there are pros and cons here.
  3. I changed the Apache port to 80 as this means I can view my files at localhost without the “:8888″ suffix, this does of course mean you can’t use the built in apache as this will use the same port, and it also means you need to type in your password whenever starting MAMP.
  4. Give your testing server a nice domain name like sitename.dev that is mapped to a specific site, rather than the whole Sites folder (or wherever you’ve chosen to put it). For leopard follow this tutorial: Setting up a Web Server on Leopard (OS X 10.5) Using MAMP - A Step by Step Guide. For pre-leopard follow this excellent tutorial Webdev: How to Set Up a Sandbox Server in OS X.
  5. If you want to then test your server on a windows environment and you have Parallels installed then go to this post here on Virtual Hosts with Parallels and OS X.
  6. Once all this is done you can startup your Apache server MySQL database and php all by clicking a button, you’ll be able to view your site on your local machine at sitename.