First step: Open the Profile httpd-vhosts.conf "My path is D:\program\wamp\bin\apache\Apache2.3.14\conf\extra\httpd-vhosts.conf", Copy the last code snippet in the file: ServerAdmin [email protected] documentroot "c:/apache23/docs/dummy-host2.example.com" ServerName dummy-host2.example.com errorlog "Logs/dummy-host2.example.com-error.log" Customlog "logs/ Dummy-host2.example.com-access.log "Common Paste to the end of the file, modify the directory and the virtual host domain name: ServerAdmin [email protected] documentroot "E:\WORKSPACE\FLYOX_XT" ServerName charming.f-ox.com.cn errorlog "logs/ Dummy-host2.example.com-error.log "Customlog" Logs/dummy-host2.example.com-access.log "Common PS: It is possible to paste this section directly at the end of the httpd.conf file, but it is recommended that you do not do so, it is very messy. Step Two: Open the configuration file httpd.conf, this is believed to be familiar to everyone, add the following code at the end of the file, introduce the first step of the file: Include "D:\program\wamp\bin\apache\Apache2.3.14\conf\ Extra\httpd-vhosts.conf "Step three: in the httpd.conf file ctrl+f, enter the search content DocumentRoot find the following code: Options Indexes followsymlinks execcgi Order allow,deny allow from all allowoverride all Copy and paste under this code "actually put in the location of this file is OK, some people say at the end, I suggest you put it below", to change the path to their own path. Options Indexes followsymlinks execcgi Order allow,deny allow from all allowoverride all Note: This step is mainly for the non-configuration of the site in the WWW directory, if the source is not required in the WWW directory in this step. Open the Hosts file plus 127.0.0.1 charming.f-ox.com.cn (servername in httpd-vhosts.conf file) step fourth: Restart Apache. Enter charming.f-ox.com.cn in the browser
Configuring Apache Virtual host under Win7