Configuring virtual hosts with Apache under Windows

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.