小乔 发表于 2017-1-8 06:08:37

apache的添加虚拟主机配置

在httpd.conf里设置如下
<VirtualHost *>
    <Directory "E:/phpworkspace/granary/app/webroot">
      Options -Indexes FollowSymLinks
      Allow from all
      AllowOverride All
    </Directory>
    ServerAdmin admin@www.granary.com
    DocumentRoot "E:/phpworkspace/granary/app/webroot"
    ServerName www.granary.com:80
    ServerAlias *.www.granary.com
    ErrorLog logs/www.granary.com-error_log
</VirtualHost>

然后在C:\WINDOWS\system32\drivers\etc的host文件里面添加主机对应名
Now find the "HOSTS" file, which may be in "C:\WINDOWS\system32\drivers\etc". Save it in same directory as HOSTS without the extention. Add the corresponding lines:

127.0.0.1 localhost
127.0.0.1 www.granary.com
页: [1]
查看完整版本: apache的添加虚拟主机配置