xxx91hx

问题 没有index.html文件 apache会显示目录结构 如下图

修改文件目录参考 D:\PC_webserver\apache\conf\extra\httpd-vhosts.conf

加粗部分为修改部分。

修改地方:Options Indexes FollowSymLinks # 修改为: Options  FollowSymLinks

只需要将上面代码中的 Indexes 去掉,就可以禁止 Apache 显示该目录结构。用户就不会看到该目录下的文件和子目录列表了。Indexes 的作用就是当该目录下没有 index.html 文件时,就显示目录结构,去掉 Indexes ,Apache 就不会显示该目录的列表了。

NameVirtualHost *:80
<VirtualHost *:80>
	ServerAdmin phpip.com@gmail.com
	DocumentRoot D:/PC_webserver/phproot
	ServerName localhost
	<Directory "D:/PC_webserver/phproot">

	Options FollowSymLinks
	AllowOverride Options FileInfo
	Order allow,deny
	Allow from all
	DirectoryIndex index.htm index.html index.php
	</Directory>
	Alias /phpmyadmin "D:/PC_webserver/phpMyAdmin/"
		<Directory "D:/PC_webserver/phpMyAdmin">
		AllowOverride AuthConfig
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

<VirtualHost *:80>
	
	DocumentRoot D:/PC_webserver/phproot/m
	ServerName m.netnic.com.cn
	<Directory "D:/PC_webserver/phproot/m">

	Options  FollowSymLinks
	AllowOverride Options FileInfo
	Order allow,deny
	Allow from all
	DirectoryIndex index.htm index.html index.php
	</Directory>
	
</VirtualHost>

  

分类:

技术点:

相关文章:

  • 2021-10-19
  • 2021-12-25
  • 2021-11-05
  • 2021-12-02
  • 2021-09-10
  • 2021-09-29
  • 2021-12-31
  • 2021-09-04
猜你喜欢
  • 2021-08-31
  • 2021-08-31
  • 2021-11-05
  • 2021-12-16
  • 2021-11-02
  • 2021-11-05
相关资源
相似解决方案