Configuring a virtual host under Windows

Source: Internet
Author: User

Under Windows to configure the virtual host and in the Linux configuration virtual host There are some differences, under Windows to find the httpd.conf file under the Conf directory, remove the corresponding comments, turn on the virtual machine, Windows default does not turn on the virtual machine.

Environment:

Windows7,apache 2.2.22

The configuration file used

1, Apache installation directory, conf/httpd.conf

2, Apache installation directory, conf/extra/httpd-vhosts.conf

3. C:\Windows\System32\drivers\etc\hosts file

Steps:

1, find the Apache installation directory conf/httpd.conf file, Notepad open, find the # Virtual hosts, remove the # below include, let the configuration file included in it. As follows:

# Virtual Hosts

Include conf/extra/httpd-vhosts.conf

2, find the C-disk, the Hosts file, add virtual host corresponding to the local domain name, as follows:

127.0.0.1 test.com

3. Locate the conf/extra/httpd-vhost.conf file in the Apache installation directory and add a VirtualHost

As follows:

<virtualhost *:80>

ServerAdmin [email protected] #管理员邮箱地址,

DocumentRoot "D:/www/wangzhan/test" #指定网站根目录, set up a test directory under Wangzhan

ServerName test.com #虚拟主机域名

Errorlog "Logs/dummy-host2.php100.com-error.log" #错误日志可以改成自己的路径

Customlog "Logs/dummy-host2.php100.com-access.log" common

</VirtualHost>

4, after the completion of the above 3 steps, restart Apache, then open the browser, enter test.com can access their own defined virtual host. Own test directory, build a PHP file for testing




This article is from the "Small City Studio" blog, please be sure to keep this source http://xcroom.blog.51cto.com/7941996/1650836

Configuring a virtual host 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.