简体   繁体   English

本地主机没有在 /var/www/html 中显示我的文件

[英]Localhost doesnt show my files in /var/www/html

When i try to get into my localhost folder I get this当我尝试进入我的本地主机文件夹时,我得到了这个

在此处输入图像描述

I tried to uninstall and reinstall apache2 but nothing changed i restarted apache2 and reloaded it nothing i can access php myadmin and also mysql我试图卸载并重新安装 apache2 但没有任何变化

however localhost stays 'empty' but i have folders in var/www/html但是 localhost 保持“空”,但我在 var/www/html 中有文件夹

http://local.server.ip gives me this error bash: http://local.server.ip : No such file or directory http://local.server.ip gives me this error bash: http://local.server.ip : No such file or directory

    [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 "ServerName " /etc/apache2/ | grep -inRH "服务器名" /etc/apache2/ | grep "\s#"* grep "\s#"* 在此处输入图像描述

I added ServerName = Localhost我添加了 ServerName = Localhost

and grep -inRH "ServerName " /etc/apache2/ |和 grep -inRH "ServerName" /etc/apache2/ | grep "\s#"* grep "\s#"*

gives me this output i used a virtuell host before给了我这个 output 我以前用过一个美德主机

在此处输入图像描述

You need to put a file, not just folders in /var/www/html .您需要在/var/www/html中放置一个文件,而不仅仅是文件夹。 Make sure the file is readable by the Apache process too.确保 Apache 进程也可以读取该文件。 Try putting a file named index.html there, run chmod a+r /var/www/html/index.html and then browse to localhost again - you should see the contents of your file then尝试将一个名为index.html的文件放在那里,运行chmod a+r /var/www/html/index.html然后再次浏览到 localhost - 您应该会看到文件的内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM