If you don't want to run Apache or need a second webserver instance, you might decide to run Lighttpd 1.4. Here's how to install and configure it to use PHP.
- 1. Install lighttpd.
- 2. If you're already running an http server on port :80, you'll need to change lighttpd's default port from :80 to something else, like :81. Edit /etc/lighttpd/lighttpd.conf and change this line:
- 3. To use PHP, enable the fastcgi module.
ln -s ../conf-available/10-fastcgi.conf
- 4. Install php cgi module.
- 5. If using PHP5 instead of PHP4, edit the 10-fastcgi.conf file to point to the correct PHP cgi executable, as it defaults to PHP4:
"bin-path" => "/usr/bin/php5-cgi"
- 6. Restart the server
- 7. Test the server by creating a file called index.php and placing it in the webserver root, /var/www/.
- 8. Browse to http://localhost:81/ and verify the PHP settings.