Friday, February 22, 2013

How to Create Fake Domain Name on Localhost

 The purpose of this tutorial is to create fake domain name on localhost, i.e. you are running your local website online:

1. Create folder which will serve as your Web applications directory. You can place Web applications as many as you want in this folder. In my case:


2. Suppose I want to develop my Web application or website whose domain is, then I'll create folder inside the above-created working directory and name it:

Hence, C:/workspace/www/

3. I will now create 2 new folders inside folder:


conf is where configuration will be placed and public_html is where web documents will be placed. Index file, either index.html or index.php, should be on top of public_html.

Hence, C:/workspace/www/ and C:/workspace/www/

4. You should place or extract (like joomla, wordpress, phpbb, drupal, etc) your web files on top of public_html, i.e. index file should be in public_html.

5. Open your favorite text editor. I suggest Notepad. Type in the following and save as conf.conf (not .txt) inside folder conf:

<VirtualHost *:80>   
    DocumentRoot "C:/workspace/www/"
    ErrorLog "logs/"
    CustomLog "logs/" common
    <Directory "C:/workspace/www/">
        Order Deny,Allow
        Allow from all

6. Open Apache httpd.conf configuration. At the last line add the following:

NameVirtualHost *:80

7. Then add also the following:

Include "C:/workspace/www/"

Save and close Apache httpd.conf configuration.

8. Open hosts file in Notepad. hosts file is located at C:\Windows\System32\drivers\etc. Yes, it does not have extension. At the last line, type in the following:

If this file is edited for the first time, you may save it first in Desktop with the same name without extension, hosts. Then copy this to C:\Windows\System32\drivers\etc to overwrite existing hosts file.

8. Restart Apache. You should be able to open your site with or

Download PDF file.

Thanks. Suggestions and comments are highly appreciated.

No comments:

Post a Comment