Configure Apache Apache server How to configure multi-site

Source: Internet
Author: User

Http://jingyan.baidu.com/article/5225f26b07605be6fa090890.html

  • Allows Apache to load the virtual host module at boot time.

    Open the Apache installation directory under the conf/httpd.conf file, find the following two lines of text, the first # number is removed, and then saved.

    #LoadModule Vhost_alias_module modules/mod_vhost_alias.so

    #Include conf/extra/httpd-vhosts.conf

  • Then find DocumentRoot and directory in the same file and change to the top level directory of the Site Directory

    For example, sites are placed in D:/APPSERV/WWW/1 and D:/APPSERV/WWW/2, then the following form is changed

    DocumentRoot "D:/appserv/www"

    <directory "D:/appserv/www" >

  • After the configuration is complete, you can open the Apache installation directory under the/conf/extra/httpd-vhosts.conf file and add the following at the end:

    DocumentRoot is the file placement path, servername is the site domain name:

    <VirtualHost*:80>

    DocumentRoot "D:/APPSERV/WWW/1"

    ServerName www.xxx.com

    </VirtualHost>

    <VirtualHost*:80>

    DocumentRoot "D:/APPSERV/WWW/2"

    ServerName www.xxx2.com

    </VirtualHost>

  • The final restart of the Apache service is configured to complete.

  • My personal configuration Apache encountered a problem, such as my website www.stzjz.com

    Directly enter the domain name opens the result is the Appserv interface

  • 6

    My solution is to

    Apache install directory under the/conf/extra/httpd-vhosts.conf file, add the following at the end:

    <VirtualHost*:80>

    DocumentRoot "D:/appserv/www"

    ServerName 127.0.0.1

    </VirtualHost>

Configuring the Apache Apache server How to configure multiple sites

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.