How to Create Fake Domain Name on Localhost

14,461 views

Published on

This tutorial teaches how to create fake domain name on localhost and run Web application as if online.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
14,461
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
59
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

How to Create Fake Domain Name on Localhost

  1. 1. How to Create Fake Domain Name on Localhost by: Julian V. Jupiter fb.com/julianjupiter @dealwithjulez jvjupiter.tumblr.com www.jjupitersnotebook.blogspot.com1. Create folder which will serve as your Web applications directory. You can place Web applications asmany as you want in this folder. In my case:C:/workspace/www2. Suppose I want to develop my Web application or website whose domain isj2technologies.com, then Ill create folder inside the above-created working directory and name it:j2technologies.comHence, C:/workspace/www/j2technologies.com.3. I will now create 2 new folders inside j2technologies.com folder:confpublic_htmlconf is where configuration will be placed and public_html is where web documents will beplaced. Index file, either index.html or index.php, should be on top of public_html.Hence, C:/workspace/www/j2technologies.com/conf andC:/workspace/www/j2technologies.com/public_html.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> ServerAdmin admin@j2technologies.com DocumentRoot "C:/workspace/www/j2technologies.com/public_html" ServerName j2technologies.com ServerAlias www.j2technologies.com ErrorLog "logs/j2technologies.com-error.log" CustomLog "logs/j2technologies.com-access.log" common <Directory "C:/workspace/www/j2technologies.com/public_html"> Order Deny,Allow Allow from all </Directory></VirtualHost>
  2. 2. 6. Open Apache httpd.conf configuration. You can find it inside conf folder of Apache. At the lastline add the following:NameVirtualHost *:807. Then add also the following:Include "C:/workspace/www/j2technologies.com/conf/conf.conf"Save and close Apache httpd.conf configuration.8. Open hosts file in Notepad. hosts file is located at C:WindowsSystem32driversetc.Yes, it does not have extension. At the last line, type in the following:127.0.0.1 j2technologies.com127.0.0.1 www.j2technologies.comIf this file is edited for the first time, you may save it first in Desktop with the same name withoutextension, hosts. Then copy this to C:WindowsSystem32driversetc to overwrite existinghosts file.8. Restart Apache. You should be able to open your site with www.j2technologies.com orj2technologies.com.

×