Web Server Using LIGHTTPD and PHP5 FPM

ok lets start our journey ….

for indonesia use this repo

deb http://kambing.ui.ac.id/ubuntu/ precise main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ precise-updates main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ precise-security main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ precise-backports main restricted universe multiverse
deb http://kambing.ui.ac.id/ubuntu/ precise-proposed main restricted universe multiverse

then update your server, im using ubuntu 12.04 LTS updating from Lucid

now install your lighty with this command

$ sudo apt-get install lighttpd

after installed test your localhost host, if it this work your browser show your lightty home page default,

Ok now install ur mySQL server with this command

$ sudo apt-get install mysql-server

now follow this command to install php5-fpm

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:brianmercer/php
$ sudo apt-get update
$ sudo apt-get install php5-fpm

now test your php fpm with

$ sudo /etc/init.d/php5-fpm restart

now lets start tunning LIGHTTPD, PHP FPM

now follow this command

cp /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-available/10-fastcgi-fpm.conf
vim /etc/lighttpd/conf-available/10-fastcgi-fpm.conf

full fill with this

server.modules   += ( "mod_fastcgi" )
fastcgi.server    = ( ".php" =>
        ((
               "socket" => "/var/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket",
               "bin-path" => "/usr/bin/php-cgi"
        ))
)

now enable the module, horay it’s work ………..

now open

/etc/lighttpd/lighttpd.conf --> and add this code
server.max-fds = 2048
server.max-keep-alive-idle = 4
server.max-read-idle = 60
server.max-write-idle = 360
server.event-handler = "linux-sysepoll"
server.network-backend = "linux-sendfile"
server.stat-cache-engine = "fam"
server.use-noatime = "enable"
server.max-worker = 4 #depends on your processor

now restart the service of lighttpd

and have nice the server

if you use memcached follow these instruction (for ubuntu 12.04 LTS)

1. download this packet http://download.tangent.org/libmemcached-0.44.tar.gz

2. extract the file into /usr/share/src

3. ok now, install memcahed (not lib, for the lib we can install later) use this command : aptitude install build-essential # apt-get  install php5-cli php5-dev php-pear

4. Then apt-get install memcached

5. ok, now go to /usr/share/scr –> use this command to install the libmemcached : # ./configure –prefix=/usr then make then make install

6. # pecl install memcacahed

7. go to your php.ini then add : extension = memcached.so

8. # vim /etc/memcached.conf   remark this line “-c 10240”

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s