首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法从Apache2 web服务器加载图像

无法从Apache2 web服务器加载图像
EN

Ask Ubuntu用户
提问于 2018-06-18 09:27:18
回答 1查看 4.2K关注 0票数 0

我正试图在我的本地网络上创建我自己的小网站。除了图像,一切都很好。因为一些奇怪的原因,我的网站不能加载任何图片。

HTML的根文件夹是/var/www/html

/var/www/html/test.html

代码语言:javascript
复制
<html>
<head>
  <title>test</title>
</head>
<body>
  <img src="sniky.png">
</body>
</html>

ls -l /var/www/html

代码语言:javascript
复制
-rwxrwxrwx 1 root root   2155 Jun 18 08:57 bp.html
-rwxrwxrwx 1 root root   2296 Jun 17 23:12 filmy.html
-rwxrwxrwx 1 root root   1776 Jun 17 23:03 index.html
-rwxrwxrwx 1 root root   1886 Jun 17 23:11 info.html
-rwxrwxrwx 1 root root      1 Jun 17 22:18 serialy.html
-rwxrwxrwx 1 root root 897669 Jun 18 08:54 sniky.jpg
-rwxrwxrwx 1 root root     93 Jun 18 08:54 test.html

Apache2配置(/etc/apache2/apache2.conf):

代码语言:javascript
复制
<Directory />
        Options Indexes FollowSymLinks
        AllowOverride None
</Directory>
<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
</Directory>
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-06-18 09:42:50

有一个错误:

根据ls给出的文件列表,您的图像文件是.jpg文件,而不是.png文件。

您可以检查您的html代码。

代码语言:javascript
复制
<html>
<head>
<title>test</title>
</head>
<body>
<img src="sniky.jpg">
</body>
</html>
票数 4
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1047550

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档