741057228我QQ 发表于 2015-8-5 09:35:13

Apache 多域名同端口同IP配置

  如果原来的httpd.conf是正确的话,请保持不动,然后现最后的一行加上这两句:
  # Virtual hosts
Include conf/extra/httpd-vhosts.conf
  然后打开httpd.conf同一目录下的extra/httpd-vhosts.conf文件
  修改如下:
  
    ServerAdmin XX@XX.com
    DocumentRoot "X:/wwwroot/web"
    ServerName XX.XX.cn
    ServerAlias XX.XX.cn
    ErrorLog "logs/XX.XX.cn-error.log"
    CustomLog "logs/XX.XX.cn-access.log" common

Order allow,deny
Allow from all
DirectoryIndex index.asp index.html index.php index.htm Default.htm Default.aspx index.aspx


  
  
    ServerAdmin XX@XX.com
    DocumentRoot "X:/wwwroot/web1"
    ServerName XX.XX.org
    ServerAlias XX.XX.org
    ErrorLog "logs/XX.XX.org-error.log"
    CustomLog "logs/XX.XX.org-access.log" common

Order allow,deny
Allow from all
DirectoryIndex index.asp index.html index.php index.htm Default.htm Default.aspx index.aspx


  
  然后重启Apache,就OK了
  
页: [1]
查看完整版本: Apache 多域名同端口同IP配置