DirectoryIndex在Apache别名中的应用

编程入门 行业动态 更新时间:2024-10-23 19:28:47
本文介绍了DirectoryIndex在Apache别名中的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何将DirectoryIndex应用于Apache中的Alias而不导致错误403?

How does one apply DirectoryIndex to an Alias in Apache without resulting in error 403?

这会导致响应标头200:

This results in response header 200:

http:// localhost / 表示 http:// localhost / index.html

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www DirectoryIndex index.html index.php index.xhtml index.htm default.htm <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory>

这会导致错误403,禁止:

This results in error 403, forbidden:

http:// localhost / aliasName / wwwrootDevelopmentSubDirectory /

<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www DirectoryIndex index.html index.php index.xhtml index.htm default.htm <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> Alias /aliasName/ "/home/user/Dropbox/Level1/Level2/wwwrootDevelopment/" <Directory /home/user/Dropbox/Level1/Level2/wwwrootDevelopment> DirectoryIndex index.html index.php index.xhtml index.htm default.htm Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory>

error.log显示相同消息

error.log reveals same message seen in the browser.

[Tue Apr 02 00:19:30 2013] [error] [client 172.x.x.x] (13)Permission denied: access to /aliasName/wwwrootDevelopmentSubDirectory/ denied, referer: localhost/

推荐答案

别名的目录索引应在apache2中该别名的主要指令中

DirectoryIndex to an Alias should be in pirticular directive for that alias in apache2

Alias /pma "/var/www/pma" <Directory "/var/www/pma"> DirectoryIndex adminer.php Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

更多推荐

DirectoryIndex在Apache别名中的应用

本文发布于:2023-11-01 20:03:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550279.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:别名   DirectoryIndex   Apache

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!