apache虚拟主机配置
在httpd.conf文件中配置一台www.sohu.cn的虚拟主机,然后在window系统中注册www.sohu.cn这台主机。在httpd.conf 文件中启用 httpd-vhosts.conf就是把#注销掉# Virtual hosts ,虚拟主机Include conf/extra/httpd-vhosts.conf
假设我们的虚拟主机在 f:/myweb 盘 [该站点,事先有] 设置http-vhosts.conf文件#配置我们自己的虚拟主机<VirtualHost127.0.0.1:80> DocumentRoot "d:/myblog" #这里配置欢迎首页面 DirectoryIndex index.html index.htmindex.php <Directory /> Options FollowSymLinks #不许可别人修改我们的页面 AllowOverride None #设置访问权限 Order allow,deny Allow from all </Directory></VirtualHost>4. 在hosts文件中添加我们的ip 和主机映射关系 c:/windows/system32/drivers/etc/hosts 127.0.0.1 www.sohu.cn
页:
[1]