使用 lighttpd 提供由 wp-super-cache 创建的缓存/html 页面

发布于 2024-11-28 19:55:39 字数 1286 浏览 6 评论 0原文

目前我已将lighttpd配置为apache的反向代理。 Lighttpd 监听公共 IP,而 apache 监听 127.0.0.1。 Lighttpd 使用配置将非静态内容传递给 apache

    $HTTP["url"] !~ "\.(js|css|gif|jpg|png|ico|txt|swf|html|htm|gz)$" {
        proxy.server  = ( "" => (
            ( "host" => "127.0.0.1", "port" => 80 )))
        expire.url = ( "/" => "access 5 minutes")
    }

这个简单的设置与普通的 WordPress 安装一起工作得很好。静态文件由lighttpd 提供服务,而其他文件则由apache 提供服务。

我想将其提升到一个新的水平,因此我安装了 wp-super-cache,以便创建缓存/html 版本的页面。 wp-super-cache 插件已正确安装,并且其对 htacess 文件的修改已正确应用。我使用了wp-super-cache的mod_rewrite模式,wordpress的自定义永久链接结构是/%category%/%postname%.html。一切都很好。正在创建并提供缓存/html 页面。只有一个小问题。仅当我删除上述配置中的 html 文件扩展名时,它才会起作用。这意味着 apache 将提供缓存/html 文件,而不是 lighttpd。我想到的一种解决方案是在访问 html 文件时在 lighttpd 上使用类似的重写规则。我不知道它是否会起作用,但我还是搜索了它。我找到了 http://tempe. st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/ (您可能需要谷歌缓存才能访问它,因为它今天不起作用,但昨天它起作用了)这可能是解决方案,但坏消息是我正在使用基于 rpm 的发行版,并且我使用的 rpm 存储库没有用于 lighttpd 的 mod_magnet。我搜索了其他提供 lighttpd 和 mod_magnet 的存储库,但没有找到。所以我无法使用我找到的一种解决方案,因为我的 lighttpd 没有 mod_magnet 功能。

我应该怎么做才能让lighttpd 提供由wp-super-cache 创建的cache/html 文件?这可能吗?

谢谢!

Currently I have lighttpd configured as a reverse proxy of apache. Lighttpd listens on the public IP while apache listens on 127.0.0.1. Lighttpd passes non-static contents to apache using the configuration

    $HTTP["url"] !~ "\.(js|css|gif|jpg|png|ico|txt|swf|html|htm|gz)$" {
        proxy.server  = ( "" => (
            ( "host" => "127.0.0.1", "port" => 80 )))
        expire.url = ( "/" => "access 5 minutes")
    }

This simple setup works just fine with a vanilla wordpress install. Static files are being served by lighttpd while everything else is served by apache.

I want to take it to the next level so I installed wp-super-cache so that cache/html version of pages are created. The wp-super-cache plugin has been installed properly and its modification to the htacess file has been properly applied. I used the mod_rewrite mode of wp-super-cache and the custom permalink structure of wordpress is /%category%/%postname%.html. All works great. Cache/html pages are being created and served. There is just one little problem. It will only work if I remove the html file extesion in the above configuration. This means apache will serve the cache/html files and not lighttpd. One solution that I thought of is to have simliar rewrite rules on lighttpd when accessing html files. I do not know if it will gonna work but I searched for it anyway. I found http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/ (you may need google cache to access it because it was not working today, but yesterday it did) thinking it may be the solution but the bad news is I am using a rpm based distro and the rpm repo that I use does not have mod_magnet for lighttpd. I searched for other repos that offer lighttpd with mod_magnet but found none. So I cannot use the one solution that I have found because my lighttpd does not have mod_magnet functionality.

What should I do to make lighttpd serve the cache/html files that were created by wp-super-cache? Is this possible?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日记撕了你也走了 2024-12-05 19:55:39

我知道,有点晚了,但你可以尝试我的 WP Super Cache 版本的 rewrite.lua 脚本。它就像它必须工作一样工作。 https://gist.github.com/1258096

I know, it's a little bit late, but you could try my version of rewrite.lua script for WP Super Cache. It works just like it must work. https://gist.github.com/1258096

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文