This configuration process is simple,
Like your mainframe ip:666.555.444.333.
Three sites, the domain name is: www.aaa.com,www.bbb.com,www.ccc.com
The corresponding web site files are placed under the root directory of the site:/WWWROOT/AAA;/WWWROOT/BBB;/WWWROOT/CCC folder
Note: Under Windows for ', Linux '/', this article is written under Linux.
Open the Apache profile httpd.conf file and set different domain names to different virtual directories:
| The code is as follows |
Copy Code |
Listen 80//Default listener port Namevirtualhost 666.555.444.333 <virtualhost 666.555.444.333:80>
DocumentRoot "/VAR/WWWROOT/AAA" ServerName www.aaa.com DirectoryIndex index.php </Virtualhost> <virtualhost 666.555.444.333:80>
DocumentRoot "/VAR/WWWROOT/BBB" ServerName www.bbb.com DirectoryIndex index.php </Virtualhost> |
Another way is not to write in the httpd.conf file,
We need to open the httpd.conf first and find
| The code is as follows |
Copy Code |
#Include conf/extra/httpd-vhosts.conf
|
# up front #
and then open
| The code is as follows |
Copy Code |
| Confextrahttpd-vhosts.conf |
Open in front and add a sentence
| The code is as follows |
Copy Code |
Namevirtualhost 127.0.0.1:80 your IP address. |
And then write it down here.
| The code is as follows |
Copy Code |
<virtualhost 127.0.0.1> DocumentRoot "e:/aaa/phpmyadmin/" ServerName www.111cn.net </VirtualHost> <virtualhost 127.0.0.1> DocumentRoot "e:/aaa/phpmyadmin/" ServerName www.111cn.net </VirtualHost> |
The last save reboot is KO.
And in this test
| code is as follows |
copy code |
| < VirtualHost 192.168.1.3:77> documentroot "e:/www/sfds/" ServerName 127.0.0.1 </virtualhost> <virtualhost 192.168.1.3:9> documentroot "e:/www/android/upfile/soft/" ServerName 127.0.0.1 </ Virtualhost> <virtualhost 192.168.1.3:8> documentroot e:/www/ android/upfile/img/ ServerName 127.0.0.1 </virtualhost> |
With ports, if the opening port is increased only in front of the httpd.conf
Listen 88
Listen 18
Listen 999
Listen 888
Listen 8888
Listen 8
Listen 9
Listen 58
Listen 66
Listen 77
Listen 69
So you can operate with ports.
Original articles reproduced in this site annotated source http://www.111cn.net/sys/index.html