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 为域名
历史资源提醒--必看
该页面资源/教程来自原魔趣吧历史资源转移,因发布历史久远,部分资源/教程可能已失效或无法在最新版程序中安装使用!DZ资源建议在Discuz3.4及以下版本使用,PHP版本建议5.6。资源仅提供做代码研究学习使用!
因改版,部分贴内链接将无法正常跳转,如链接失效或未正常跳转,请利用站内搜索功能搜索资源名称获取对应资源!