First of all, this tutorial assumes you’ve got DarwinPorts 1.0 installed. If you don’t, go to the [DarwinPorts web site][1] and download and install it.
[1]: http://darwinports.opendarwin.org
[Lighttpd][2] is a “secure, fast, compliant and flexible” web server currently popular with Ruby on Rails programmers:
>lighttpd is a secure, fast, compliant and very flexible web-server which has been optimized for high-performance environments. It has a very low memory footprint compared to other webservers and takes care of cpu-load.
[2]: http://www.lighttpd.net/
Unless you _just_ installed DP, you’ll also want to update your ports index before attempting to install lighttpd. You can do this by typing
sudo port selfupdate
in the Terminal.
Once that process completes, you should be able to install lighttpd by typing
sudo port install lighttpd
Note that lighttpd depends upon __zlib__ and __pcre__, so DarwinPorts will install them if you don’t already have them installed. I’ve also added two _variants_ to the Portfile, which should make building with ssl and/or mysql easier:
To build lighttpd with MySQL (for MySQL virtual hosting), add __+mysql__ to the end of the install command, like so:
sudo port install lighttpd +mysql
Please note: if you don’t already have mysql4 installed via DP, it will be automatically installed. I had some trouble building mysql on Mac OS X 10.4, until I found a hint that fixed it. In order to successfully build mysql, you’ll need to tell Mac OS X to use gcc3.3 instead of the default gcc4.0
sudo gcc_select 3.3
will do nicely. To revert back to gcc4.0 when all is complete:
sudo gcc_select 4.0
To build lighttpd with ssl, add __+ssl__ to the end of the install command:
sudo port install lighttpd +ssl
If you don’t already have OpenSSL installed via DP, it will be installed.
Finally, you can also chain the variants:
sudo port install lighttpd +mysql +ssl
to install lighttpd with both. That’s how I’ve got it currently installed on my machine.
Please let me know if you have any problems installing lighttpd with these directions!
10 Comments
Would it be possible to add a postgresql8 variant as well?
Does lighttpd do pgsql virtual hosting? I thought it only worked with mysql at the moment. I’ll take a look at the docs; if there’s a way to configure it with pg8, I’ll set it up.
Hi, I’m trying to install lighttpd in Panther but I can’t. My knownless of linux/Unix is very limited. This is the point where I am, absolutely blocked:
1. I’ve download dmg of DP. Installed like a charm.
(I’ve added /opt/local/bin to PATH in /etc/profile)
2. I’ve download lighttpd-1.3.15, extracted files, configure, make & make install..all correct (i guess)
3. Now trying:
a)port install lighttpd
–>Port lighttpd not found
b)port install lighttpd-1.3.15
–>Port lighttpd not found
c)port search lighttpd
–>No match for lighttpd found
c)port search lighttpd-1.3.15
–>No match for lighttpd-1.3.15 found
What I’m doing bad?
Sorry, now I know that DP will make all those ugly things for me…
But now I can’t find lighttpd-1.3.15 portfile at http://www.darwinports.com, neither at darwinports.opendarwin.org or even here.
(DP is right now installing 1.3.14 finally)
Yup, I’m testing a new Portfile with the update. I should have it submitted within the next few days.
Hi again Jake. First, I want to say about this blog has resulted very useful for me.
Now I’m sucesfully with Ruby on Panther.
I’ve been able to try it over WebRick (very simple and fast) and Apache 1.3 with fastCGI (a bit harder to setup),
but I really don’t know how to use lighttp after installation. Isn’t there a lighttpd.conf anywhere?
GASGARAGE, there is a lighttpd.conf.sample file provided in the source builds of lighttpd; thus I’m not sure, but I presume that ports will stuff it into /usr/local/share/lighttpd- or somesuch.
Thanks for maintaining this Portfile!
Looks like a lighttpd.conf file is missing from the DarwinPorts version. Not much work to copy it out of the original source tarball, but I’m sure you’ll add it when you have the time.
I did a sync and selfupdate, however, when I run sudo port install lighttpd, I get:
---> Fetching lighttpd
---> Attempting to fetch lighttpd-1.4.4.tar.gz from http://www.lighttpd.net//download/
—> Attempting to fetch lighttpd-1.4.4.tar.gz from http://distfiles-od.opendarwin.org/
—> Attempting to fetch lighttpd-1.4.4.tar.gz from http://distfiles-msn.opendarwin.org/
—> Attempting to fetch lighttpd-1.4.4.tar.gz from http://distfiles-bay13.opendarwin.org/
Error: Target com.apple.fetch returned: fetch failed
Ditto on Shane’s error above.
One Trackback/Pingback
[…] ficial maintainer for the DarwinPorts lighttpd port. I’ve posted a tutorial on using DP to install lighttpd on my blog… plea […]
Post a Comment