While I was trying to set this up, I came across multiple articles, but none worked correctly for me.
Details of Localserver: Windows 7 64 bit system
WAMP installed to c:\wamp
You need to make two major changes to get a subdomain localhost install of WordPress running correctly. These are changes to your hosts file and the Apache httpd.conf file
Alternate generic location: %systemroot%\system32\drivers\etc\
On Ubuntu the main Apache configuration file is actually
Apache2.confcontains the default configuration for Apache on Ubuntu.
httpd.conf for “user configurations”. Here’s the lines from
apache2.conf that include
# Include all the user configurations: Include /etc/apache2/httpd.conf[/code] So use
httpd.confto add extra Apache configuration, and modify
apache2.confif you need to change the existing Apache configuration.
Ubuntu’s Httpd.conf LocationFor the versions of Ubuntu we’ve checked so far, you can consistently find
httpd.confin the directory
/etc/apache2. I needed to get www.droidzone.in, supernova.droidzone.in working in localhost. So the example will be this. The hosts file needs the following changes:127.0.0.1 www.droidzone.in 127.0.0.1 supernova.droidzone.in
Note that http://droidzone.in in real time points to www.droidzone.in by means of an A record. So what applies to www.droidzone.in applies to droidzone.in. The address has to be a.b.c and not just b.c. So adding www before droidzone.in is a must.
So now that the addresses are pointed to localhost represented by 127.0.0.1, we need to setup httpd.conf. Click on th WAMP icon in the tray>Apache>httpd.conf (See figure)
The file opens in Notepad in a window.
Next, at the end of this file, add the following:<VirtualHost *:80> ServerName www.droidzone.in DocumentRoot "C:\wamp\www" DirectoryIndex index.php index.html index.html index.htm index.shtml </VirtualHost> <VirtualHost *:80> ServerName supernova.droidzone.in DocumentRoot "C:\wamp\www" DirectoryIndex index.php index.html index.html index.htm index.shtml </VirtualHost>
Note that C:\wamp\www is the directory where I have put my WordPress installation. That is, the directories wp-admin and wp-content, along with the file wp-config.php are contained within this directory.