WINDOWS2003 Apache Configure virtual host and bound Domain Name Service _win server

Source: Internet
Author: User
The method of this article probably can find the solution on the net, just is not very clear, in this in order to reduce the netizen like I so careless less take a detour, I wrote the next simple and clear process of setting up.
First of all, my server's environment:
Windows 2003 Server
apache_2.0.48
php4.2
(Our server is independent IP, the server does not install IIS, nor installed DNS server, etc., so can only use the Apache virtual host)
The following start to set the steps: (I only say the hostname based on the virtual host an IP address, the configuration of multiple Web sites, for more information, please refer to the Apache Virtual host document)
1. Under the WINDOWS2003 installation Apache configuration virtual directory and Unin under the basic is the same, is to modify the httpd.conf file (apache2\conf\httpd.conf).
2. Open the http.conf file, in its most issued input
Copy Code code as follows:

Namevirtualhost 218.17.19.19 #记得一定要有这个啊!, this is the server IP address
<virtualhost 218.17.19.19> #第一个域名所指向的IP
DocumentRoot "E:/webroot/myenjoylife" #www. myenjoylife.cn to point to the directory, note must have ""
ServerName www.myenjoylife.cn #第一个网站域名
DirectoryIndex index.php index.html default.php Index.html.var
</VirtualHost>
<virtualhost 218.17.19.19> #第二个网站域名所指向的IP
DocumentRoot "E:/webroot/51duanxin" #www. 51duanxin.net to point to the directory, note must have ""
ServerName www.51duanxin.net #所要绑的玉米
DirectoryIndex index.php index.htm index.html default.php Index.html.var
</VirtualHost>

This is tied to the corresponding directory, if there is no namevirtualhost 218.57.19.19 this instruction, all the domain names are referred to the Myenjoylife directory. (I was because of this reason only several times did not set up good, alas!) )
Then restart Apache, you can see that the domain name corresponding to the corresponding virtual directory! I have this test is no problem, I wish you can also successfully solve this small problem ang!

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.