How to point a domain name to a local server

Source: Internet
Author: User

When building a website, we often need to point the registered domain name to the local code, for code debugging needs, but the local server configuration default address is localhost or 127.0.0.1, how to point the local domain name to the local server? Take Window7+apache server as an example, see the picture below.

1 First locate the host file under widow based on the prompt of the picture,

2 Open File Add domain name and corresponding IP address, red line hint at

3 Locate the httpd-vhosts.conf file in the directory that corresponds to the Apache installation location,

4 Open the file, add the code shown in the Red box, DocumentRoot to the file address, servername as the domain name,

5 based on the DocumentRoot address of the previous step, locate the path, create the directory, and create the home page file in the directory. Then open the browser input URL can be accessed.

How to point a domain name to a local server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.