简体   繁体   中英

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

however localhost stays 'empty' but i have folders in 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 "ServerName " /etc/apache2/ | grep "\s#"* 在此处输入图像描述

I added ServerName = Localhost

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

gives me this output i used a virtuell host before

在此处输入图像描述

You need to put a file, not just folders in /var/www/html . Make sure the file is readable by the Apache process too. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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