How to configure the local web environment so that the file directory can be displayed when accessing?
I'm not very professional. I don't know what professionals say about this problem, so I couldn't find it on Baidu.
Please give me some advice
httpd-vhost.conf Virtual host configuration:
请输入代码
<VirtualHost *>
DocumentRoot ./htdocs/book
ServerName www.book.com
ErrorLog logs/boook-error_log
</VirtualHost>
習慣沉默2017-05-16 17:05:18
If it is under apache, the configuration is as follows:
Method 1: httpd.conf
开启mod_autoindex
Module (enabled by default)
Turn on directory listing function:Options +Indexes
Turn off directory listing function:Options -Indexes
Method 2:
Add .htaccess
to the root directory
<Files *>
Options -Indexes
</Files>
给我你的怀抱2017-05-16 17:05:18
<VirtualHost *>
DocumentRoot ./htdocs/book
ServerName www.book.com
ErrorLog logs/boook-error_log
<Directory "./htdocs/book">
Options Indexes
Order allow,deny
IndexOptions NameWidth=25 Charset=UTF-8
Allow from all
</Directory>
</VirtualHost>
Try the above configuration, if it doesn’t work, change all paths in the configuration to absolute paths and try again,