How do I set wildcard domain name resolution in an apache Virtual Host ?, Apache Virtual Host

Source: Internet
Author: User

How do I set wildcard domain name resolution in an apache Virtual Host ?, Apache Virtual Host

Set wildcard domain name resolution in the apache Virtual Host, mainly using the ServerAlias configuration.
Address: http://www.jbxue.com/article/23346.html

1. Support for multiple domain names

For example, to direct mail.jbxue.org, smtp.jbxue.org, and pop3.jbxue.org to the same virtual host, you can write:
ServerName mail.jbxue.org
ServerAlias smtp.jbxue.org pop3.jbxue.org

ServerName is used to specify the preferred domain name. Other domain names are specified by ServerAlias and are differentiated by spaces.

2. wildcard domain name resolution
ServerAlias supports delimiters. For example, if we want all the second-level subdomain names under xx.a.com to be resolved using the same virtual host, we can set them:

<VirtualHost *: 80>
ServerName xx.a.com
ServerAlias * .xx.a.com
DocumentRoot/var/www/htdocs/
</VirtualHost>

Articles you may be interested in:
  • How do I set wildcard domain name resolution for apache Virtual Hosts?
  • How to configure second-level domain names using. htaccess in apache
  • Apache domain name-based VM configuration instance
  • How to bind multiple domain names to the same space in apache
  • Apache multi-domain name configuration in the wind2003 Environment
  • Apache wildcard domain name resolution and dns
  • Configuration and wildcard domain name resolution of virtual hosts in apache
  • Example of adding domain names and 301 redirection in apache
  • How to bind multiple domain names to linux apache

How does apache (or httpd) set wildcard domain name resolution?

Wildcard DNS is provided by the domain name provider. If you want to use the wildcard DNS function, you must provide it to the domain name registrar.
 
How to configure a virtual host in apache224

If you have any questions, ''use me for configuration like this. ''here we assume that your IP address is 192.168.0.1 and the virtual host to be created is www.baidu.com.
NameVirtualHost 192.168.0.1
<VirtualHost 192.168.0.1>
ServerName www.baidu.com
DocumentRoot D: \ varweb \ test
</VirtualHost>

Enter www.baidu.com
Of course, '''the premise is that your DNS can resolve ''' and ''don't let your computer go online. Otherwise, you will go directly to Baidu... you don't know if you understand what I mean'

Related Article

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.