method One:
First open the http.conf file under the Apache Conf. Open the comments of the virtual host: The following removes the # in front of the second line
# Virtual Hosts
# Include Conf/extra/httpd-vhosts.conf
Open the httpd-vhosts.conf file in the extra directory under the Conf directory again
At the back of the file, add
<virtualhost *:80>//The port number used by your virtual host
ServerAdmin Webmaster@dummy-host2.localhost//Virtual Host Administrator account
DocumentRoot "D:/wamp/www/phpwind"
The file path of the Web site you want to configure, and the local test needs to be configured
ServerName bbs.1jiayuan.com//server name local test required configuration
ErrorLog "Logs/dummy-host2.localhost-error.log"//error log
Customlog "Logs/dummy-host2.localhost-access.log" common//user log
</VirtualHost>
Save after configuration is complete
Then open the c:/windows/system32/drivers/etc/hosts and configure the hosts you need
For example:
127.0.0.1 bbs.1jiayuan.com
192.168.1.80 bbs.1jiayuan.com
Method Two:
Directly at the back of the http.conf, add:
Copy Code code as follows:
<virtualhost 192.168.1.80>
ServerName bbs.1jiayuan.com
DocumentRoot D:/wamp/www/phpwind
<directory d:/wamp/www/phpwind>
AllowOverride All
Options All
</Directory>
Php_value include_path D:/library
Php_value MAGIC_QUOTES_GPC off
Php_value register_globals off
</VirtualHost>