【问题标题】:Localhost doesnt show my files in /var/www/html本地主机没有在 /var/www/html 中显示我的文件
【发布时间】:2019-11-22 00:44:25
【问题描述】:

当我尝试进入我的本地主机文件夹时,我得到了这个

我尝试卸载并重新安装 apache2 但没有任何改变 我重新启动了 apache2 并没有重新加载它 我可以访问 php myadmin 和 mysql

但是 localhost 保持“空”,但我在 var/www/html 中有文件夹

http://local.server.ip 给了我这个错误 bash: http://local.server.ip: 没有这样的文件或目录

    [Fri Nov 22 00:07:53.655847 2019] [mpm_prefork:notice] [pid 21559] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 00:07:53.655912 2019] [core:notice] [pid 21559] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:15:05.406145 2019] [mpm_prefork:notice] [pid 21559] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Nov 22 01:15:05.436629 2019] [mpm_prefork:notice] [pid 21559] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:15:05.436640 2019] [core:notice] [pid 21559] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:16:52.092655 2019] [mpm_prefork:notice] [pid 21559] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Nov 22 01:16:52.129474 2019] [mpm_prefork:notice] [pid 21559] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:16:52.129490 2019] [core:notice] [pid 21559] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:30:50.708402 2019] [mpm_prefork:notice] [pid 21559] AH00169: caught SIGTERM, shutting down
[Fri Nov 22 01:31:02.848171 2019] [mpm_prefork:notice] [pid 27340] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:31:02.848207 2019] [core:notice] [pid 27340] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:31:20.409265 2019] [mpm_prefork:notice] [pid 27340] AH00169: caught SIGTERM, shutting down
[Fri Nov 22 01:34:21.641232 2019] [mpm_prefork:notice] [pid 28568] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:34:21.641268 2019] [core:notice] [pid 28568] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 01:34:46.704722 2019] [mpm_prefork:notice] [pid 28568] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Nov 22 01:34:46.725762 2019] [mpm_prefork:notice] [pid 28568] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 01:34:46.725772 2019] [core:notice] [pid 28568] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 22 02:08:30.892405 2019] [mpm_prefork:notice] [pid 28568] AH00169: caught SIGTERM, shutting down
[Fri Nov 22 02:08:30.984621 2019] [mpm_prefork:notice] [pid 30975] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Nov 22 02:08:30.984671 2019] [core:notice] [pid 30975] AH00094: Command line: '/usr/sbin/apache2'

grep -inRH "服务器名" /etc/apache2/ | grep "\s#"*

我添加了 服务器名 = 本地主机

和 grep -inRH "服务器名" /etc/apache2/ | grep "\s#"*

给我这个输出 我之前用过一个美德主机

【问题讨论】:

    标签: php localhost apache2


    【解决方案1】:

    您需要在/var/www/html 中放置一个文件,而不仅仅是文件夹。确保文件也可以被 Apache 进程读取。尝试将一个名为 index.html 的文件放在那里,运行 chmod a+r /var/www/html/index.html 然后再次浏览到 localhost - 然后您应该会看到文件的内容

    【讨论】:

    • 我在 html 文件夹中有文件和文件夹
    • 您可以运行ls -l /var/www/html 并在此处发布吗?此外,检查 Apache 日志是否有错误,如果您看到任何错误,请将其包括在此处(可能是 /var/log/apache2/error.log)
    • [2019 年 11 月 22 日星期五 00:07:53.655847] [mpm_prefork:notice] [pid 21559] AH00163:Apache/2.4.29 (Ubuntu) 已配置——恢复正常操作 [星期五 11 月 22 日 00: 07:53.655912 2019] [core:notice] [pid 21559] AH00094: 命令行: '/usr/sbin/apache2' [Fri Nov 22 01:15:05.406145 2019] [mpm_prefork:notice] [pid 21559] AH00171: Graceful请求重新启动,正在重新启动 AH00558:apache2:无法可靠地确定服务器的完全限定域名,使用 127.0.1.1。全局设置“ServerName”指令以禁止显示此消息
    • 是的,我不希望您这样做,但我需要查看该命令的输出以进一步帮助您
    • 请将您的上述评论添加为问题的一部分,而不是评论
    猜你喜欢
    • 2017-05-17
    • 2021-04-20
    • 2021-11-08
    • 2022-01-09
    • 1970-01-01
    • 2020-07-04
    • 1970-01-01
    • 1970-01-01
    • 2015-09-26
    相关资源
    最近更新 更多