More Lighttpd Support

Author Message

DeAndre Johnson

Friday 21 November 2008 4:44:25 am

For those of us that like living on the edge :) I would like to see more lighttpd support

I am, because I choose to be!

Peter Putzer

Friday 21 November 2008 5:17:06 am

What exactly are you missing? For static cache support, have a look at http://ez.no/developer/forum/install_configuration/ez_publish_lighttpd_static_cache_success (although the script given there is not quite working on 3.10/4.0 - I'll post my updated script in the evening).

Greetings,
Peter

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

DeAndre Johnson

Saturday 22 November 2008 3:54:14 am

My lighttpd set up with virtual host is like this
HTTP["host"] =~ "(^|\.)mystite\.com$" {
server.document-root = "/var/www/html/myvirtualhost"
url.rewrite-once = (
"^/var/.*" => "$0",
"^/.*\.(css|html|htm|pdf|js|ico|png|gif|jpe?g)$" => "$0",
)
}

I need configuration to work with 4.0.1. So, yes I'm interested in your config.

I'm looking for info on how to set up ez webdav on lighttpd.

I am, because I choose to be!

André R.

Saturday 22 November 2008 4:41:19 am

Have you seen thees threads?

config:
http://ez.no/developer/forum/suggestions/memcache/(offset)/20

Webdav:
http://ez.no/developer/forum/developer/lighttpd_and_ez_webdav_it_works
http://ez.no/developer/forum/install_configuration/solved_webdav_3_10_0_admin_authentication_failed/

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Peter Putzer

Sunday 23 November 2008 11:14:40 am

I've put the configuration for siteaccess with static cache and without in separate config files.

ezpublish.conf

#
# Let eZ Publish handle (almost) all requests
#
url.rewrite-once += (
        #
        # download URLs are for eZ Publish
        #
        "^/content/download/.*$" => "/index.php$1",

        #
        # CSS etc. are handled by lighttpd
        #
        "^/.*\.(txt|css|html|htm|pdf|js|png|gif|jpe?g|htc|class|jar|swf)$" => "$
0",

        #
        # Everything else gets done by eZ Publish
        #
        "^/.*?(\?.*)?$" => "/index.php$1"
)

ezpublish-static.conf

#
# Static cache (needs mod_magnet)
#
magnet.attract-physical-path-to = ( "/etc/lighttpd/static-cache.lua" )

static-cache.lua

-- 
-- Static cache for eZ Publish
--

--
-- Requires Perl-comaptible regular expressions
--
require("rex_pcre")

function m (s, p)
        return rex_pcre.match(s, p)
end

function norm (s)
        return m (s, "^(.*[^/])") or ""
end

uri_path = lighty.env["uri.path"]
static_cache_file = norm(lighty.env["physical.doc-root"]) .. "/static" .. norm(uri_path) .. "/index.html"


--
-- Do not rewrite some URLs
--
rewrite = 
        not(m(uri_path, "[.](txt|css|html?|pdf|js|png|gif|jpe?g|htc|class|jar|ico|swf)$")) or
        m(uri_path, "^/content/download/.*$") 

--
-- Never rewrite index.php or index_treemenu.php
--
rewrite = rewrite and not(m(uri_path, "^/index(_treemenu)?\.php")) 

--
-- If we can't rewrite, exit immediately
--
if (not(rewrite)) then
        return
end

--
-- Special handling of treemenu
--
if (m(uri_path, "^/content/treemenu/?$")) then
        lighty.env["uri.path"] = "/index_treemenu.php"
        lighty.env["physical.rel-path"] = lighty.env["uri.path"]
        lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]

        return
end

--
-- Some URLs can't be cached
--
cache = rewrite and (
                lighty.env["request.method"] ~= "POST" and
                lighty.env["uri.query"] == nil
                )
                

-- print ("Initial URI: " .. lighty.env["request.uri"])
-- print ("Rewrite = " .. (rewrite and "true" or "false") .. ", Cache = " .. (cache and "true" or "false")) 

if cache then
        -- print ("Stat'ing : " .. static_cache_file)

        if not(nil == lighty.stat(static_cache_file)) then
                lighty.content = { { filename = static_cache_file } }
                lighty.header["Content-Type"] = "text/html"

                return 200
        else
                rewrite = true
        end
end

if (rewrite) then
        lighty.env["request.uri"] = lighty.env["uri.path"]
        lighty.env["uri.path"] = "/index.php" 
        lighty.env["physical.rel-path"] = lighty.env["uri.path"]
        lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]

        -- print ("Restarting: " .. lighty.env["uri.path"]) 
end

-- print ("Normal request handling for: " .. lighty.env["uri.path"])

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

DeAndre Johnson

Tuesday 25 November 2008 5:24:41 am

Thanks, will give it a try

I am, because I choose to be!

Peter Putzer

Tuesday 25 November 2008 6:05:00 am

Please note that I had some duplicated lines in the original posting of the Lua script. I've fixed that now.

Greetings,
Peter

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 04:15:26
Script start
Timing: Jan 18 2025 04:15:26
Module start 'layout'
Timing: Jan 18 2025 04:15:26
Module start 'content'
Timing: Jan 18 2025 04:15:27
Module end 'content'
Timing: Jan 18 2025 04:15:27
Script end

Main resources:

Total runtime1.2486 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 587.9063152.6250
Module start 'layout' 0.00660.0031 740.531339.4453
Module start 'content' 0.00971.2374 779.9766651.1406
Module end 'content' 1.24710.0015 1,431.117220.1719
Script end 1.2486  1,451.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2964160.0002
Check MTime0.00150.1221160.0001
Mysql Total
Database connection0.00080.067010.0008
Mysqli_queries1.177894.3294710.0166
Looping result0.00070.0582690.0000
Template Total1.211797.020.6059
Template load0.00200.163320.0010
Template processing1.209796.879120.6048
Template load and register function0.00010.008910.0001
states
state_id_array0.00110.089610.0011
state_identifier_array0.00150.119320.0007
Override
Cache load0.00180.1430470.0000
Sytem overhead
Fetch class attribute can translate value0.00090.069530.0003
Fetch class attribute name0.00160.1304100.0002
XML
Image XML parsing0.00140.110630.0005
class_abstraction
Instantiating content class attribute0.00000.0022140.0000
General
dbfile0.00110.0894290.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 37
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs