search

Home  >  Q&A  >  body text

apache - How to configure the local web environment so that the file directory can be displayed when accessing?

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

reply all(3)I'll reply

  • 習慣沉默

    習慣沉默2017-05-16 17:05:18

    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>
    

    reply
    0
  • 给我你的怀抱

    给我你的怀抱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,

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 17:05:18

    apache

    reply
    0
  • Cancelreply