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