apache - How to configure the local web environment so that the file directory can be displayed when accessing?
漂亮男人
漂亮男人 2017-05-16 17:03:18
0
3
601

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>
漂亮男人
漂亮男人

reply all(3)
習慣沉默

If it is under apache, the configuration is as follows:
Method 1:
httpd.conf开启mod_autoindexModule (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

file
 <Files *>
  Options -Indexes
 </Files>
给我你的怀抱
<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,

習慣沉默

apache

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template