Configuration of the PHP virtual host

Source: Internet
Author: User

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

1 edit httpd.conf, find include conf/extra/httpd-vhosts.conf, delete the previous comment 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, this is the default root directory path, but to change is not this, keep looking down, find <directory "d:/wamp/www"; After </Directoory>, add the following content:

<directory "F://workplace" >

Options Indexes FollowSymLinks

AllowOverride All
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, add the following:
127.0.0.1 www. CMS. com

OK, then restart Apache and enter WWW in the browser. CMS. com, to see if the content of the access 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.