The configuration steps are as follows:
1. Create a directory of virtual hosts in the hard disk, such as "D:/wamp/www/jockie";
2. Open the PHP config file apache/apache2.4.9/conf/httpd.conf, open the Virtual host reference file (i.e. remove the previous comment symbol):
#Virtual hosts
Include conf/extra/httpd-vhosts.conf
3. Open the virtual host configuration apache/apache2.4.9/conf/extra/httpd-vhosts.conf, add the host you need, a few to configure a few, here I only configured one:
Note that the port on which you are listening is Apache
<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "D:/wamp/www/jockie"
ServerName www.jockie.com
Errorlog "Logs/www.jockie.com-error.log"
Customlog "Logs/www.jockie.com-access.log" common
</VirtualHost>
4. Bind the domain name IP, in the C:/windows/system32/drivers/etc/host configuration, such as:
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 localhost
127.0.0.1 www.jockie.com
5. Restart Apache, are you done here? You must think more, you can go to visit http://www/jockie.com of course this you can definitely access, is your virtual host. But you try again localhost/zmitwx/index.php this you can not access the solution is: Open the virtual host configuration text apache/apache2.4.9/conf/extra/ httpd-vhosts.conf, adding localhost
<virtualhost *:80>
Serveradmin[email protected]
DocumentRoot "D:/wamp/www"
ServerName localhost
Errorlog "Logs/dummy-host.localhost-error.log"
Customlog "Logs/dummy-host.localhost-access.log" common
</VirtualHost>
6. Finally restart apache,localhost/zxj/index.php and www/jockie.com can be accessed.
I qq:617324031 Welcome to exchange.
Configuring virtual hosts with Apache under Windows