Configuration of virtual host under Wamp

Source: Internet
Author: User

Original address: http://www.cnblogs.com/roemin/archive/2011/08/19/2146015.html

------

Today I configured the virtual directory, here is my configuration method.

1 edit httpd.conf, look for include conf/extra/httpd-vhosts.conf, and delete the previous annotation symbol "#".
2 Edit httpd-vhosts.conf, I put wampserver installed in D:/wamp, so my path here is D:\wamp\Apache2\conf\extra.

Empty or annotate the contents and replace them with the following:

Namevirtualhost *:80

This is the new effort directory
<virtualhost *:80>
ServerName www.cms.com
Serveralias www.cms.com
DocumentRoot "F://workplace"
</VirtualHost>

The original default directory
<virtualhost *:80>
ServerName localhost
Serveralias localhost
DocumentRoot "D:/wamp/www"
</VirtualHost>

3 edit httpd.conf, find DocumentRoot "d:/wamp/www/", this is the default root path, but to change is not this, keep looking down, find <directory "d:/wamp/www", and then in the After </Directoory> add the following content:

<directory "F://workplace" >

    options Indexes followsymlinks
    allowoverride all
 & Nbsp;  order Allow,deny
    allow from all
    </ directory>

    <directory "d:/wamp/www" >
    options Indexes followsymlinks
     allowoverride all
    order Allow, Deny
    allow from all
    </Directory>

4    Modify C:/windows/system32/drivers/etc/host This file, open with Notepad, plus the following:
   127.0.0.1  www. cms.com

OK, then restart Apache, enter www.cms.com in the browser, and see if the content accessed is workplace this directory.

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.