Wampserver Multi-site configuration

Source: Internet
Author: User

1. Configure Wamp website address:

Locate the Wamp installation directory, such as ~\wamp\bin\apache\apache2.4.4\conf\extra\httpd-vhosts.conf

Open httpd-vhosts.conf File

There are default examples:

<virtualhost *:80>
ServerAdmin [email protected]
DocumentRoot "C:/apache24/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
Errorlog "Logs/dummy-host2.example.com-error.log"
Customlog "Logs/dummy-host2.example.com-access.log" common
</VirtualHost>

When we configure our own site, we can simply point to:

<virtualhost *:80>
DocumentRoot "e:demo/test01" (here is the path to set the site)
ServerName test01.com (here is the domain name to set up the site)
</VirtualHost>

After the settings are saved, any changes to the configured operation are restarted Wamp.

2. Configure Apache:

To open a httpd.conf file, refer to: http://www.cnblogs.com/junglexj/p/6016755.html

Place them

# Virtual Hosts
#Include conf/extra/httpd-vhosts.conf

The second line "#" is removed, indicating permission;

Before you find the <directory "E:/demo" >, set it to

# onlineoffline Tag-don ' t remove
Order Deny,allow
Allow from all
#Allow from 127.0.0.1

3. Configure the Hosts file

Catalog: C:\Windows\System32\drivers\etc\hosts

Add a row at the bottom

127.0.0.1 test01.com

Save exit, if unable to save please copy a Hosts file to desktop editing, and then replace to C:\Windows\System32\drivers\etc directory.

Can be tested in a new PHP file, e:/demo/test01/index.php

The contents of index.php are as follows:

<?php
echo "Hello World";
?>

Save, in the browser access http://test01.com/test01/can display "Hello World";

Note that if you modify the default port, add the port number after the domain name , for example: http://test01.com:8080/test01/

Reference: http://www.imooc.com/video/3521

Wampserver Multi-site configuration

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.