Linode.com Forum Forum Index Linode.com Forum
Linode Community Forums
 


lighttpd instead of Apache?

Click here to go to the original topic
Goto page 1, 2  Next
 
       Linode.com Forum Forum Index -> Linux, Apache, Mysql and PHP (LAMP) Forum
Author Message
encode



Joined: 25 Feb 2005
Posts: 18

Posted: Mon Mar 07, 2005 6:18 am    Post subject: lighttpd instead of Apache?  

Hi,

I was just wondering if anyone has considered using / is using lighttpd (http://www.lighttpd.net/) instead of Apache.

Lighttpd seems to be designed to take up a small amount of memory - one of the areas in which linodes are limited.

If you are using it, what are your experiences? Does it take up less memory than apache? Is it stable? Is it hard to configure?

Thanks :)
Back to top  
sweh



Joined: 13 Apr 2004
Posts: 245

Posted: Wed Mar 09, 2005 12:01 pm    Post subject:  

I use thttpd (http://www.acme.com/software/thttpd) which is absolutely tiny. It has less functionality than lighttpd but if you just want a basic web server with simple CGI support then you can't get much smaller than thttpd :-) I currently have it configured for 3 virtual servers and "ps" shows it has a VSZ of 2212, with an RSS of 652. That's tiny :-)

No fast CGI, not much in the way of functionality at all. But for a basic web server, it does the job :-)
Back to top  
CryptWizard



Joined: 13 Mar 2005
Posts: 41

Posted: Sun Mar 13, 2005 5:16 am    Post subject:  

Can it support PHP with all it's extensions? and virtual hosts?
Back to top  
Ciaran



Joined: 13 Feb 2004
Posts: 140
Location: England, UK

Posted: Sun Mar 13, 2005 8:14 am    Post subject:  

Well, much as it's not recommended by the PHP team, you can run PHP through the CGI interface, so yes, thttpd could support it if set up properly.

As for virtual hosts, I believe he already mentioned that he had 3 running. :D
Back to top  
hallow



Joined: 02 Mar 2005
Posts: 16

Posted: Tue Mar 15, 2005 8:39 am    Post subject:  

I'm about to give lighttpd a try myself. Looks like the folks over at textdrive love it. Especially check out the benchmarking post.
Back to top  
hallow



Joined: 02 Mar 2005
Posts: 16

Posted: Fri Apr 08, 2005 8:12 am    Post subject:  

hallow wrote: I'm about to give lighttpd a try myself. Looks like the folks over at textdrive love it. Especially check out the benchmarking post.

Well, I've gotten it up and running (http://webmages.com/). I'm using an externally spawned php fastcgi server, with two instances of lighttpd running (one ssl, one not) sharing the same php instance. Php also has eAccelerator installed. I've got rewrite rules setup and working with my wordpress installation, although I haven't gotten rules working with my gallery2 install, so for now no permalinks there, but otherwise it works.
Back to top  
Jay



Joined: 14 Nov 2004
Posts: 134
Location: NC, USA

Posted: Fri Apr 08, 2005 8:16 am    Post subject:  

I'm doing the exact same.

http://xen.oldos.org <-- running on my xen beta linode, gentoo 2005.0, lighttpd+php-fcgi+mysql 4.0

http://v7forum.oldos.org <-- running on my main UML linode, debian sarge, apache2+mod_php+mysql 4.1
Back to top  
adamgent



Joined: 23 Jun 2003
Posts: 261

Posted: Fri Apr 08, 2005 8:40 am    Post subject:  

Any one know what lighttpd is like for perl scripts and ssl?

Adam
Back to top  
Jay



Joined: 14 Nov 2004
Posts: 134
Location: NC, USA

Posted: Fri Apr 08, 2005 8:48 am    Post subject:  

adamgent wrote: Any one know what lighttpd is like for perl scripts and ssl?

Adam

You have to run a separate process for ssl.

Perl scripts have to be run as a cgi or fcgi.
Back to top  
hallow



Joined: 02 Mar 2005
Posts: 16

Posted: Fri Apr 08, 2005 9:17 am    Post subject:  

Have you played around with remote servers running fastcgi (lighthttpd on one box, php on another)? Does the other box need to have it's own copy of the website?

If not, maybe whoevers doing the hosted mysql service could offer a hosted php service. :)
Back to top  
hallow



Joined: 02 Mar 2005
Posts: 16

Posted: Fri Apr 08, 2005 9:25 am    Post subject:  

Jay wrote: adamgent wrote: Any one know what lighttpd is like for perl scripts and ssl?

Adam

You have to run a separate process for ssl.

Perl scripts have to be run as a cgi or fcgi.

But don't be too concerned about the seprate process thing. They can share the same backend (both of mine use the same PHP), so the total ram useage increase is about 600k (which is about 1/2 of what the first process uses for me).

PHP is kind of a hog (uses about 48m between all the processes here), I'm sure perl is too. Maybe after after lighttp dev starts to slow down we can get them to work on a new scripting language. :)
Back to top  
pmarsh



Joined: 22 Sep 2005
Posts: 13

Posted: Thu Oct 13, 2005 3:35 pm    Post subject: Lighttpd 1.4.6  

Just wanted to chime in. I am using lighttpd for Rails and FastCGI, couldn't be happier at the moment.

Combined with SQLite and I'm a happy camper with my UML Linode 80.
Back to top  
tronic



Joined: 04 Dec 2004
Posts: 123

Posted: Tue Nov 01, 2005 4:59 am    Post subject:  

Only comment: lighttpd looks nice. I've got a friend on OpenBSD running it.

The only oddity is when he runs it with IPv6 enabled, all v6-based requests that hits lighttpd is returned up to precisely 16K worth of data before lighttpd closes the connection.

No obvious config file or code issue. He can get > 16K with any other v6-based apps, so don't think the issue is with his TCP stack.

Just FYI, in case you need to run lighttpd with IPv6; test!

Other than that, looks to be pretty good.
Back to top  
sarge



Joined: 19 Dec 2004
Posts: 58

Posted: Tue Nov 01, 2005 2:10 pm    Post subject: Beware of Lighttpd 1.4.6 default script directory issue  

If you use scripting, beware that Lighttpd's default dir for fastcgi scripts can change with each restart. This means if you don't explicitely set the current dir within your scripts, it may break at unexpected times.

For example, the following will make the default dir for fastcgi scripts to be /

Code:
cd /
/etc/init.d/lighttpd restart


And the following will make the default dir for fastcgi scripts to be /usr/bin:

Code:
cd /usr/bin
/etc/init.d/lighttpd restart


Whether this is a serious security flaw or merely a compatibility annoyance with scripts that run fine in Apache can be debated elsewhere. But knowing about it helps avoid issues.
Back to top  
Arantor



Joined: 22 Jan 2006
Posts: 2
Location: England, UK

Posted: Mon Jan 23, 2006 7:24 am    Post subject: lighttpd: virtual hosts and url-rewriting?  

Just wondered if anyone had tried lighttpd with virtual hosts and url-rewriting?

The vhosts system looks like it might make more sense if you're literally hosting sites as:


/websites/example1.com
/websites/example2.com
/websites/example3.com


But if you wanted to do anything more exotic, you'd need to write lots of rewrite rules, by the looks of things. Anyone tried this at all? Is it faster than the equivalent Apache setup? (I should imagine if you're using 'simple vhosts' like above, it would in all probability be faster)

Also, it's not overly clear from the lighttpd website whether URL rewriting is specified in the main configuration file, or whether it can be set per-directory like in Apache's .htaccess files. If not, that could be quite a limitation which would put me - and probably others - off.

It seems that lighttpd might work better for what I want than Apache might, but I'm not yet sure.

Has anyone here tried this?
Back to top  
 
       Linode.com Forum Forum Index -> Linux, Apache, Mysql and PHP (LAMP) Forum Goto page 1, 2  Next
Page 1 of 2