【问题标题】:Display public_html folder automatically自动显示 public_html 文件夹
【发布时间】:2015-01-05 17:39:33
【问题描述】:

我正在构建本地 apache2 网络服务器。这是我的 VirtualHost 文件的一部分。

    ServerAdmin webmaster@localhost
    ServerName www.chinchaladze.ge

    DocumentRoot /var/www/chinchaladze.ge
    <Directory />
            #Options FollowSymLinks
            #AllowOverride None
            #Options FollowSymLinks
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Order deny,allow
            Allow from all
    </Directory>
    <Directory /var/www/chinchaladze.ge>
            RewriteEngine On
            RewriteBase /
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Order deny,allow
            Allow from all
    </Directory>

据我所知,当我去 www.chinchaladze.ge 时,它​​应该会自动找到 public_html 文件夹并在那里找到 index.* 文件。但相反,它向我显示了一个默认的“/索引”网页,类似于:http://i.stack.imgur.com/vgze8.gif

你能帮我吗?提前致谢!

【问题讨论】:

    标签: php linux apache unix virtualhost


    【解决方案1】:

    你的

    Options Indexes
    

    负责显示图片上传中所见的可浏览目录结构。建议从所有生产服务器中删除此设置。

    使用

    DirectoryIndex index.html index.htm index.php welcome.html
    

    让 Apache 显示你的索引文件。

    https://wiki.apache.org/httpd/DirectoryListings

    【讨论】:

      猜你喜欢
      • 2014-03-07
      • 2016-08-22
      • 2018-02-04
      • 2018-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-08
      • 1970-01-01
      相关资源
      最近更新 更多