簡體   English   中英

本地主機沒有在 /var/www/html 中顯示我的文件

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

當我嘗試進入我的本地主機文件夾時,我得到了這個

在此處輸入圖像描述

我試圖卸載並重新安裝 apache2 但沒有任何變化

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

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 "服務器名" /etc/apache2/ | grep "\s#"* 在此處輸入圖像描述

我添加了 ServerName = Localhost

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

給了我這個 output 我以前用過一個美德主機

在此處輸入圖像描述

您需要在/var/www/html中放置一個文件,而不僅僅是文件夾。 確保 Apache 進程也可以讀取該文件。 嘗試將一個名為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