This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Lighttpd to serve /var ?
expandshrink

Lighttpd to serve /var ?

Lighttpd to serve /var ?

Monday 11 February 2008 9:27:03 am - 8 replies

Is there an option to set up the var-directory serving from a different source? I would be interested in serving static content from the /var -directory via lighttpd and everything else through Apache.

It's a no-brainer to set up lighttpd to serve /var in virtual host (say static.example.com), but how do I get eZ Publish to write the references to static.example.com instead of www.example.com?

In the RAILS-community people have done some stuff using Apache proxy features. http://www.howtoforge.com/reduce-apache-load-with-lighttpd-debian-etch I'm sure I could get it to work, but it seems... well. hackish.

And I'd prefer a real virtual host to circumvent the two connections per host limit (http://ajaxian.com/archives/using...et-around-browser-connection-limits). Sure it'd be even sweeter to have multiple static servers, say static1.example.com, static2.examp... and so forth. But that'd go over the top and it'd be easy to have issues with client-side caching if the domains for a resource change over time.

Monday 11 February 2008 10:10:17 am

> multiple static servers, say static1.example.com, static2.examp... and so forth.

2 connections per host is a browser specific setting, but anyway adding several host like that would cause a lot more work for the server (take a look at the 'KeepAlive' setting in most web servers).

When it comes to serving images and other downloads with another url, then you need to change all code that uses ezurl or ezroot for such files. You have settings there for getting it to generate absolute urls ("full"blunk.gif Emoticon instead of relative url like it does by default.

But the problem is that I'm not entirly sure where it gets the domain name from, if it takes it from the current host header, then you're out of luck. But if it takes it from settings in site.ini, then you just have to fix all other urls on you site that uses this or forke the template operators and make them use a different setting..

rel:
http://ez.no/doc/ez_publish/techn...rence/template_operators/urls/ezroot
http://ez.no/doc/ez_publish/techn...erence/template_operators/urls/ezurl

Monday 11 February 2008 10:50:22 am

Thanks for your reply. I was just wondering whether there's an out-of-the-box -setting for this. I'll have a closer look as we're far enough that this would be relevant happy.gif Emoticon

As for the domain to host static content... I think it might make sense to prepend static to the domain at hand. For example the static url for www.example.com could just aswell be static.www.example.com.

Another thing... Does anyone have any benchmark on using Apache's mod_mem_cache ( http://httpd.apache.org/docs/2.0/mod/mod_mem_cache.html )? Apparently it's still experimental, but is included with Debian Etch Apache2 package.

Modified on Monday 11 February 2008 11:22:55 am by Jani Tarvainen

Monday 11 February 2008 12:46:45 pm

mem cache seems to be stable if you use the most recent stable branch of Apache.
http://httpd.apache.org/docs/2.2/mod/mod_mem_cache.html

Monday 11 February 2008 2:11:44 pm

Hi,

I have done this setup on a high traffic site with rewrite, but it did not work as expected.

Apache will always use more resources for all requests if mod_php is enabled.

Another possible solution is to use a proxy or some kind of load-balancing in front of Apache. Lighttpd, squid or varnish is one of the possibilities.

Monday 11 February 2008 2:33:31 pm

> mem cache seems to be stable if you use the most recent stable branch of Apache.

Indeed it is. Note to self: Apache 2 != Apache 2.2 happy.gif Emoticon

Monday 11 February 2008 2:40:15 pm

Thanks Kim,

> Apache will always use more resources for all requests if mod_php is enabled.

Exactly what I thought. Proxying lighttpd through Apache with mod_php seems pointless.

> Another possible solution is to use a proxy or some kind of load-balancing in front of Apache. Lighttpd, squid or varnish is one of the possibilities.

Yeah, I thought about using Squid IF we'll need to enable clustering. I know that'd ease the load on the 'ol database when we're fetching images, etc. from there.

But as of now, it looks like I'll just run everything through Apache to avoid extra components. I'll probably look into mod_mem_cache, etc.

--
Jani

Modified on Monday 11 February 2008 2:41:39 pm by Jani Tarvainen

Saturday 08 March 2008 4:27:30 pm

Otherwise, a full setup in lighttpd + fastcgi works fine.

X+

Tuesday 18 March 2008 12:57:53 pm

http://ez.no/developer/open_fundi...ality/http_acceleration_with_varnish

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from