【问题标题】:Apache Web Server Virtual host not WorkingApache Web 服务器虚拟主机不工作
【发布时间】:2016-11-06 19:46:05
【问题描述】:

我正在尝试查看 Apache Web 服务器的 ui 上的日志目录。

所以我尝试在 httpd-vhosts.conf 文件中建立一个新的虚拟主机,并尝试将文档根目录提供给日志文件夹。

<VirtualHost *:8083>
    ServerAdmin tecmint@example.com
    DocumentRoot C:/Program Files/Apache Software Foundation/Apache2.2/logs
    ServerName localhost
    ErrorLog logs/example.com-error_log
    CustomLog logs/example.com-access_log common
</VirtualHost> 

我也给了 NameVirtualHost *:8083 并且在 httpd.conf 我有 Listen 8083。 当我点击 localhost:8083 重新启动服务器后,它会给出 404。

你能帮我弄清楚吗?

谢谢

【问题讨论】:

  • 您的日志中有 404 行/路径?

标签: apache logging web server virtualhost


【解决方案1】:

尝试以下 VirtualHost 配置:

<VirtualHost *:8083>
    ServerAdmin tecmint@example.com
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/logs/"
    ServerName localhost:8083
    <Directory />
        Require all granted
        Options +Indexes
    </Directory>
    ErrorLog logs/example.com-error_log
    CustomLog logs/example.com-access_log common
</VirtualHost> 

【讨论】:

    【解决方案2】:

    确保您已为您的 docroot 添加了目录块,并且您至少具有读取权限。

    <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/logs/"> 
    Require all granted
    Options +Indexes
    </Directory>
    

    【讨论】:

      猜你喜欢
      • 2018-01-25
      • 2013-08-29
      • 2021-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-16
      相关资源
      最近更新 更多