Apache implements a method of locally establishing a generic domain name virtual host _linux

Source: Internet
Author: User

This article describes how Apache implements a local generic domain name virtual host. Share to everyone for your reference, specific as follows:

Create a generic domain name virtual host locally, you can modify the Apache installation directory under the Conf/httpd.conf, as follows:

<virtualhost *:80>
ServerName auciou.com
serveralias *.auciou.com documentroot F:/site/auciou
</VirtualHost>

Restart Apache, you can use auciou.com and xxx.auciou.com local access at the same time, XXX for arbitrary level two domain name, the implementation of the pan-domain name resolution. Using this method, you can also create a virtual host that is a generic domain name resolution for multiple domain names locally.

In the local test, you need to modify the Hosts file , open the C:\WINDOWS\system32\drivers\etc\hosts, write this sentence:

127.0.0.1 ww2.auciou.com
127.0.0.1 ww3.auciou.com
127.0.0.1 ww4.auciou.com 127.0.0.1 wwa.auciou.com
127.0.0.1 user.auciou.com
127.0.0.1 blog.auciou.com

Because the hosts themselves do not have a pan-domain name resolution, so in the local test, two domain name needs to be in the local hosts file one one Add. Then manually back up the hosts file, after reloading the system, overwrite this file.

I hope this article will help you with your Apache server settings.

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.