http://redmine.lighttpd.net/projects/lighttpd/wiki/HowToInstallOnFreeBSD
(If you don't want PHP skip step 2)
Step 1. Verify ports installation¶
You should have a recent ports tree installed on your system. If you have not updated your ports tree recently, please do so before continuing. If you do not have a ports tree installed, you can use the portsnap utility to install or update it. I find this to be an extreemly quick way (under 15 minutes on a decent broadband connection) to install the full ports tree. And you don't even have to worry about cvsup or setting up configuration files.
Download most recent ports snapshot:
$ sudo portsnap fetch
or
# portsnap fetch
Example output:
Looking up portsnap.FreeBSD.org mirrors... 2 mirrors found.
Fetching public key from portsnap1.FreeBSD.org... done.
Fetching snapshot tag from portsnap1.FreeBSD.org... done.
Fetching snapshot metadata... done.
Fetching snapshot generated at Fri Mar 16 19:19:25 CDT 2007:
dbc38dfcfd2f738fc6ffa7c9d6b1b583982a39c19db371 32% of 46 MB 212 kBps 02m33s
(... download continues ...)
dbc38dfcfd2f738fc6ffa7c9d6b1b583982a39c19db371100% of 46 MB 202 kBps 00m00s
Extracting snapshot... done.
Verifying snapshot integrity... done.
Fetching snapshot tag from portsnap1.FreeBSD.org... done.
Fetching snapshot metadata... done.
Updating from Fri Mar 16 19:19:25 CDT 2007 to Sat Mar 17 04:02:50 CDT 2007.
Fetching 3 metadata patches.. done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 19 patches.....10.... done.
Applying patches... done.
Fetching 4 new ports or files... done.*
Extract snapshot:
$ sudo portsnap extract
or
# portsnap extract
Example output:
(... a lot of directories ...)
/usr/ports/x11/xsnow/
/usr/ports/x11/xstarroll/
/usr/ports/x11/xstroke/
/usr/ports/x11/xtacy/
/usr/ports/x11/xtattr/
/usr/ports/x11/xterm/
/usr/ports/x11/xtermcontrol/
/usr/ports/x11/xtermset/
/usr/ports/x11/xtestpicture/
/usr/ports/x11/xtoolwait/
/usr/ports/x11/xtrlock/
/usr/ports/x11/xtset/
/usr/ports/x11/xvattr/
/usr/ports/x11/xvkbd/
/usr/ports/x11/xwatchwin/
/usr/ports/x11/xwit/
/usr/ports/x11/xxkb/
/usr/ports/x11/xzoom/
/usr/ports/x11/yakuake/
/usr/ports/x11/yalias/
/usr/ports/x11/yelp/
/usr/ports/x11/zenity/
Building new INDEX files... done.
Step 2. Install PHP 5¶
cd /usr/ports/lang/php5
$ sudo make config
or
# make config
Verify that CGI and FastCGI are checked (default), and you want to enable REDIRECT as well. Choose ok. (Perhaps discard-path support as well?)
Now to compile and install it:
$ sudo make install clean
or
# make install clean
Step 3. Install lighttpd¶
cd /usr/ports/www/lighttpd
$ sudo make config
or
# make config
Verify whatever options you want for your installation of lighttpd.
Now to compile and install it:
$ sudo make install clean
or
# make install clean
Step 4. Post install configuration¶
Refer to TutorialLighttpdAndPHP for more fun.