Configuration of multiple domain names in Windows Apache

Source: Internet
Author: User

1. httpd. conf

Find the # include CONF/extra/httpd-vhosts.conf and remove the previous #, that is, the Comment

2. httpd. conf

Find (modify the directory path to the root directory of all your sites. My local directory is D: \ wwwroot)

Modify AllowOverride none-> AllowOverride all
<Directory "D:/wwwroot">
#
# Possible values for the options directive are "none", "all ",
# Or any combination:
# Indexes includes followsymlinks symlinksifownermatch execcgi Multiviews
#
# Note that "Multiviews" must be named * explicitly *-"Options all"
# Doesn' t give it to you.
#
# The options directive is both complicated and important. Please see
# Http://httpd.apache.org/docs/2.2/mod/core.html#options
# For more information.
#
Options indexes followsymlinks

#
# AllowOverride controls what directives may be placed in. htaccess files.
# It can be "all", "none", or any combination of the keywords:
# Options fileinfo authconfig limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#
Order allow, deny
Allow from all

</Directory>

3. Find the httpd-vhosts.conf under the extra directory

<Virtualhost *: 80>
DocumentRoot D: \ apache \ htdocs
Serveradmin xxx@gmail.com
Servername localhost
</Virtualhost>
// Set the default site
<Virtualhost *: 80>
DocumentRoot D: \ wwwroot \ www.xxx.com // (www.xxx.com is the name of the folder in my storage system)
Servername www.xxxx.com
</Virtualhost>

// Set your own site. For specific log location settings, refer to the sample configuration.

4. Modify the C drive windows-> system32-> driver-> etc-> hosts file

Add: 127.0.0.1 www.xxx.com

Restart Apache. OK!

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.