windows下的Apache虚拟主机的建立


在httpd.conf文件的末尾添加如下代码,其中DocumentRoot为你的虚拟主机的根目录路径,ServerName为虚拟主机的域名,DirectoryIndex为重定向的指定的脚本(后面伪静态使用)。
<VirtualHost 127.0.0.1>
D0cumentRoot “E:/Server/apache2.2/htdocs/zend_places/public/”
ServerName zend_places.com
DirectoryIndex index.php
<Directory “E:/Server/apache2.2/htdocs/zend_places/public/”>
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
然后打开windows/system32/drivers/etc/hosts
在127.0.0.1 localhost后面添加代码
127.0.0.1 zend_places.com重启服务器,就大功告成了
通过浏览器访问http://zend_places.com


发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注