我已经在目录下下载了用于升级的confluence软件/var/www/html
。我需要为每个目录创建一个index.html 来列出目录。我尝试将以下内容添加到.htaccess
目录中的文件中(我在某个地方看到了它,index.html
目录中存在文件),但它不起作用:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
有没有实用程序或工具可以让我做到这一点?有人让我手动创建它,但我真的不想手动创建它。
更新
@Ipor Sircer / @Marcus Müller
我更新了httpd.conf
文件 - 现在如下所示:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"
#
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/html">
#
# 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.4/mod/core.html#options
# for more information.
#
Options +Indexes +FollowSymLinks
IndexOptions +FancyIndexing +HTMLTable
#Options None
#
# 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 None
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
这是在/var/www/html
:
pwd
/var/www/html
drwxr-xr-x 5 root root 86 Nov 7 18:10 .
drwxr-xr-x 4 root root 33 Aug 12 15:33 ..
drwxr-xr-x 4 root root 46 Nov 6 13:35 clients
drwxr-xr-x 3 root root 55 Nov 6 19:52 packages.confluent.io
drwxr-xr-x 3 root root 17 Nov 6 15:57 rpm
但是当我访问服务器时,我得到以下信息:
而如果我去server/rpm
,我会得到这个:
我还需要更改什么才能/var/www/html
从浏览器中看到下面的目录?