How to create a host

How to create a host

The hosting is the tool allowing to place on the server the websites on the basis of the uniform software. In this article we will tell you about how to create on your local server created by means of Denver or WampServer a virtual host with an opportunity further to make it real. At first sight, the description of creation of a virtual host can seem difficult, but in fact it should not cause difficulties in users — make sure that all steps on creation of a host are simplest.

Instruction

1. Alter the hosts (C:\WINDOWS\system32\drivers\etc\hosts) file – add your domains there, using the next line:

127.0.0.1 name of your domain or the subdomain without prefix of a domain zone (ru, com, org and others).

2. Then in the section Virtual Hosts which you will find in the special configuration file httpd.conf add the next lines:
DocumentRoot ""Route to Your Website"

ServerName name of your domain (for example, mysite)
This record — a container of a virtual host. If your server is configured by means of XAMPP, without use of Denver and WampServer, the task will a little change — enter the code of a container in the httpd-vhosts.conf file. Simple change of httpd.conf is not enough. Path to this file most often such: C:\xampp\apache\conf\extra\

3. Then open the httpd.conf file delete the # icon before the line Include conf/extra/httpd-vhosts.conf. This operation will remove the comment and will connect the httpd-vhosts.conf file to the httpd.conf file.

4. Reboot the server, and then check whether your website correctly works. To open it, enter a domain name which you entered in a container of a virtual host (mysite), in an address bar of the browser. From this point your website should open and work on the server.

Author: «MirrorInfo» Dream Team


Print