Configure Apache Multi-Domain Name Server in Ubuntu and ubuntuapache

Source: Internet
Author: User

Configure Apache Multi-Domain Name Server in Ubuntu and ubuntuapache

1. Objectives:

Access different domain names on the local machine to access different directories. That is, access a.com to access the program under the/var/www/a directory, and access B .com to access the program under the/var/www/B directory.

 

2. Problems:

/Etc/apache2 folder directory

Mod-available module conf-available configuration sites-available domain name/virtual directory ports. conf interface file

Module conf-enabled configuration sites-enable Domain Name/virtual directory envvars apache2.conf main configuration

The configuration file of apache in ubuntu is relatively scattered compared with a configuration file in Windos. This is for low coupling. If an error occurs when one site is configured, the operation of other sites is not affected.

Apache2.conf is the main configuration file. This file is like a building framework, which aggregates the configuration files in the externally dispersed enable directory.

The reason is clear. Create a. conf B. conf in sites-available and create a soft link in sites-enable.

However, accessing all domain names directs to the www root directory. Sites-enable has only one configuration file.


3. Solve the Problem

The confusion has been fruitless for several days. Finally, I found the answer in a post. I still cannot fully understand the specific principle. I will record it and then flip it over.

Comment out the following two lines in the default configuration file.

ErrorLog $ {APACHE_LOG_DIR}/error. log is changed

# ErrorLog $ {APACHE_LOG_DIR}/error. log

CustomLog $ {APACHE_LOG_DIR}/access. log combined is changed

# CustomLog $ {APACHE_LOG_DIR}/access. log combined

Refer:

Http://forum.ubuntu.org.cn/viewtopic.php? T = 341070

 

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.