Installing Lighty+php+memcache+eaccelerator on ubuntu

Installing Lighy+php+memcache+eaccelerator on ubuntu

sudo -i
apt-get update
aptitude install lighttpd
aptitude install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json
vim /etc/php5/cgi/php.ini
add this cgi.fix_pathinfo = 1
vim /etc/lighttpd/lighttpd.conf
server.modules              = (
“mod_access”,
“mod_alias”,
“mod_accesslog”,
“mod_compress”,
“mod_fastcgi”,
“mod_rewrite”,
#           “mod_redirect”,
#           “mod_evhost”,
#           “mod_usertrack”,
#           “mod_rrdtool”,
#           “mod_webdav”,
#           “mod_expire”,
#           “mod_flv_streaming”,
#           “mod_evasive”
)

and end
fastcgi.server = ( “.php” => ((
“bin-path” => “/usr/bin/php5-cgi”,
“socket” => “/tmp/php.socket”,
“max-procs” => 1,
“bin-environment” => (
“PHP_FCGI_CHILDREN” => “4”,
“PHP_FCGI_MAX_REQUESTS” => “1000”
),
)))

/etc/init.d/lighttpd restart

vim /var/www/info.php
add this
<?php
phpinfo();
?>

test it

apt-get install memcached

edit vim /etc/memcached.conf
-u www-data(ubuntu default user for running apache)

vim /etc/php5/cgi/php.ini change
;session.save_path = /var/lib/php5
;session.save_path = tcp://hostip:port
session.save_path = tcp://hostip:11211

apt-get install make
apt-get install php5-dev
pecl install memcache    and add vim /etc/php5/cgi/php.ini extension=memcache.so”

/etc/init.d/memcached start
netstat -lnp
/etc/init.d/lighttpd restart
vim /etc/php5/cgi/conf.d/memcache.ini

aptitude install build-essential
aptitude install bzip2
wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2
tar -xjvf eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3
phpize
./configure
make
make install
it will show Installing shared extensions:     /usr/lib/php5/20060613+lfs/  eaccelerator.so
vim /etc/php5/cgi/php.ini and add eaccelerator.so

/etc/init.d/lighttpd restart
check http://server/info.php

https config for lighty
+++++++++++++++++++++++++++++
# mkdir /etc/lighttpd/ssl/domain.com -p
# cd /etc/lighttpd/ssl/domain.com
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# chown lighttpd:lighttpd /etc/lighttpd/ssl -R
# chmod 0600 /etc/lighttpd/ssl/domain.com
# vi /etc/lighttpd/lighttpd.conf

$SERVER[“socket”] == “192.168.0.2:443” {
server.document-root = “/var/www/”
ssl.engine = “enable”
ssl.pemfile = “/etc/lighttpd/ssl/domain.com/server.pem”
}

server.document-root       = “/var/www/”

# lighttpd -t -f /etc/lighttpd/lighttpd.conf
# /etc/init.d/lighttpd restart
# netstat -tulpn | grep :443

maxconnection setting in light.conf
server.max-keep-alive-requests = 15
server.max-keep-alive-idle = 15
server.max-read-idle     = 15
server.max-write-idle    = 15
connection.kbytes-per-second = 0
server.kbytes-per-second = 0
server.max-fds         = 512
server.max-connections = 1024

Advertisements

Posted on July 12, 2011, in LInux Based, Uncategorized, Web. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: