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!