Apache 多域名同端口同IP配置
如果原来的httpd.conf是正确的话,请保持不动,然后现最后的一行加上这两句:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
然后打开httpd.conf同一目录下的extra/httpd-vhosts.conf文件
修改如下:
<VirtualHost *:80>
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
<Directory "X:/wwwroot/web">
Order allow,deny
Allow from all
DirectoryIndex index.asp index.html index.php index.htm Default.htm Default.aspx index.aspx
</Directory>
</VirtualHost>
<VirtualHost *:80>
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
<Directory "X:/wwwroot/web">
Order allow,deny
Allow from all
DirectoryIndex index.asp index.html index.php index.htm Default.htm Default.aspx index.aspx
</Directory>
</VirtualHost>
然后重启Apache,就OK了