Quantcast
Viewing latest article 3
Browse Latest Browse All 6

how to set up lighttpd with PHP fastcgi on Linux/Debian

Lighttpd is a really lightweight web server, which is exactly what I wanted, and configuring it is as easy as typing in a few commands.

Here is how I did it on Linux Debian 6(Squeeze) x86 minimal:

apt-get update
apt-get upgrade
apt-get install nano

… to update your system and to install the nano text editor (which you do not necessarily need).

apt-get install lighttpd php5-cgi

To install lighttpd and php cgi.

lighty-enable-mod fastcgi 
lighty-enable-mod fastcgi-php

Enable fastcgi for PHP

/etc/init.d/lighttpd restart

To make changes take effect.

Now should the “lighty-enable” lines not work for you:

nano /etc/lighttpd/lighttpd.conf

Open the configuration file with the editor nano.

Add “mod_fastcgi” to the modules:

server.modules              = (
            "mod_access",
            "mod_accesslog",
            "mod_fastcgi",
            "mod_rewrite",
            "mod_auth"
)

Add this code to the configuration:

fastcgi.server = ( ".php" =>; ((
                     "bin-path" =>; "/usr/bin/php-cgi",
                     "socket" =>; "/tmp/php.socket"
                 )))

Continue here to set up php5-fpm which consumes less resources.


Viewing latest article 3
Browse Latest Browse All 6

Trending Articles