Wampserver Next, configure the domain name and multi-domain, multi-directory site.

Source: Internet
Author: User

Configure the host file for the Windows system.

Hosts in the C:\WINDOWS\SYSTEM32\DRIVERS\ETC directory

The Hosts file has no extension. Hosts is a Windows file that configures the local access domain name IP, port.

The hosts are opened with Notepad or text editing software.

The Hosts file defaults to two lines:

127.0. 0.1        localhost::1             localhost

With the # switch, it is a comment, description.

# for example:##      102.54.94.97     rhino.acme.com          # source server#       38.25.63.10     x.acme.com              # x Client host# localhost name resolution is handled within DNS itself. #127.0.0.1       localhost#::1             localhost

Under the same IP, I configured three domain names:

127.0. 0.1        localhost::1             localhost127.0.  0.1       test1.cc127.0.  0.1       dedesp1.cc127.0.  0.1       dedesp2.cc

After the system IP and domain name is configured, go to Wampserver to configure the Apache domain name directory related files.

Modify Wampserver two files

Wampserver installation drive letter: \wamp64\bin\apache\apache2.4.23\conf\

httpd.conf
Wampserver installation drive letter: \wamp64\bin\apache\apache2.4.23\conf\extra\

Httpd-vhosts.conf

To look together, there are several common directories:

: \wamp64\bin\apache\apache2. 4.23 \conf:\wamp64\bin\apache\apache2. 4.23\conf\extra

httpd.conf file

Find code include conf/extra/httpd-vhosts.conf don't have the # number, there is a # # This file will be added comments out, if there is a #, remove.

It's about 522 lines.

httpd-vhosts.conf file, configure the multi-catalog site you want.

Original code:

# Virtual hosts#<virtualhost *:>    ServerName localhost    documentroot d:/ wamp64/www    <directory  "d:/wamp64/www/">        + Indexes +includes +followsymlinks +multiviews        allowoverride all        Require local    </ directory></virtualhost>#

Do not move the original code, configure your directory according to this rule, configure a few can.

Examples are as follows:

<virtualhost *:>    ServerName test1.cc    documentroot d:/demo/root1     <directory  "d:/demo/root1/">        +indexes +includes + FollowSymLinks +multiviews        allowoverride all        Require local    </directory></ Virtualhost>

Write a PHP file in the configuration directory to test it.

Example:

Echo "Hello 123";

Example 2:

<? PHP Echo "Hello tes1"; Echo "Hello root1"; Phpinfo ();? >

If there is anything that does not understand, add QQ group: 186970878

Wampserver Next, configure the domain name and multi-domain, multi-directory site.

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.