Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Apache 2.4,在浏览器中启用文件夹视图_Php_Windows_Apache - Fatal编程技术网

Php Apache 2.4,在浏览器中启用文件夹视图

Php Apache 2.4,在浏览器中启用文件夹视图,php,windows,apache,Php,Windows,Apache,在Apache Lounge的Win 7机器上使用Apache 2.4 64位VC10构建,如何启用文件夹文件视图?我只想看看每个文件夹中有哪些文件没有索引文件 这仅用于开发目的。我尝试过使用选项索引/All选项,并重新启动了服务器几次。我得到的只是403禁止。 <Directory "/srv/www/htdocs"> Options +Indexes ################ Order allow,deny

在Apache Lounge的Win 7机器上使用Apache 2.4 64位VC10构建,如何启用文件夹文件视图?我只想看看每个文件夹中有哪些文件没有索引文件

这仅用于开发目的。我尝试过使用选项索引/All选项,并重新启动了服务器几次。我得到的只是403禁止。


<Directory "/srv/www/htdocs"> 
        Options +Indexes
        ################
        Order allow,deny 
        Allow from all 
</Directory>
选项+索引 ################ 命令允许,拒绝 通融
对于Apache 2.4,如果启用了index.html或index.php,则必须先禁用该功能,然后才能在web浏览器中显示文件夹和文件

<Directory "/vhost/www/htdocs/path/to/folder">
 DirectoryIndex disabled
 Options Indexes
</Directory>

目录索引已禁用
期权指数

Apache中的指令已从2.2版更改为2.4版及更高版本

我运行的是2.4.7版,基本vhost文件如下所示:

<VirtualHost 192.168.1.5:80>

  DocumentRoot /srv/html/
  ServerName some.placeoverthe.rainbow

 <Directory /srv/html/>
   Options Indexes  ## Allows directory browsing.
   Require all granted  ## Allow all request
 </Directory>

</VirtualHost>
2.4配置:

Order deny,allow
Deny from all
Require all denied
Order allow,deny
Allow from all
Require all granted
Order Deny,Allow
Deny from all
Allow from example.org
Require host example.org
在本例中,允许所有请求

2.2配置:

Order deny,allow
Deny from all
Require all denied
Order allow,deny
Allow from all
Require all granted
Order Deny,Allow
Deny from all
Allow from example.org
Require host example.org
2.4配置:

Order deny,allow
Deny from all
Require all denied
Order allow,deny
Allow from all
Require all granted
Order Deny,Allow
Deny from all
Allow from example.org
Require host example.org
在下面的示例中,example.org域中的所有主机都被允许访问;所有其他主机都被拒绝访问

2.2配置:

Order deny,allow
Deny from all
Require all denied
Order allow,deny
Allow from all
Require all granted
Order Deny,Allow
Deny from all
Allow from example.org
Require host example.org
2.4配置:

Order deny,allow
Deny from all
Require all denied
Order allow,deny
Allow from all
Require all granted
Order Deny,Allow
Deny from all
Allow from example.org
Require host example.org
目录索引

来自Apache网站:

Options指令控制特定目录中可用的服务器功能

选项可以设置为“无”,在这种情况下,不会启用任何附加功能,或者设置以下一项或多项:

全部

  All options except for MultiViews.
execgi

  Execution of CGI scripts using mod_cgi is permitted.
以下符号链接

Server-side includes provided by mod_include are permitted.
服务器将遵循此目录中的符号链接。这是默认设置

即使服务器遵循符号链接,它也不会更改用于匹配节的路径名

以下SymLinks和SymLinksFownerMatch选项仅适用于节或.htaccess文件

忽略此选项不应被视为安全限制,因为符号链接测试受竞争条件的约束,从而使其具有可规避性

包括

Server-side includes provided by mod_include are permitted.
包括noexec

Server-side includes are permitted, but the #exec cmd and #exec cgi are disabled. It is still possible to #include virtual CGI scripts from ScriptAliased directories.
索引

Server-side includes provided by mod_include are permitted.
如果请求映射到目录的URL,并且没有 DirectoryIndex(例如index.html)在该目录中,然后mod_autoindex将返回该目录的格式化列表

多视图

Server-side includes provided by mod_include are permitted.
允许使用mod_协商内容协商“多视图”

注意: 如果将此选项设置为除以下位置以外的任何位置,则将忽略此选项:
mod_谈判需要真正的资源进行比较和评估

symlinksFownerMatch

The server will only follow symbolic links for 
which the target file or directory is owned by 
the same user id as the link. 
作为旁注:您可能需要检查并确保运行apache的用户具有从该目录读取的权限。在windows上,这可能不是一个问题,但在Linux上,这很可能是一个问题。在大多数Linux发行版上,默认用户通常是:

www数据


因此,如果该目录由apache运行的用户以外的其他人拥有,则需要更改该目录的权限以允许apache访问。

通常是
选项+索引
-如果稍后在其他地方覆盖该设置,再次用索引覆盖它。您是否有
LoadModule autoindex\u module modules/mod\u autoindex.so
在您的httpd.conf中?
AllowOverride none Require all denied
这一行是我的问题。这在Ubuntu 14.04和Apache 2.4.7上对我有效。这是Apache 2.2配置。在2.4中不起作用