【问题标题】:LAMP stack on Raspberry Pi 3 not loading CSSRaspberry Pi 3 上的 LAMP 堆栈未加载 CSS
【发布时间】:2018-04-01 17:09:47
【问题描述】:

我最近购买了 Raspberry Pi 3 并安装了 Ubuntu Mate,打算设置一个 Web 服务器。我安装... 阿帕奇/2.4.18 MySQL Ver 14.14 发行版 5.7.21 PHP 7.0.28

这是我的标题...

`<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
  <link rel="shortcut icon" href="assets/images/clc-338x64.jpg" type="image/x-icon">
  <meta name="description" content="">
  <title>Home</title>
  <link rel="stylesheet" href="assets/web/assets/mobirise-icons/mobirise-icons.css" type="text/css">
  <link rel="stylesheet" href="assets/tether/tether.min.css" type="text/css">
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" type="text/css">
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-grid.min.css" type="text/css">
  <link rel="stylesheet" href="assets/bootstrap/css/bootstrap-reboot.min.css" type="text/css">
  <link rel="stylesheet" href="assets/socicon/css/styles.css" type="text/css">
  <link rel="stylesheet" href="assets/dropdown/css/style.css" type="text/css">
  <link rel="stylesheet" href="assets/theme/css/style.css" type="text/css">
  <link rel="stylesheet" href="assets/mobirise/css/mbr-additional.css" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Abril+Fatface" rel="stylesheet"> 
  <link href="https://fonts.googleapis.com/css?family=Dancing+Script" rel="stylesheet">
</head>`

当我直接导航到 html 文件时

file:///var/www/html/index.html

我看这个网站就好了。 --> Fully Functional Site Image

但是当我尝试使用 Pi 的 IP 地址查看站点时

10.0.0.185

我得到了这个 --> Missing CSS Image

是什么阻止了所有 css 加载?

【问题讨论】:

  • Apache 错误日志和配置对于解决这个问题非常有用。

标签: css ubuntu raspberry-pi apache2


【解决方案1】:

我最终意外修复了它...我弄乱了网站目录的权限并将其从“root”更改,然后吓坏了,因为 root 不再是取回它的选项...然后我使用以下命令。

sudo chown -R www-data:www-data /var/www

现在,当我使用 IP 地址时,我的网站会按预期显示!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多