Apache under Virtual Host settings for Windows environments

Source: Internet
Author: User

1. Find the Hosts file under C:\Windows\System32\drivers\etc, add the following content at the end of the file:

Mysite.net

It should be noted that this hosts file may not be saved, the solution is to copy the hosts file to another location (such as the desktop), modified after the copy back, the original file can be overwritten.

2, open the Apache configuration file httpd.conf, find include conf/extra/httpd-vhosts.conf this line, if the sentence preceded by a #, remove it.

3, open Apache in Conf\extra under the httpd-vhosts.conf file, in the last write:

(1) Under PHP2.2

Namevirtualhost *:80<virtualhost *:80>mysite. net"D:\xampp\htdocs\mysite" <directory "D:\xampp\htdocs\mysite" >Options FollowSymLinks includesnoexec indexesdirectoryindex index. html index.htm index.sHTML default.html Default.htm index.php default. PHP    allowoverride all    Order Deny,127.0.0.1    </Directory> </VirtualHost>


(2) Under PHP2.4

<virtualhost 127.0.0.1:80>mysite. net"D:\xampp\htdocs\mysite" <directory "D:\xampp\htdocs\mysitedefault  Default.htm index.php defaultphpallowoverride allRequire all deniedrequire IP 127.0.0.1:: 1Require Local </Directory></VirtualHost>
4. Restart Apache, enter in browsermysite.netYou will be able to accessD:\xampp\htdocs\mysiteThis project.
Note: Replace the contents of the Red color section above with the virtual domain name you want to use, and replace the blue part with the path to the corresponding item store.

Blog statement:

All the articles in this blog, in addition to the title "reproduced" In the words, all the rest of the articles are my original or in the review of the information after the completion of the reference to non-reproduced articles please indicate this statement. --Blog Park-pallee

Apache under Virtual Host settings for Windows environments

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.