注册入学 登录
柠檬大学-伴我成长 返回首页

a1023456的个人空间 https://www.08nm.com/?2 [收藏] [复制] [分享] [RSS]

日志

xampp Apache DocumentRoot跨分区配置要点及Access forbidden解决方法

已有 1930 次阅读2012-12-13 16:17 |个人分类:技术分享| forbidden

xampp Apache DocumentRoot跨分区配置要点及Access forbidden解决方法


       linux下可以随便配置成绝对路径了,因为分区是被挂载到一个文件夹下的,与文件夹地址等同。相对路径的话是相对xampp的安装位置的。

        window下配置规则一样,需要注意一点的就是分隔符要用”/“而不是"\"。跨分区直接添加盘符即可,比如“DocumentRoot "F:/root"。

        修改DocumentRoot后,可能出现“Access forbidden”,权限不对所致。找到“<Directory "/xampp/htdocs">”,将/xampp/htdocs同步修改为配置的DocumentRoot,或者模仿结构重新配置一条也可以,即“<Directory "F:/root">“。


xampp 中提供了添加域名实例:(把前面的## 都去掉) 路径: xampp\apache\conf\extra\httpd-vhosts.conf



<VirtualHost *:80>

    ServerAdmin [email protected]

    DocumentRoot "F:/xampp/htdocs/dummy-host.localhost"

    ServerName dummy-host.localhost

    ServerAlias www.dummy-host.localhost

    ErrorLog "logs/dummy-host.localhost-error.log"

    CustomLog "logs/dummy-host.localhost-access.log" combined

</VirtualHost>


<Directory "F:/xampp/htdocs">

    #

    # Possible values for the Options directive are "None", "All",

    # or any combination of:

    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

    #

    # Note that "MultiViews" must be named *explicitly* --- "Options All"

    # doesn't give it to you.

    #

    # The Options directive is both complicated and important.  Please see

    # http://httpd.apache.org/docs/2.2/mod/core.html#options

    # for more information.

    #

    Options Indexes FollowSymLinks Includes ExecCGI

    #

    # AllowOverride controls what directives may be placed in .htaccess files.

    # It can be "All", "None", or any combination of the keywords:

    #   Options FileInfo AuthConfig Limit

    #

    AllowOverride All


    #

    # Controls who can get stuff from this server.

    #

    Require all granted

</Directory>


把 localhost 的目录配置给设置回来。 
<VirtualHost *:80> 
DocumentRoot /xampp/htdocs/ 
ServerName localhost 
</VirtualHost> 



文章来源:http://hi.baidu.com/jlusuoya/item/1de1550ec8378577bfe97ee0


路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册入学

联系我们|Archiver|小黑屋|手机版|滚动|柠檬大学 ( 京ICP备13050917号-2 )

GMT+8, 2024-5-4 01:33 , Processed in 0.029066 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

返回顶部