Apache three-step Virtual Host Configuration

Source: Internet
Author: User

Windows System Configuration:
Modify the file C:/Windows/system32/Drivers/etc/hosts
(If you do not have the permission to modify it, perform the following configuration: Right-click Properties-> Security-> select your permission user edit-> hide full control-> application-> okay)
Add at the end of the file:
127.0.0.1 www.sina.com
Here www.sina.com is the domain name of the virtual host I set.
Apache Server Configuration:
Enable rewrite module:
Loadmodule rewrite_module modules/mod_rewrite.so
Load the VM configuration file:
# Virtual Hosts
Include CONF/extra/httpd-vhosts.conf
Apache Virtual Host file Configuration:
Open and edit the file according to the path of the virtual host configuration file in the Apache Server Configuration:
Set the virtual host, set the document root path, and set the server name and the virtual host name in windows to be consistent:
<Virtualhost *: 80>
DocumentRoot "D:/Wamp/mysina"
Servername www.sina.com
</Virtualhost>
Restart Apche.

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.