Forums / Suggestions / More Lighttpd Support

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

eZ debug

Timing: Jan 15 2025 03:01:21
Script start
Timing: Jan 15 2025 03:01:21
Module start 'content'
Timing: Jan 15 2025 03:01:22
Module end 'content'
Timing: Jan 15 2025 03:01:22
Script end

Main resources:

Total runtime1.1452 sec
Peak memory usage6,144.0000 KB
Database Queries201

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0098 685.2578214.8047
Module start 'content' 0.00991.0008 900.06251,932.7734
Module end 'content' 1.01070.1344 2,832.8359645.3047
Script end 1.1451  3,478.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00650.5633210.0003
Check MTime0.00140.1222210.0001
Mysql Total
Database connection0.00140.124810.0014
Mysqli_queries1.031490.06332010.0051
Looping result0.00190.16391980.0000
Template Total1.101496.220.5507
Template load0.00370.320120.0018
Template processing1.097795.859220.5489
Template load and register function0.00140.125910.0014
states
state_id_array0.00160.139010.0016
state_identifier_array0.00180.156220.0009
Override
Cache load0.00340.2932470.0001
Sytem overhead
Fetch class attribute can translate value0.00110.092940.0003
Fetch class attribute name0.00380.3356100.0004
XML
Image XML parsing0.00470.408640.0012
class_abstraction
Instantiating content class attribute0.00000.0028140.0000
General
dbfile0.00390.3377340.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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