Apache configures multiple websites and multiple domain names.

Source: Internet
Author: User
Open the Apache configuration file httpd. conf, for example,/etc/httpd/conf/httpd by default. conf # vi/etc/httpd/conf/httpd. conf adds the following virtual machine configurations to httpd. the end of the conf file can be NameVirtualHost *: 80 & nbsp

Open the Apache configuration file httpd. conf, for example,/etc/httpd/conf/httpd. conf by default.
# Vi/etc/httpd/conf/httpd. conf

Add the following virtual machine configurations to the end of the httpd. conf file.

NameVirtualHost *: 80 // Note: This line has the # number by default. remember to remove it.

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for all requests that do not

# Match a ServerName or ServerAlias in any block.

# ServerAdmin admin@centoscn.com


ServerAdmin admin@centoscn.com
DocumentRoot/var/www/html/centos
ServerName www.centoscn.com
ServerAlias www.centoscn.com
ErrorLog logs/centoscn.com-error_log
CustomLog log/centoscn.com-access_log common


ServerAdmin admin@gamekey.com.cn
DocumentRoot/var/www/html/gamekey.com.cn
ServerName www.gamekey.com.cn
ServerAlias www.gamekey.com.cn
ErrorLog logs/gamekey.com.cn-error_log
CustomLog logs/gamekey.com.cn-access_log common

Related Article

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.