关于定义虚拟目录后必须要注释掉Document_Root的疑问

ssls18years 2016-06-25 11:03:02
关于定义虚拟目录后必须要注释掉Document_Root才能生效,那么。。。

我的疑问,加入这个apache在默认的htdocs目录下还有其他项目目录,那么注释掉Document_Root后,虚拟目录倒是生效了,但是其他项目目录岂不是全部失效了吗?。。。

不懂才来问,不要笑话。。。
...全文
168 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangsheng_1992 2016-06-27
  • 打赏
  • 举报
回复
首先 不需要注释虚拟目录 多个目录完全可以同时访问 给你贴段我的配置吧 我现在跑了好几个 也不再一个路径 也没有注释

<VirtualHost *:80>
    ServerAdmin zhangsheng
    DocumentRoot "/Users/zhangsheng/zhangsheng"
    ServerName www.my.com
    ErrorLog "/Users/zhangsheng/zhangsheng/log/error.log"
    CustomLog "/Users/zhangsheng/zhangsheng/log/access.log" common
    <directory "/Users/zhangsheng/zhangsheng">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order deny,allow
        Allow from all
        Require all granted
    </directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin zhangsheng
    DocumentRoot "/Users/zhangsheng/zhangsheng"
    ServerName www.my.com
    ErrorLog "/Users/zhangsheng/zhangsheng/log/error.log"
    CustomLog "/Users/zhangsheng/zhangsheng/log/access.log" common
    <directory "/Users/zhangsheng/zhangsheng">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order deny,allow
        Allow from all
        Require all granted
    </directory>
</VirtualHost>
lanshs 2016-06-27
  • 打赏
  • 举报
回复
印象中没有什么Document_Root必须注释掉的

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧