Windows下apache虚拟目录

来源:互联网 发布:日落黄沙知乎 编辑:程序博客网 时间:2024/06/07 04:06

问题背景:一个存储文件的地方,与apache的站点在不同盘上。想通过访问页面的形式来访问存储文件的目录。

首先需要在httpd.conf创建虚拟目录:

    #
    # ScriptAlias: This controls which directories contain server scripts. 
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "C:/AppServ/www/cgi-bin/"
Alias  /screenshot  "F:/Screenshot"


</IfModule>


其次,需要把访问权限打开

<Directory />
    Options FollowSymLinks ExecCGI Indexes
    AllowOverride None
    Order deny,allow
    Allow from all
    Satisfy all
</Directory>

这么一来,就可以访问http://127.0.0.1:80/screenshot了

0 0