This is the improvement of my previous Nginx version 0.8.53 with PHP 5.3.5 installation, and also this time i’m not using php-fpm to run fastcgi, i’m using php-cli command to run fastcgi, and the result is memory usage decreased about 50MB. So let’s get it on!
VPS: CentOS 5.5 32bit with 256MB RAM XEN
Add EPEL and REMI repository, also update YUM (we will use REMI reposity for PHP 5.3.5)
EPEL 32bit
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
EPEL 64bit
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
REMI
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
yum -y update
Install Nginx
yum -y install GeoIP GeoIP-devel GeoIP-data perl libperl
32bit
rpm -Uvh http://centos.alt.ru/repository/centos/5/i386/nginx-stable-0.8.54-1.el5.i386.rpm
64bit
rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/nginx-stable-0.8.54-1.el5.x86_64.rpm
start Nginx and add to init
/etc/init.d/nginx start
chkconfig --add nginx
chkconfig nginx on
Configure Nginx virtual host
As usual i prefer separate Nginx vhost for each domain so it will be easier to manage, and “/home” directory for domain root so it will ease you to synchronize domain root with ftp user root
create your domain root
mkdir -p /home/domain/public_html
mkdir -p /home/domain/logs
create two directory for domain vhost
mkdir /etc/nginx/sites-available
mkdir /etc/nginx/sites-enabled
edit Nginx configuration (more…)