Configure the host file for the Windows system.
Hosts in the C:\WINDOWS\SYSTEM32\DRIVERS\ETC directory
The Hosts file has no extension. Hosts is a Windows file that configures the local access domain name IP, port.
The hosts are opened with Notepad or text editing software.
The Hosts file defaults to two lines:
127.0. 0.1 localhost::1 localhost
With the # switch, it is a comment, description.
# for example:## 102.54.94.97 rhino.acme.com # source server# 38.25.63.10 x.acme.com # x Client host# localhost name resolution is handled within DNS itself. #127.0.0.1 localhost#::1 localhost
Under the same IP, I configured three domain names:
127.0. 0.1 localhost::1 localhost127.0. 0.1 test1.cc127.0. 0.1 dedesp1.cc127.0. 0.1 dedesp2.cc
After the system IP and domain name is configured, go to Wampserver to configure the Apache domain name directory related files.
Modify Wampserver two files
Wampserver installation drive letter: \wamp64\bin\apache\apache2.4.23\conf\
httpd.conf
Wampserver installation drive letter: \wamp64\bin\apache\apache2.4.23\conf\extra\
Httpd-vhosts.conf
To look together, there are several common directories:
: \wamp64\bin\apache\apache2. 4.23 \conf:\wamp64\bin\apache\apache2. 4.23\conf\extra
httpd.conf file
Find code include conf/extra/httpd-vhosts.conf don't have the # number, there is a # # This file will be added comments out, if there is a #, remove.
It's about 522 lines.
httpd-vhosts.conf file, configure the multi-catalog site you want.
Original code:
# Virtual hosts#<virtualhost *:> ServerName localhost documentroot d:/ wamp64/www <directory "d:/wamp64/www/"> + Indexes +includes +followsymlinks +multiviews allowoverride all Require local </ directory></virtualhost>#
Do not move the original code, configure your directory according to this rule, configure a few can.
Examples are as follows:
<virtualhost *:> ServerName test1.cc documentroot d:/demo/root1 <directory "d:/demo/root1/"> +indexes +includes + FollowSymLinks +multiviews allowoverride all Require local </directory></ Virtualhost>
Write a PHP file in the configuration directory to test it.
Example:
Echo "Hello 123";
Example 2:
<? PHP Echo "Hello tes1"; Echo "Hello root1"; Phpinfo ();? >
If there is anything that does not understand, add QQ group: 186970878
Wampserver Next, configure the domain name and multi-domain, multi-directory site.