標籤:www height pac ble comm order data nbsp span
如何通過設定Apache的http.conf檔案,進行多個網域名稱的綁定(假設我們要綁定的網域名稱是discuz11.com和discuz22.com,獨立IP為25.25.25.25).
| 網域名稱/IP地址 |
網域名稱/IP指向的項目地址 |
| 25.25.25.25 |
/data/http |
| discuz11.com |
/data/http/disuz11 |
| discuz22.com |
/data/http/discuz22 |
方法:
開啟終端 輸入
vim /etc/httpd/conf/httpd.conf
第一步:
修改274行
#ServerName www.example.com:80 修改成ServerName 25.25.25.25(自己外網的IP)
修改988行
#NameVirtualHost *:80 修改成NameVirtualHost *:80(即去掉#注釋)
第二步:
在檔案的結尾處輸入
<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下Apache綁定多個網域名稱的方法