首页 > 代码库 > apache绑定多个域名

apache绑定多个域名

在httpd.conf里,

1、把#NameVirtualHost *:80前的注释去掉
2、ServerName 127.0.0.1 修改成ServerName 72.167.11.30
3、#NameVirtualHost *   修改成"NameVirtualHost 72.167.11.30"

简单的添加:

<VirtualHost 72.167.11.30>
  DocumentRoot usr/local/www/
  ServerName   72.167.11.30
</VirtualHost>

<VirtualHost 72.167.11.30>
  DocumentRoot usr/local/www/minidx.com/
  ServerName   minidx.com
</VirtualHost>

<VirtualHost 72.167.11.30>
  DocumentRoot   usr/local/www/ntt.cc/
  ServerName   ntt.cc
</VirtualHost>

完成。