Running MAMP

As I posted previously I’m now running MAMP as I wait for a nice PHP 5 package to be available. I did some research about how MAMP handles the htdocs folder, which is the one where you should have you web pages stored, and here are my findings. MAMP is designed to be self-contained, meaning it will not work if the htdocs folder is outside the MAMP folder in your applications, however, I just, accidentally, found a way of doing this and actually keep MAMP working.

If you open the httpd.conf file in /Applications/MAMP/conf/apache and scroll all the way down, you will find the virtual hosts section, in this section add a new virtual host, like this:

NameVirtualHost *
<VirtualHost *>
ServerName localhost
DocumentRoot “/Users/Stefan/Sites”
</VirtualHost>

In the previous example /Users/Stefan/Sites is where I have my pages stored and each time I call http://localhost in my browser MAMP will actually load the pages from there, so I have no need of moving everything into the MAMP’s htdocs folder.

You can add as much virtual hosts as you like and place them wherever you like, and MAMP will load and parse them just fine. You’re actually tricking it into believing the files are stored where they “should”.

Moving to Leopard

I have spent my last hours on installing the all-new Leopard on my Mac, it actually went pretty fast. I haven’t had much time to check out the entire thing as I’ve been busy setting up my development environment (Apache, PHP, MySQL).

The good thing is that Leopard ships with Apache 2 and PHP 5.2 pre installed, so you only need to make a couple of changes to get Apache and PHP running in no time, I’ll explain how to do that. The bad news is that the current MySQL package file does not fully work on Leopard, well, the engine actually works, it’s the preference pane that does not work yet, so you won’t be able to use that to stop and start you MySQL DB, I’ll post a nice trick to get that running as well.