For everyone looking for a clean & simple Apache + php + mySQL development environment for their local machine, XAMP is an all-in-one solution that installs in seconds. I use it on my Windows XP laptop, but it’s also available for Linux and Mac OS.. plus, it’s free. ( get it here )
Here’s how you go about running multiple sites on your local machine (and this might be common knowledge, but it took me a little research to find how to do it..):
You need to find the following 2 files:
“hosts” ( for me located in “WINDOWS\system32\drivers\etc\hosts” )
“httpd-vhosts.conf” ( in “XAMPP\apache\conf\extra\httpd-vhosts.conf” )
In the hosts file (to be edited just like a text file) you add your local IP address and the domain name you want to be able to access on your machine..
For example, I’ve got the line
127.0.0.1 codemassacre.local
in there. The .local part is a matter of preference.. could be anything.
Next, you edit the httpd-vhosts.conf and somewhere after the line NameVirtualHost *:80 you add a virtual host definition, for example:
<VirtualHost *:80>
DocumentRoot “C:/DevServer/CodeMassacre/site”
ServerName codemassacre.local
<Directory “C:/DevServer/CodeMassacre/site”>
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Now all you have to do is restart apache (XAMPP has a convenient button for that) and now you can access your local domain through any browser on your machine at http://codemassacre.local
Veeeeery convenient when you’re working on a number of sites at the same time.
Lemme know how that works for you. Post a comment.