Unzip the zip archives downloaded from the official XAMPP site into the folder of your choice. XAMPP is extracting to the subdirectory "xampp" below the selected target directory. Now start the file "setup_xampp.bat", to adjust the XAMPP configuration to your system (or to relocate the paths). You can set the necessary paths and variables for XAMPP with:
xamppxampp_shell.bat setenv
Edit file:
...xampp/apache/conf/httpd.conf
(...)
NameVirtualHost 127.0.0.1<VirtualHost 127.0.0.1>
ServerName myproject<VirtualHost 127.0.0.1>
ServerName phpmyadmin
DocumentRoot "C:/xampp/htdocs/phpmyadmin"
DirectoryIndex index.php
<Directory "C:/xampp/htdocs/phpmyadmin">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.1>
ServerName test
DocumentRoot "C:/xampp/htdocs/test"
DirectoryIndex index.php
<Directory "C:/xampp/htdocs/test">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
Edit File:
c:/WINDOWS/system32/drivers/etc/hosts
(...)
127.0.0.1 localhostHosts
Apache Virtual Hosts provide an easy way to host multiple offline versions of your client sites while still accessing them through a simple, canonical URL. It breaks down like this:
So far so good – we open up the HOSTS file (on Windows XP you’ll find it at C:/WINDOWS/system32/drivers/etc/, on earlier versions of Windows it’s at C:/WINDOWS/), and add a new line at the end for the offline version of our client site:
127.0.0.1 myclientsite.local
So now all requests for the URL myclientsite.local will be directed to my own Apache server – but how does Apache know what to do with them?
Virtual Hosts
Apache has a special section of its configuration file that tells it what to do with requests for different domains. You’ll find the file, named ‘httpd.conf’, in the /conf folder under your installation of Apache. Some versions might have removed the relevant section to a separate file named ‘httpd-vhosts.conf’ – mine is under /conf/extra, but if you can’t find yours, just do a search for “httpd”.
Once you’ve located the correct file, look for a section containing the text “NameVirtualHost 127.0.0.1”. You might need to uncomment this line (remove the #); below it you can then add entries for each site you want to serve from Apache, in this format:
NameVirtualHost 127.0.0.1This entry tells Apache that requests for “localhost” should be pointed to the folder listed under DocumentRoot (as you can tell, running XAMPP). For our client site, we simply add a new entry:
<VirtualHost 127.0.0.1>And now all requests for http://myclientsite.local will be automagically routed to the specified folder, and your offline version of the client’s site can use all the features I mentioned above with no online/offline headaches (NB: if your Apache was running when you made the above change, you will have to stop and start it again before the change will take effect).
Note: the Directory tag might be necessary when the folder is not under the main localhost location.
To check virtual host configuration: from command prompt: /usr/local/apache/bin/httpd -S
If you need to test something on IE6 and already have (as I hope) a newer version on your system, there is a convenient and easy solution to run IE6 without having to uninstall the current version. I found an interesting article with links and instructions that I am going to summarize for you.
First of all, download a copy of Microsoft Windows Virtual PC 2007 and install it:
Basically now you have a local (multi) virtual machine console. You can use it to install different operating systems on different virtual PCs on your machine.
For our purpose, we need a Windows XP with IE6 pre-installed. It is provided by Microsoft as:
Internet Explorer Application Compatibility VPC Image.
Install it and keep note of the chosen destination folder.
Now run Virtual PC 2007 and click on New to open the New Virtual Machine Wizard.
Now select the virtual machine created and click on Settings.
Click on Hard Disk 1 and Browse to the destination folder created by the image installation above.
Then you should point to the image file IE6Compat.vhd
Confirm and close the settings panel.
--> Now your new virtual machine is ready. Click on Start to run it.
Please be sure to secure each virtual machine you create:
- Enable a firewall on each virtual machine;
- Install antivirus software on each virtual machine, as appropriate.