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

2011-09-22  来源:本站原创  分类:Database  人气:412 

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 host domain name resolution often receive multiple, 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 easily use the ServerAlias do, open the apache configuration file: httpd.conf, set in the host code:

<VirtualHost 192.168.1.12>
ServerName "sanywork.cn" # The default domain name :
ServerAlias 51684.com www1.sanywork.cn # Different domain names separated by spaces :
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" # The default domain name :
ServerAlias *.sanywork.cn # Use * Pan-domain name, if you want to receive three pan-domain name resolution , Can be written as :*.my.sanywork.cn:
DocumentRoot "D:\wwwroot\sanywork.cn"
<Directory "D:\wwwroot\sanywork.cn">
Options Indexes FollowSymLinks
AllowOverride all
</Directory>
</VirtualHost>
相关文章
  • 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

  • [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

  • apache name-based virtual hosts, only access the first issue 2011-05-24

    Today in linux configure apache, name-based virtual hosts to establish a separate httpd-vhosts.conf file. At first, the following configuration <VirtualHost *:80> ...... ........ .......... </ VirtualHost> <VirtualHost *:80> ...... .....

  • Apache virtual hosts and virtual directory settings 2010-12-11

    Transfer from: http://weblife.blogbus.com/logs/1434583.html Learning to do only record only. First, name-based virtual hosts Open Apache2 \ conf under the httpd.conf, find the # NameVirtualHost *: 80, remove the front of the notes. Add a virtual host

  • 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

  • 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

  • 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

  • Change domain in MAMP -- Virtual hosts 2014-05-21

    Running a Web server on your desktop computer is a great way to speed up Web site development. By previewing your Web pages directly through a Web server on your own computer you can test out server-side programming like server-side include files, fo

  • lighttpd setup virtual hosts. virtual directory IP access restrictions 2010-09-07

    lighttpd set up virtual hosts, virtual directory, IP access restrictions Virtual Host: $ HTTP ["host"] == "admin.test.cn" ( server.document-root = "/ home / admin / web" $ HTTP ["remoteip"]! = "172.26.0.0/16&qu

  • 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

  • 403 error apache 2.2 virtual hosts 2010-10-14

    Reference http://www.raditha.com/blog/archives/896.html

  • 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

  • Tomcat6 configure multiple virtual hosts 2010-03-25

    To achieve results: http://localhost to access an item such as a student network. http://localhost1 access to a project such as an office system Program, a need to modify the two places One is the C: \ WINDOWS \ system32 \ drivers \ etc \ hosts file,

  • tomcat deploy multiple virtual hosts to establish multiple sites 2010-03-29

    <Host name="www.XXXXXX.com.cn" debug="0" appBase="/usr/local/tomcat/apache-tomcat-5.5.25/temp/ROOT" unpackWARs="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLog

  • no input file specified nginx multiple virtual hosts 2010-06-11

    Today, when configured nginx rewrite encountered a problem that it is time to visit the server prompted No input file specified. access to PHP, visit the php not matter, you can normally access. Suspect may be php-cgi issues now, google for a The nex

  • [Apache] httpd: Could not determine the server's fully qualified domain name 2011-01-14

    httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName Solutions : Modify the httpd.conf file Find ServerName Write your server's IP address and port number

  • 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

  • The typical Apache WEB server Advanced Settings Guide 2010-07-27

    Currently there are many WWWServer software can also run under linux a lot, there NCSAHTTPdServer, CERNHTTPdServer, pache, NetscapeFastTrackServer, ZeusServer so. Each of these software features: NCSA (Illinois State University Center for Supercomput

  • how to config Apache for many domain name 2010-09-16

    ServerAlias: Server alias in Apache can be used to set the virtual host computer is a domain name, you can resolve the domain name for receiving pan. Specific settings as follows: First, to set the virtual host multiple domain names to receive A virt