ComsenzEXP如何创建目录绑定多个域名 [复制链接]

moqu8 2017-1-1

3 0

1.打Apache\conf\httpd.conf文件,搜索 “Include conf/extra/httpd-vhosts.conf”,确保Include conf/extra/httpd-vhosts.conf前面没有 # 注释符,也就是确保引入了 vhosts 虚拟主机配置文件。
在虚拟主机设置文extra\httpd-vhosts.conf里设置:
取消 NameVirtualHost *:80 前面的 ##,这样就启用了 vhosts.conf ,默认的httpd.conf默认配置失效。虚拟主机配置将只设置在 httpd-vhosts.conf 里。
在Apache\conf\extra\httpd-vhosts.conf 这个文件里面的最后面添加以下代码( C:\ComsenzEXP\wwwroot\ww
)这个是你的网站目录地址,www.moban300.com这个是你要绑定的域名。

<VirtualHost 127.0.0.1:80>
DocumentRoot D:\ComsenzEXP\wwwroot
ServerName www.moban300.com
ServerAlias *
DirectoryIndex index.htm index.php index.html
ErrorLog "logs/test-error_log"
CustomLog "logs/test.log" common
</VirtualHost>

<VirtualHost 127.0.0.2:80>
DocumentRoot D:\ComsenzEXP\www
ServerName moban300.com
ServerAlias *
DirectoryIndex index.htm index.php index.html
ErrorLog "logs/test-error_log"
CustomLog "logs/test.log" common
</VirtualHost>

注:DocumentRoot D:\ComsenzEXP\wwwroot 为网站地址
       ServerName moban300.com 为域名

最新回复 (0)
返回
支持中心
邮箱:winkill2012@qqcom
新站优化中!部分功能尚未完善,敬请谅解!
支持中心