Nginx install script, PHP 5.3.6 (php-fpm), MariaDB 5.2.6, Xcache v1.3.1, Memcached server, CSF firewall, Siege Benchmark
Centmin Nginx install script for CentOS servers by BTCentral was mentioned previously here. I’ve modified the script to suit my needs for Nginx v1.0.2 web server installations on CentOS 5.5 64bit environments, adding MariaDB 5.2.6 MySQL, Xcache v1.3.1, Memcached 1.4.5 servers, CSF Firewall as well as Siege benchmark script support. Note this modified version is for CentOS 5.x 64bit environments and you can update the version numbers in centmin.sh script itself when new versions come out i.e. Nginx v1.0.3, PHP 5.3.7, MariaDB 5.2.7 etc. Update: Centmin modified version has been updated and is now available here.
Updated:
June 5th, 2011
- updated to Nginx v1.0.4
June 6th, 2011
- My modified version v0.4.2 released to update mysqltuner.pl url download link.
- Official Centmin v1.2.0 has been released incorporating alot of my modifications minus Memcached server though. Official Centmin v1.2.0 cleaned up my code so it works with both CentOS 32bit and 64bit OS systems so I recommend you use that version when you can from here. I’ll be basing future modifications and additions on official Centmin v1.2.0 script :)
June 9th, 2011
- First modified version of mine based on Centmin v1.2.0 – details here
[box type=”warning”] Note: that Centmin script is meant for freshly installed virgin CentOS 5.x 64bit based servers and has only been tested on such. If you try this script on existing server, it’s unknown what the effects are.
Please test the script on a test server before using on a live production server. There’s no support for the modified Centmin script. Script is provided as is.[/box]
I made 5 sets of changes grouped below:
v1.1.0mod3.2 eva2000 custom based on v1.1.0 – 06/06/2011
- centmin-mariadbmemc_v0.4.2.zip
- Updated mysqltuner.pl download link as mysqltuner.pl no longer maintained at mysqltuner.pl address but at https://github.com/rackerhacker/MySQLTuner-perl
v1.1.0mod3.1 eva2000 custom based on v1.1.0 05/06/2011
- centmin-mariadbmemc_v0.4.1.zip
- Updated for Nginx v1.04
- Added PCRE 8.12
- Fixed nginx init.d script path for chmod +x
- Added Siege Sproxy
- Updated some wget lines to original v1.1.0 centmin and nginx custom modules to check for existing file to determine if downloading is needed
v1.1.0mod3 eva2000 custom based on v1.1.0 19/05/2011
- Added Siege benchmark script simple 10 concurrency with 10 rep test with default 1 second delay between: siege c 10 r 10 d 1 localhost/index.html
- check history of seige benchmark runs: tail 25 /usr/local/var/siege.log
- Tweaked nginx.conf settings some more
v1.1.0mod2 eva2000 custom based on v1.1.0 18/05/2011
- Modified script end deletion routine to ask if user wants to delete script after installation. Might be useful to leave script contents intact to be able to rerun compile options etc to troubleshoot and diagnose errors after installation
- Added CSF firewall script configserver.com
- 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
v1.1.0mod eva2000 custom based on v1.1.0 16/05/2011
- Changed script to install MariaDB 5.2.6 MySQL 64bit instead of MySQL standard versions
- Changed Nginx configure options with addition options and Google Perftool tcmalloc support
- Changed PHP 5.3.6 phpfpm 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/phpfpm/www.conf to config/phpfpm/phpfpm.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
try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$;
total used free shared buffers cached Mem: 3270 838 2431 0 29 602 -/+ buffers/cache: 206 3063 Swap: 5279 0 5279 top - 17:18:21 up 1 min, 2 users, load average: 0.73, 0.29, 0.10 Tasks: 144 total, 1 running, 143 sleeping, 0 stopped, 0 zombie Cpu(s): 4.1%us, 2.6%sy, 0.0%ni, 69.7%id, 21.6%wa, 0.5%hi, 1.5%si, 0.0%st Mem: 3348500k total, 858560k used, 2489940k free, 30440k buffers Swap: 5406712k total, 0k used, 5406712k free, 616896k cached |
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_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 5.3.6 (cli) (built: May 19 2011 16:54:07) 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 |
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' |
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 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: 49 sec Threads: 1 Questions: 1 Slow queries: 0 Opens: 15 Flush tables: 1 Open tables: 8 Queries per second avg: 0.20 |
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 |
/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 /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 |