• strict warning: Non-static method view::load() should not be called statically in /home/kitczqgn/public_html/newmediaist.com/sites/all/modules/views/views.module on line 879.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/kitczqgn/public_html/newmediaist.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 589.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/kitczqgn/public_html/newmediaist.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 589.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/kitczqgn/public_html/newmediaist.com/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 149.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/kitczqgn/public_html/newmediaist.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/kitczqgn/public_html/newmediaist.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.

Installing NGINX, MySQL, PHP-FPM & XCache on CentOS 5.3 HOWTO

This post is pretty technical; if you don't consider yourself a geek, you'll likely want to skip it.

Apache is the most popular web server in the world. That doesn't necessarily mean its the best for all tasks though.

NGINX ("Engine X") is another web server. NGINX has been gaining quite a bit of popularity recently as it seems to run more efficiently than Apache, enabling less powerful web servers to handle a larger number of requests. This higher efficiency has made NGINX very popular in the virtual private server (VPS) scene.

I have a few VPS I use for experimentation / pet projects, and recently decided to give NGINX a try. But why stop there with the experimentation? Why not install XCache & PHP-FPM as well?

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarc...
yum install nginx
(The config file will be installed to /etc/nginx/nginx.conf - check it out, much cleaner than httpd.conf imho)

Download from http://monkey.org/~provos/libevent/
cd /usr/local/src
wget http://monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar xzf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
./configure --prefix=/usr
make install
libtool --finish /usr/lib

cd ..
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.2.tar.gz
tar -xzf libxml2-2.7.2.tar.gz
cd libxml2-2.7.2
./configure --prefix=/usr
make install

yum install mcrypt
yum install libmcrypt
yum install libmcrypt-devel

Download it here: http://php-fpm.org/download/
cd ..
wget http://ca3.php.net/get/php-5.3.2.tar.bz2/from/this/mirror
tar -jxvpf php-5.3.2.tar.bz2
wget http://github.com/dreamcat4/php-fpm/tarball/0.6-5.3.1
gunzip dreamcat4-php-fpm-3bb2b9b.tar.gz
tar xvf dreamcat4-php-fpm-3bb2b9b.tar
cd php-5.3.2
patch -p1 < ../fpm.patch
./buildconf --force
mkdir fpm-build && cd fpm-build

../configure --with-fpm --with-libevent=shared,/usr/lib --with-mcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --without-sqlite --disable-pdo --disable-reflection --with-libxml-dir=/usr/lib --with-mysqli=/usr/bin/mysql_config --with-curl --prefix=/usr/local/php --with-config-file-scan-dir=/etc/php.d --with-fpm-user=nginx --with-fpm-group=nginx


make install

cp php.ini.production /usr/local/php/lib/php.ini

Download the newest version of XCACHE from http://xcache.lighttpd.net/wiki/ReleaseArchive
cd ..
wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz
tar xvf xcache-1.3.0.tar.gz
cd xcache-1.3.0
./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
make install
cp xcache.ini /etc/php.d/xcache.ini
vi xcache.ini
comment out any lines which say "zend_extension", and instead place this line:
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/xcache.so

Set to run automatically on startup:
select "nginx" and "php-fpm"
hit save.

And your done!