NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home / News / Linux / Other Tips, Tricks and Tutorials

Other Tips, Tricks and Tutorials


Installing Lighttpd on Fedora and Ubuntu

A faster alternative to Apache.

By Mihai Marinof, Linux Editor

16th of January 2007, 11:34 GMT

Adjust text size:


I've always wanted to have a spare alternative to everything, just in case something goes wrong with the first, I could always fall back to second, third and so on, and I'm pretty sure I'm not the only one who likes it this way. When you think about a web server for Linux, you'll undoubtedly think about Apache. Why? Either because it's the only web server application you've worked with, or thanks to its constantly increasing popularity level due to the fact that most (if not all) Linux distributions are released with Apache pre installed by default. Or because you're simply not aware of other web server applications, besides Apache. In that case, you'll be pleased to know that there's an alternative to the popular webserver and it's called lighttpd, which meets and probably even exceeds Apache's capabilities.

Lighttpd (light footprint + httpd) is a web server designed to be fast, secure, standards-compliant and flexible, while being optimized for speed-critical environments. Its memory footprint is very low compared
to other web servers, while its CPU load and its speed make lighttpd the most suitable for servers that suffer load problems. Moreover, Lighttpd is distributed under the BSD license, which makes lighttpd free.

Install lighttpd

on Fedora

- Install lighttpd through yum:
CODE
yum install lighttpd

- Stop Apache (httpd) if you have it installed and running
Also, make sure it won't auto-start at the next reboot:
CODE
service httpd stop
chkconfig httpd off

on Ubuntu

- Install lighttpd:
CODE
sudo apt-get install lighttpd

building from Source Code

- Make sure the following requirements are met:
• automake 1.8 or higher
• autoconf 2.57 or higher
• libtool 1.5 or higher

- Next, download the latest source package from SOFTPEDIA
- Open a terminal, change directory, compile and install:
CODE
tar xfz lighttpd-x.x.x.tar.gz
cd lighttpd-x.x.x
./configure
make
make install

Enable PHP support

on Fedora

- Install fastcgi mod for lighttpd:
CODE
yum install lighttpd-fastcgi

- Make sure you have php-cgi installed by typing php-cgi -v. If you get a command not found error, type:
CODE
yum install php-cli

- Open /etc/lighttpd/lighttpd.conf in your favorite editor and look for the fastcgi.server section. Uncomment the lines in that section so it will look like this:

Also, make sure that the "bin-path" is correct by running command /usr/bin/php-cgi -v. If it's wrong, run type php-cgi to get the correct one.

Note: It's possible that when you try to view a php file in lighttpd, you will get a 403 forbidden error. If you follow the above guide, that error will be remedied.

on Unbuntu

- Install PHP5-cgi:
CODE
sudo apt-get install php5-mysql

- Enable CGI for lighttpd:
CODE
sudo lighty-enable-mod cgi

Running lighttpd

on Fedora:

- Login as root and type:
(use 'restart', just in case it has been auto ran)
CODE
/etc/init.d/lighttpd restart
By default, the document root (web server directory that holds the HTML files) for lighttpd on Fedora is in /srv/www/lighttpd/.

on Ubuntu:

- Open a terminal and type:
CODE
sudo /etc/init.d/lighttpd start
By default, the document root for lighttpd on Ubuntu is in /var/www.
Read by 24,998 user(s) | Add comment | Link to this article TWEET THIS


Article rating:
Good (3.4/5) 18 vote(s)    

Subscribe to news | Print article | Send to friend

© Copyright 2001-2009 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


GNU Screen Tutorial

Setting Up A Central Syslog Server

Creating a Local Update Repository for FC6

Wolfenstein: Enemy Territory Server Setup

How to Bind a Range of IPs

Screencast Guide: Capure Your Linux Desktop on Video!

How to Setup an Encrypted Filesystem

Grant Root Privileges to Regular Users

User opinions:


Comment #1 by: Tanthalas on 11 Sep 2008, 10:15 GMT reply to this comment

Cheers for the guide mate. Quick correction for you - you've got people installing php5-mysql on Ubuntu when you actually want them to be installing php5-cgi. The rest is good stuff though. Got me installed in 5 minutes flat. Bookmarked!


Comment #2 by: Rick on 22 Dec 2008, 19:43 GMT reply to this comment

Thank you so much for this. everything works perfectly! This should be in the lighty docs.


Comment #3 by: Stefanos Michael Sofroniou on 16 Jan 2009, 13:48 GMT reply to this comment

Fedora's default lighttpd directory is "/var/www/lighttpd". Good work mate ;)


Comment #4 by: eswar on 19 Feb 2009, 15:01 GMT reply to this comment

I will not set gid to 0


i getting this error could you please any help me out.
how to over come this issuse


Comment #5 by: John on 13 May 2009, 08:44 GMT reply to this comment

Great guide. Helped me alot.
Thank You


Comment #6 by: peter_griffin on 26 Jul 2009, 01:58 GMT reply to this comment

Hi folks,

I am facing issues installing lighttpd-1.4.23 on Ubuntu. When I do "./configure", it keeps complaining about "zlib-headers", so I went and installed the latest version of zlib (1.2.3), still the errors won't go away :(

checking for zlib support... yes
checking for deflate in -lz... no
configure: error: zlib-headers and/or libs where not found, install them or build with --without-zlib

I don't want to install without zlib either, hence the question. Thanks a lot!

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 




Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM