Richard
Note: the Lighttpd compilation and installation instructions are no longer supported and are no longer updated. I’ve left them here purely as a reference for others to learn and use.
Lighttpd is a good alternative to Apache if you are looking for improved performance from your web-server. If you want to find more about the benefits of using Lighttpd over Apache please use Google. I consider it a good alternative but don’t want to get caught in a religious war. I just choose to provide this installation manual for people who wanted an alternative to Apache.
Note: If you haven’t installed Postfix using my instructions you are lacking the PCRE library, look at this page on how to install it.
Installing Lighttpd is easy, the difficult part is configuring it for proper use. Download the source from the site. Extract the archive and run the following commands:
You should see a list appear like:
mod_redirect : enabled
mod_ssi : enabled
mod_cgi : enabled
mod_fastcgi : enabled
mod_proxy : enabled
Make sure that mod_fastcgi is enabled or you won’t get PHP working when you’ve got Lighttpd installed.
sudo make install
This does all the work of compiling and installing and if you did’t get any errors you’ll be fine.
Next up quick configuring the server for it’s first time testing.
Copy the config file from the documentation folder to /etc/lighttpd/ sing the command:
Then edit the file /etc/lighttpd/lighttpd.conf.
Uncomment the following lines:
“mod_redirect”,
“mod_alias”,
“mod_access”,
“mod_fastcgi”,
“mod_simple_vhost”,
Change the following lines to match your environment:
server.errorlog = “/var/log/lighttpd/error.log”
accesslog.filename = “/var/log/lighttpd/access.log”
server.port = 80
fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/usr/local/php5x/bin/php-cgi”
)
)
)
Please note the different directory for the php 5 installation as we need to compile a different version of PHP to be able to use it with Lighttpd. I wan’t to keep an Apache version running for testing as well.
Create the directory /var/log/lighttpd/ using the command:
To test the config and to see if it all works you could start it using:
Make sure Apache isn’t running, and if it is you can also use a different portnumber for Lighttpd. Change the line:
And point your browser to http://localhost:81



Comments
11:29 am
Can you create a page for diy tomcat (standalone) / jsp page for Mac? Thanks.
Dante
1:36 pm
@Dante, sorry this was only a leftover from an earlier experiment. No other future changes planned.
9:59 am
is that the nice way of saying that tomcat and jsp are horrible nowadays?
they are.
1:56 pm
No they just don’t fit in the stack of applications I require. I tried using lighttpd as an alternative for Apache in a LAMP stack.
8:23 am
Dear DIYmacserver,
Sir im stuck about install n configure ffmpeg to my php lighttpd on my mac,
can you help me to resolve my trouble!
Thx b4
2:12 pm
@Indra, sorry this page is a left-over from an earlier experiment. It is no longer supported.