#ServerName Www.example.com:80CentOS 6.8 How to bind multiple domain names in Apache

Source: Internet
Author: User

How to bind multiple domain names by setting Apache http.conf files (assuming that the domain name we want to bind is discuz11.com and discuz22.com, independent IP is 25.25.25.25).

Domain/IP Address Address of the project to which domain/IP is pointing
25.25.25.25 /data/http
Discuz11.com /data/http/disuz11
Discuz22.com /data/http/discuz22

Method:

Open Terminal input

Vim/etc/httpd/conf/httpd.conf

The first step:

Modify Line 274

#ServerName www.example.com:80 modified to ServerName 25.25.25.25(own extranet IP)

Modify Line 988

#NameVirtualHost *:80 modified to namevirtualhost *:80(i.e., remove # comment)

Step Two:

Enter at the end of the file

<VirtualHost*:80>documentroot/data/httpd ServerName 25.25.25.25 errorlog/logs/25.25.25.25-error_log customlog/logs/25.25.25.25 -access_log Common</VirtualHost><VirtualHost*:80>documentroot/data/httpd/discuz11 ServerName discuz11.com errorlog/logs/discuz11.com-error_log customlog/logs/ Discuz11.com-access_log Common</VirtualHost><VirtualHost*:80>documentroot/data/httpd/discuz22 ServerName discuz22.com errorlog/logs/discuz22.com-error_log customlog/logs/ Discuz22.com-access_log Common</VirtualHost>

#ServerName Www.example.com:80CentOS 6.8 How to bind multiple domain names in Apache

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.