【发布时间】:2014-08-19 11:53:13
【问题描述】:
我是 linux 管理员的新手。我有一个运行 apache 的 ec2 实例。我已将 h5ai 解压缩到正确的文件夹,但它无法解析 h5ai 资源的正确 url。
我收到以下 404 资源加载错误(chrome)
http://www.mysite.net/static/%3C?=%20APP_HREF%20?%3Eclient/css/styles.css
http://www.mysite.net/static/%3C?=%20APP_HREF%20?%3Eclient/js/scripts.js
除了查看页面源我还有以下
<!DOCTYPE html><!--[if lt IE 10]><html class="no-js no-browser" lang="en"><![endif]--><!--[if gt IE 9]><!--><html lang="en" class="no-js browser"><!--<![endif]--><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>index · powered by h5ai 0.25.1 (http://larsjung.de/h5ai/)</title><meta name="description" content="index - powered by h5ai 0.25.1 (http://larsjung.de/h5ai/)"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="shortcut icon" href="<?= APP_HREF ?>client/images/favicon/favicon-16-32.ico"><link rel="apple-touch-icon-precomposed" type="image/png" href="<?= APP_HREF ?>client/images/favicon/favicon-152.png"><link rel="stylesheet" href="<?= APP_HREF ?>client/css/styles.css"><script src="<?= APP_HREF ?>client/js/scripts.js" data-module="main"></script></head><body><div id="topbar" class="clearfix"><ul id="navbar"></ul></div><div id="bottombar" class="clearfix"><span class="left"><span class="noJsMsg">⚡ JavaScript disabled! ⚡</span><span class="noBrowserMsg">⚡ Works best in <a href="http://browsehappy.com">modern browsers</a>! ⚡</span></span><span class="right"><a href="http://larsjung.de/h5ai/" title="h5ai 0.25.1 · a modern HTTP web server index">powered by h5ai 0.25.1</a></span><span class="center"></span></div><div id="sidebar"><div id="settings"></div></div><div id="fallback"><?= FALLBACK ?></div></body></html>
当我查看开发人员example page 来源以下内容时;
<?= APP_HREF ?>
已替换应用程序位置/_h5ai/。我知道 php 正在我的服务器上运行,因为 wordpress 和内容为 <?php phpinfo() ?> 的页面 test.php 工作正常。
我在这台服务器上的文件权限(设置 wordpress 和 FTP)上获得了一些乐趣,这会导致我的问题吗?即服务器'apache'对wordpress文件夹/www/html/blog有写权限(所以我可以自动安装主题等)。但是对于 FTP(使用 filezilla),用户 'ec2-user' 对 /www/html 的其余部分具有写权限。
非常感谢任何帮助。
【问题讨论】:
-
好的,所以我的第一个想法是为用户'apache'授予
/_h5ai/的写入权限,以便服务器可以写入_h5ai缓存。错误仍然存在! -
在联系作者 (0.25.1+4) 后尝试使用开发版本here。错误仍然存在。
-
在 PHP 5.3 中短打开标签 (
<?= ... ?>) 可能被禁用。在 dev build +4 中,那些短的开放标签被标准的 PHP 开放标签<?php echo ... ?>替换。因此错误现在应该不同了..你确定它仍然是同一个问题:404资源加载错误? -
Lars,我会在家时检查一下,以便连接到我的实例。
-
最新版本工作 0.35.1+9。我不能说 +4 版本是否愚蠢。
标签: apache .htaccess amazon-ec2 indexing