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'