PHP v5.3.1 + PEAR + Ioncube Loader + Xcache + Memcache + MySQL (64bit) v5.1.43 + Lighttpd v1.4.26

Client ask to install these:

PHP v5.3.1 + PEAR + Ioncube Loader + Xcache + Memcache
> > > - MySQL (64bit) v5.1.44
> > > - Lighttpd v1.4.26

Here goes:

ssh 43.200
--> scp -r /ips1 root@44.82:/
(will take around 10 minutes)

=====

ssh 44.82
MAKE SURE disbale iptables and selinux/enforce is 0. IF NOT GOT ERROR STARTING MYSQL.
cd /ips1
rpm -i *.rpm

IF got error, so need to do this:
http://bugs.mysql.com/bug.php?id=37165
[root@localhost root]# /etc/init.d/mysql start
Starting MySQL...Manager of pid-file quit without updating [FAILED]
[root@localhost root]# restorecon -v -R /var/lib/mysql/
[root@localhost root]# /etc/init.d/mysql start
Starting MySQL. [ OK ]

#
# Now installing PHP 5.3.1
#

yum install freetype freetype-devel libmcrypt-devel libc-client-devel libjpeg-devel libpng-devel glibc-devel libtool-ltdl-devel gd-devel php-gd -y

#
# the will be this error if configure stret :
# configure: error: Cannot find libmysqlclient under /usr.
# Note that the MySQL client library is not bundled anymore!
# Refer : http://www.linuxquestions.org/questions/linux-server-73/php-configure-cannot-find-libmysqlclient-582944/
#
# undefined reference to `php_gd_gdFontCacheShutdown'
# Refer http://bmearns.net/wwk/view/Installing_PHP

'./configure' '--enable-fastcgi' '--enable-discard-path' '--enable-force-redirect' '--with-zlib' '--with-xml' '--with-mysql' '--prefix=/usr/local/php5-fcgi' '--enable-memory-limit' '--with-layout=GNU' '--with-regex=php' '--with-pear' '--with-curl=/usr/local/lib' '--with-gd=/usr' '--enable-gd-native-ttf' '--with-ttf' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-png-dir=/usr/local/lib' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-zip' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-mbstring' '--enable-pdo' '--with-pdo-mysql=/usr' '--enable-exif' '--without-pdo-sqlist' '--with-imap=/usr' '--with-imap-ssl=/usr' '--disable-postfix' '--enable-exif' '--with-mysqli=/usr/bin/mysql_config' '--with-mhash' '--with-libdir=lib64'

ln -s /usr/lib64/libmysqlclient.so /usr/lib64/mysql/libmysqlclient.so
make
make install

# Then to make life easier,

ln -s /usr/local/php5-fcgi/bin/php /usr/bin/php

# Good! Now Xcache
# http://forum.slicehost.com/comments.php?DiscussionID=3396

tar xvzf xcache
cd xcache
/usr/local/php5-fcgi/bin/phpize --clean && /usr/local/php5-fcgi/bin/phpize
./configure --enable-xcache --enable-xcache-coverager --with-php-config=/usr/local/php5-fcgi/bin/php-config
make
make install
cp /ips1/php.ini /usr/local/php5-fcgi/etc/php.ini
vi /usr/local/php5-fcgi/etc/php.ini
--> ADD zend_extension=/usr/local/php5-fcgi/lib/php/20090626/xcache.so
--> ADD THESE:

[xcache.admin]
xcache.admin.enable_auth = On
xcache.admin.user = "lalalal~"
xcache.admin.pass = "lalalalal~"

[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 128M
xcache.count = 8
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0

xcache.var_size = 0
xcache.var_count = 8
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300

xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"

xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off

# Done! Now Ioncube.

cd /ips1
tar xvzf ioncube_blablabla.tgz
mv ioncube /usr/local/
vi /usr/local/php5-fcgi/etc/php.ini
--> ADD zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.3.so

# Done! Now memcache

# Install memcached daemon first
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
yum -y install memcached
vi /etc/sysconfig/memcached

PORT=”11211″ #define on which port to urn
USER=”nobody” #same as apache user
MAXCONN=”1024″ #maximum number of connections allowed
CACHESIZE=”64″ #memory used for caching
OPTIONS=”" #use for any custom options

vi /etc/init.d/memcached
--> EDIT # chkconfig: 345 80 12 (the '#' sgn staays only edit the 345 part ONLY!)

chkconfig --levels 345 memcached on

/etc/init.d/memcached start
# memcached -h for more advanced options.

# Next, is the PHP memcache extension.
yum install libevent-devel -y
cd /ips1/memcache-2.2.5/
/usr/local/php5-fcgi/bin/phpize
./configure --enable-memcache --with-php-config=/usr/local/php5-fcgi/bin/php-config
make
make install
vi /usr/local/php5-fcgi/etc/php.ini
--> ADD extension=/usr/local/php5-fcgi/lib/php/20090626/memcache.so
# to verify: php -i | grep memcache

# DOne! Now Lighttpd.

wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.26.tar.gz
tar -xvzf lighttpd-1.4.26.tar.gz
yum install pcre-devel -y
cd lighttpd-1.4.26
./configure --with-openssl --with-rewrite --with-redirect --with-ssl --with-PACKAGE=mod_redirect --with-zlib --with-bzip2
make
make install

# now to configure lighttpd
#

mkdir /etc/lighttpd
mkdir -p /var/www/html
groupadd lighttpd
useradd -g lighttpd -d /var/www/html -s /sbin/nologin lighttpd
adduser -g lighttpd -d /var/www/html -s /sbin/nologin lighttpd
mkdir /home/lighttpd
chown lighttpd:lighttpd /home/lighttpd
mkdir /var/log/lighttpd
chown lighttpd:lighttpd /var/log/lighttpd
cd /etc/lighttpd
wget http://www.cyberciti.biz/tips/wp-content/uploads/2006/07/lighttpd.conf.txt
mv lighttpd.conf.txt lighttpd.conf
chown lighttpd:root /etc/lighttpd/lighttpd.conf
cd /etc/init.d/
wget http://www.cyberciti.biz/tips/wp-content/uploads/2006/07/lighttpd.txt
mv lighttpd.txt lighttpd
chmod +x lighttpd
ln -s /usr/local/sbin/lighttpd /usr/sbin/lighttpd
ln -s /usr/local/sbin/lighttpd-angel /usr/sbin/lighttpd-angel
mkdir /var/run/lighttpd
chown -R lighttpd:lighttpd /var/run/lighttpd
vi /etc/lighttpd/lighttpd.conf
--> EDIT the
--> ADD THESE:
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

#### fastcgi module
# read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/local/php5-fcgi/bin/php-cgi",
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "100",
"PHP_FCGI_MAX_REQUESTS" => "1000"
)
)
)
)

vi /usr/local/php5-cgi/etc/php.ini
--> EDIT cgi.fix_pathinfo = 1

vi /etc/init.d/lighttpd
---> EDIT # chkconfig: 2345 85 15 (the '#' sig stays there.. the 2345 part only amended the next two numbers let it be!)

chkconfig --add lighttpd
chkconfig --levels 2345 lighttpd on

/etc/init.d/lighttpd start
# To verify can do: netstat -ntlup | grep lighttpd

#
# DONE!! :D~
#

Kudos cllee hmlee jwchai kclee google.com

//alak

Comments

Popular posts from this blog

Quick Dirty Script for Checking Oracle Data Gurad Gap and Emailing it

SAP SWPM Software Provision Manager SL Toolset 1.0 SP22 Startup Options

SAP SystemCopy - Activation of TCI Notes, DigiSIgn Gone Wrong