The use of virtual hosts allows us to effectively develop using XAMPP in a way that is similar to final deployment. It also allows for multiple installs of Drupal and permits developing for multiple sites using a single Drupal installation.
In this case we are aiming to set up a development virtual host installation with a URL of www.mugginsoft.local
- Install XAMPP.
- Install Drupal into /Applications/XAMPP/htdocs/drupal6-mugginsoft.
- Edit /Applications/XAMPP/etc/httpd.conf and uncomment the following line
#Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf - Add virtual host container to /Applications/XAMPP/etc/extra/httpd-vhosts.conf
<VirtualHost *:80> ServerAdmin xxxx@mugginsoft.com DocumentRoot "/Applications/XAMPP/htdocs/drupal6-mugginsoft" ServerName mugginsoft.local ServerAlias www.mugginsoft.local ErrorLog "logs/mugginsoft.localhost-error_log" CustomLog "logs/mugginsoft.localhost-access_log" common </VirtualHost> - Edit Applications/XAMPP/etc/extra/httpd-xampp.conf to allow .htaccess overrides in directories. This is required to enable the URL rewriting required for clean Drupal URLs. If you find that you can only navigate to site root and every other link fails then it is likely that clean URL rewriting is not occurring correctly. Note that this problem can also occur if you are installing your site from a backup and have omitted to backup .htaccess in the Drupal root folder. Remember, it's this file that actually does the clean URL rewriting.
Alias /drupal6-mugginsoft "/Applications/XAMPP/htdocs/drupal6-mugginsoft" <Directory "/Applications/XAMPP/htdocs/drupal6-mugginsoft"> AllowOverride All Order allow,deny Allow from all </Directory> - Restart XAMPP.
- Edit /etc/hosts to map our local URL to the localhost.
Flush the cache with127.0.0.1 www.mugginsoft.localdscacheutil -flushcache> - If necessary duplicate /sites/mugginsoft.com as /sites/mugginsoft.local and modify our settings.php as required.
By creating multiple virtual hosts we can can install and develop across a wide range of Drupal installations and versions.
Post new comment