The configuration of the virtual host is too sudden

Source: Internet
Author: User

1. Configure the local DNS file--hosts

File path: C:\Windows\System32\drivers\etc\hosts

2. Configure the Apache Master profile--httpd.conf

Apache Master Profile Path: C:\Program files (x86) \phpstudy\apache2\conf\httpd.conf

Which IP address of the network card to listen to, which port access

The following specifies which IP addresses and ports can be accessed by the virtual host. Where the IP address must be the IP address of its own network card.

3. Configure Apache Virtual host--vhosts.conf

File path: C:\Program files (x86) \phpstudy\apache2\conf\vhosts.conf

Ps:

After configuring the virtual host, why is the localhost access path changed?

Since the virtual host is configured, the first virtual host has the highest priority and is higher than the global configuration. Therefore, when you access localhost, it points to the first virtual host.

That is, as long as Apache is configured with a virtual host, clients accessing the domain name of Apache that do not configure the virtual host will point to the first virtual host by default.

The configuration of the virtual host is too sudden

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.