How to Create Fake Domain Name on Localhost

2
How to Create Fake Domain Name on Localhost by: Julian V. Jupiter fb.com/julianjupiter @dealwithjulez jvjupiter.tumblr.com www.jjupitersnotebook.blogspot.com 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: C:/workspace/www 2. Suppose I want to develop my Web application or website whose domain is j2technologies.com, then I'll create folder inside the above-created working directory and name it: j2technologies.com Hence, C:/workspace/www/j2technologies.com. 3. I will now create 2 new folders inside j2technologies.com folder: conf public_html 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/j2technologies.com/conf and C:/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 [email protected] 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>

description

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

Transcript of How to Create Fake Domain Name on Localhost

Page 1: How to Create Fake Domain Name on Localhost

How to Create Fake Domain Name on Localhostby: Julian V. Jupiterfb.com/julianjupiter

@dealwithjulezjvjupiter.tumblr.com

www.jjupitersnotebook.blogspot.com

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:

C:/workspace/www

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

j2technologies.com

Hence, C:/workspace/www/j2technologies.com.

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

confpublic_html

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/j2technologies.com/conf and C:/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 [email protected] 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>

Page 2: How to Create Fake Domain Name on Localhost

6. Open Apache httpd.conf configuration. You can find it inside conf folder of Apache. At the last line add the following:

NameVirtualHost *:80

7. 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:\Windows\System32\drivers\etc. 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.com

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 www.j2technologies.com or j2technologies.com.