[Turn] the use ServerAlias ​​in Apache Setting virtual host name to receive more than one domain name and set the pan Resolution

2011-06-27  来源:本站原创  分类:OS  人气:117 

Original Address: http://hi.baidu.com/yhs2006/blog/item/a137fc19e6519775dab4bddb.html

serverAlias: server alias in the Apache virtual host can be used to set the receiver to a domain name, you can resolve the domain name for receiving the pan. Specific setting is as follows:

First, set up virtual hosts reception for multiple domain names

A virtual host will often receive multiple DNS, for example: a virtual host to simultaneously introduce sanywork.cn, 51684.com two domain names, or two second-level domain, such as: www.sanywork.cn, www1.sanywork. cn, in this case, you can use ServerAlias ​​easy to do, open the apache configuration file: httpd.conf, set the host code:

<VirtualHost 192.168.1.12>

ServerName "sanywork.cn" # default domain name;

ServerAlias ​​51684.com www1.sanywork.cn # different domains separated by a space;

DocumentRoot "D: \ wwwroot \ sanywork.cn"

<Directory "D:\wwwroot\sanywork.cn">

Options Indexes FollowSymLinks

AllowOverride all

</ Directory>

</ VirtualHost>

Save the httpd.conf file, restart apche to take effect.

Second, the pan-Domain Name for receiving

A virtual host domain name resolution is to receive the pan, but also by SeverAlias ​​option, not only by setting the option to receive two pan-domain analysis, can also receive three, four Pan-domain analysis, specific settings are as follows:

<VirtualHost 192.168.1.12>

ServerName "sanywork.cn" # default domain name;

ServerAlias ​​*. sanywork.cn # * denotes the pan with the domain name, if you want to receive the three pan-Domain Name, can be written like this: *. my.sanywork.cn;

DocumentRoot "D: \ wwwroot \ sanywork.cn"

<Directory "D:\wwwroot\sanywork.cn">

Options Indexes FollowSymLinks

AllowOverride all

</ Directory>

</ VirtualHost>

Save the httpd.conf file, restart apche to take effect.

相关文章
  • [Turn] the use ServerAlias ​​in Apache Setting virtual host name to receive more than one domain name and set the pan Resolution 2011-06-27

    Original Address: http://hi.baidu.com/yhs2006/blog/item/a137fc19e6519775dab4bddb.html serverAlias: server alias in the Apache virtual host can be used to set the receiver to a domain name, you can resolve the domain name for receiving the pan. Specif

  • ServerAlias ​​in Apache using virtual hosts set to receive more than one domain name and set the name Pan-resolution 2011-09-22

    ServerAlias: server alias in the Apache virtual host can be used to set the receiver to a domain name or domain name is for receiving the pan. Specific setting is as follows: First, set up virtual hosts reception for multiple domain names A virtual h

  • how to config apache's virtual host 2010-09-16

    Setting up Apache virtual hosts First, IP-based virtual hosts This approach requires setting an IP alias on the machine, like the above example, the network card in a machine to bind multiple IP addresses to service multiple virtual hosts. If the mac

  • windows 2003 + apache + php virtual host configuration windows2003serve 2011-03-27

    windows 2003 + apache + php virtual host configuration windows2003serve The method of this article can be found around the web solution, but not very clear, in this order to reduce the users so careless as I take some less roundabout, I wrote the nex

  • PHP + JSP + MYSQL + APACHE + RESIN Virtual Host Configuration 2010-08-30

    LINUX platform in all configurations are completed and tested successfully complete integration and software as needed resin: http://www.caucho.com/ jdk: http://java.sun.com/ apache: http://www.apache.org mysql: http://www.mysql.com php: http://www.p

  • Under Ubuntu Linux apache name-based virtual host configuration 2010-10-12

    Recently in learning linux, linux today to configure a Virtual Host, the following are the steps: To configure the site http://www.myweb.cn Virtual host file myweb 1, the first in / etc/apache2/sites-available directory, create a new empty virtual ho

  • Ubuntu Linux under the apache name-based virtual host configuration 2010-10-12

    Recently in learning linux, linux today to configure a virtual host under, the following are the steps: To configure the site http://www.myweb.cn Virtual host file myweb 1, first in / etc/apache2/sites-available directory create a new empty virtual h

  • Apache Dynamic Virtual Host Configuration 2010-06-29

    Massive presence of dynamic configuration of virtual hosts, the number of WEB sites for the huge amount. Standards provided with the apache module + mod_vhost_aliases dynamically configured hosts. Role is to check the URL to come in after the actual

  • Setting Up A Virtual Host in Apache 2010-06-26

    Setting up a virtual host in the Apache web server is not exactly a PHP topic, but many PHP developers use the Apache web server to test web pages on their development machine. There is a lot of information around on how to do this, but the first tim

  • apache virtual host setting 2010-06-24

    apache virtual host settings, there are two A: Based on the configuration of a host ip bind multiple ip, each set up a virtual host ip If a host has two ip 10.13.129.163 and 192.168.1.9 Is configured as: <VirtualHost 10.13.129.163> ServerName localh

  • Apache + Resin's java virtual host settings 2010-08-30

    Outline This article is for those who do prepare the virtual host, virtual host has to do resin in several ways: 1. By default, root user runs the resin, the most insecure Strongly do not recommend this way, but in this way do not need to configure t

  • apache virtual host configuration 2010-03-17

    1, based on ip address of the virtual host Listen 80 <VirtualHost 172.20.30.40> DocumentRoot / home/httpd/html1 ServerName www.ok1.com ErrorLog / usr/local/apache/logs/error1_log CustomLog / usr/local/apache/logs/access1_log combined </ VirtualHo

  • Ubuntu Linux-based domain name under the apache virtual host configuration 2010-05-12

    For example there are two domain www.a.com and www.b.com two domain names resolve to do In / etc/apache2/sites-available directory to establish a and b are two files, here only for ease of use, you look closely you can see the sites-enabled file will

  • Apache Virtual Host to achieve 2010-06-25

    Apache Virtual Host to achieve Method 1: ================================================== =============== Open the virtual host configuration file Set of the httpd.conf: 1. Note the following three lines # ServerAdmin # ServerName # DocumentRoot 2.

  • apache virtual host (vhost) configuration (change) 2010-08-21

    In an IP address to run multiple web sites based on domain name. Your server has an IP address, there are many in the DNS mapping (CNAMES) to this machine. You and you want to run this machine www.example1.com and www.example2.org two sites. Attentio

  • Apache virtual host configuration steps 2010-11-04

    Apache virtual host configuration steps Open the Apache installation directory under the conf \ httpd.conf Appropriate location at the end add the following configuration directive, modify the relevant settings as needed, detailed instructions explai

  • WordPress Apache virtual host configuration and connection settings fixed 2011-04-15

    A Virtual Host Configuration First, remove the httpd.conf file under the default DocumentRoot and <Directory "XXX"> configuration, add code like the following. <Directory /> Options FollowSymLinks AllowOverride All </Directory>

  • Apache configuration over IP, virtual host. 2010-05-09

    Apache virtual host configuration, there are two options: 1 Name-based Virtual Host Support 2 IP-based Virtual Host Support The first is for an IP, a different servername, The second is suitable for different IP, A second look at the following: First

  • apache apache virtual host log configuration multi-site configuration of the log partition configuration 2010-06-25

    apache virtual host multiple sites, each name a log file, online to find a lot, no way to find the log stored separately, sweat, his test a usable, special share with you: NameVirtualHost *:80 <VirtualHost *:80> ServerName * DocumentRoot "F:/9q

  • APACHE virtual host error causes 2010-08-12

    APACHE virtual host error causes March 22, 2010 [Warn] NameVirtualHost *: 0 has no VirtualHosts Reason: The namevirtualhost command tells Apache that you will use VirtualHost boxes on a specific IP address. This command is needed only once for each I