Wamp Configuring the Virtual Host directory (ii)

Source: Internet
Author: User

Previously wrote an article WAMP configuration Virtual host directory, details see WAMP Configuration Virtual Host directory, but recently do not know what the reason, the local environment using this way can not access to the corresponding directory, the case of baffled, a way to change.

Refer to the steps in the previous article.

Turn on the httpd.conf virtual host configuration
Include conf/extra/httpd-vhosts.conf  
Configuring the Httpd-vhosts.conf File

Delete the original content, add the local root directory

<VirtualHost *:80>    ServerAdmin [email protected]    DocumentRoot "C:/wamp/www"    ServerName 127.0.0.1    ServerAlias www.dummy-host2.localhost    ErrorLog "logs/dummy-host2.localhost-error.log"    CustomLog "logs/dummy-host2.localhost-access.log" combined</VirtualHost>

This enables 127.0.0.1 to access the WWW root directory
Next we configure 127.0.0.2 so that it can access the phpMyAdmin
Continue adding configuration

<VirtualHost *:80>    ServerAdmin [email protected]    DocumentRoot "C:\wamp\apps\phpmyadmin4.1.14"    ServerName 127.0.0.2    ServerAlias www.dummy-host2.localhost    ErrorLog "logs/dummy-host2.localhost-error.log"    CustomLog "logs/dummy-host2.localhost-access.log" combined</VirtualHost>

Finally configure 127.0.0.3 to allow access to our own project root directory

<VirtualHost *:80>    ServerAdmin [email protected]    DocumentRoot "C:/wamp/www/ihanzi"    ServerName 127.0.0.3    ServerAlias www.dummy-host2.localhost    ErrorLog "logs/dummy-host2.localhost-error.log"    CustomLog "logs/dummy-host2.localhost-access.log" combined</VirtualHost>

So why do you configure this?
Many PHP developers use Xampp,wamp and other software to develop locally.
With a new project, create a new directory under the site root directory, such as test
Then the browser accesses through http://localhost/test/
Seemingly convenient, it is not, after the project transplant to the Internet, there will be many problems on the path, beginners should avoid this. So just follow the method in this article to write the project locally.

Wamp Configuring the Virtual Host directory (ii)

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.