Rackspace.com Cloud Server – Nginx v1.0.2, PHP-FPM 5.3.6, Xcache v1.3.1, MariaDB 5.2.6 Install
Revisiting CentOS 5.x 64bit install on Rackspace.com Cloud Server environment but this time for testing source installation of Nginx v1.0.2, PHP 5.3.6 (php-fpm) and Xcache v1.3.1 along with MariaDB 5.2.6 64bit RPM binaries.
After installing it all manually, I came across a an awesome bash shell install script over at webhostingtalk.com called Centmin created by BTCental. This would reduce alot of the manual installation work involved!
Centmin is a bash script developed for use on CentOS 5.
It is designed to provide a fully functional NMP plus DNS stack – using minimal resources.BTCentral Centmin features:
– Updates any pre-installed software (via Yum)
– Secures /tmp (and /var/tmp) directories
– Installs development tools needed for compilation of Nginx and NSD
– Sets server to use your local timezone
– Installs Nginx, MySQL, PHP 5.3.6 (with FPM)
– Installs NSD (DNS Server – a low-memory alternative to BIND)
– Installs NTP (Other than on OpenVZ VPS)
– Installs Sendmail (enables PHP to use the mail function)
– Optional: Installs Alternative PHP Cache
Current Version: 1.1.0 (Released 29/04/2011)
Be sure to follow us on Twitter to keep informed of the latest updates.
How to use:
1) Download the script from:
London, UK (via Linode): wget http://www.centmin.com/download.php
New York, US (via 6sync): wget http://www.centmin.com/download.php?m=ny
Los Angeles, US (via PhotonVPS): wget http://www.centmin.com/download.php?m=la2) Extract the archive:
tar xzf centmin-latest.tar.gz3) Follow the instructions in the included readme.txt
Released under the GNU GPLv3 license – Readme – Change Log
So I modified the Centmin script with my own version of installation options and additional parameters. Then proceeded to do a few test installations on my local VirtualBox CentOS 5.6 based server. Update: I made a 2nd revision to add Memcached server support
Changes in my version:
- Changed script to install MariaDB 5.2.6 MySQL 64bit instead of MySQL standard versions included with CentOS 5.5 – MySQL 5.0.77
- Changed Nginx configure options with addition options and Google Perftool tcmalloc support
- Changed PHP 5.3.6 php-fpm installation to compile from source with additional options
- Both Nginx and PHP compiled with OpenSSL 1.0.0d support instead of OpenSSL 0.9.8e
- Changed config/php-fpm/www.conf to config/php-fpm/php-fpm.conf with adjusted options
- Added xcache v1.3.1 installation option
- Added config/mysql/my.cnf tuned for MariaDB 5.2.6
- Added config/xcache/xcache.ini settings for Xcache v1.3.1
- Added config/nginx/fastcgi_params with buffer tuning
- Added php support to default server in config/nginx/nginx.conf
- Removed fastcgi_intercept_errors on; options in virtual.conf as already added to fastcgi_params include file
- Added additional checks in php containers in virtual.conf
End result listed below
free -m total used free shared buffers cached Mem: 3270 506 2763 0 25 314 -/+ buffers/cache: 166 3103 Swap: 5279 0 5279 |
top - 01:40:27 up 2 min, 1 user, load average: 0.45, 0.26, 0.10 Tasks: 140 total, 1 running, 139 sleeping, 0 stopped, 0 zombie Cpu(s): 2.9%us, 3.3%sy, 0.0%ni, 80.6%id, 11.7%wa, 0.4%hi, 1.0%si, 0.0%st Mem: 3348500k total, 518712k used, 2829788k free, 26544k buffers Swap: 5406712k total, 0k used, 5406712k free, 321868k cached |
nginx -V nginx: nginx version: nginx/1.0.2 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50) nginx: TLS SNI support enabled nginx: configure arguments: --sbin-path=/usr/local/sbin --conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_sub_module --with-http_addition_module --with-http_secure_link_module --with-http_flv_module --with-http_sub_module --with-http_realip_module --add-module=../ngx-fancyindex-0.3.1 --add-module=../ngx_cache_purge-1.3 --add-module=../nginx-accesskey-2.0.3 --with-google_perftools_module --with-openssl=../openssl-1.0.0d --with-ld-opt=-ltcmalloc_minimal |
php -v PHP 5.3.6 (cli) (built: May 17 2011 01:29:54) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies with XCache v1.3.1, Copyright (c) 2005-2010, by mOo |
php -i | grep configure Configure Command => '../configure' '--enable-cgi' '--enable-fpm' '--with-mcrypt' '--with-mhash' '--with-zlib' '--with-gettext' '--enable-exif' '--enable-zip' '--with-bz2' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--with-pear' '--enable-mbstring' '--with-openssl=/usr/local' '--with-mysql=/usr/bin/' '--with-libdir=lib64' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql-sock' '--with-curl' '--with-gd' '--with-xmlrpc' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--without-sqlite' '--disable-pdo' '--with-fpm-user=nginx' '--with-fpm-group=nginx' |
php -i | grep MariaDB Client API version => 5.2.6-MariaDB Client API library version => 5.2.6-MariaDB Client API header version => 5.2.6-MariaDB |
mysqladmin ver mysqladmin Ver 9.0 Distrib 5.2.6-MariaDB, for unknown-linux-gnu on x86_64 Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc, 2009 Monty Program Ab This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Server version 5.2.6-MariaDB-mariadb101 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/lib/mysql/mysql.sock Uptime: 4 min 28 sec Threads: 1 Questions: 1 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.3 |
ulimit -aH core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 26623 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 63536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) unlimited cpu time (seconds, -t) unlimited max user processes (-u) 26623 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited |
PHP 5.3.6 (php-fpm) phpinfo screens:
Update: I made a 2nd revision to add Memcached server support
Changes in my 2nd revision version:
- Added libevent v2.0.10, memcached v1.4.5 and memcache v3.0.6 install routine
- Added config/memcached/memcached startup script
- 2x memcached servers each with 16MB memory on ports 11211 and 11212
- Added memcache.php admin page default username/password = user/pass to /usr/local/nginx/html/memcache.php
- Fixed php.ini date.timezone defaults to Australia/Brisbane via sed replacement
- Altered nginx.conf and virtual.conf to use drop.conf, php.conf and staticfiles.conf inclusions to clean up config files
free -m total used free shared buffers cached Mem: 3270 526 2743 0 25 315 -/+ buffers/cache: 184 3085 Swap: 5279 0 5279 |
top - 11:05:40 up 1 min, 1 user, load average: 0.76, 0.24, 0.08 Tasks: 142 total, 1 running, 141 sleeping, 0 stopped, 0 zombie Cpu(s): 4.3%us, 2.6%sy, 0.0%ni, 74.4%id, 16.0%wa, 0.5%hi, 2.3%si, 0.0%st Mem: 3348500k total, 538880k used, 2809620k free, 26468k buffers Swap: 5406712k total, 0k used, 5406712k free, 323020k cached |
ps aux | grep memcached nobody 3114 0.0 0.0 64572 856 ? Ssl 11:05 0:00 /usr/local/bin/memcached -d -m 16 -l 127.0.0.1 -p 11211 -c 2048 -t 4 -n 48 -f 1.05 -u nobody nobody 3116 0.0 0.0 130108 868 ? Ssl 11:05 0:00 /usr/local/bin/memcached -d -m 16 -l 127.0.0.1 -p 11212 -c 2048 -t 4 -n 48 -f 1.05 -u nobody |