#!/usr/bin/env bash # author = purple_grape # name=lnmp_setup # version: 0.7 # purpose: ready-to-use lnmp # test under CentOS 6.2 only , use it at your own risk # last update : 2012-02-12 # set -x
if [ "$(id -u)" != "0" ]; then echo "This script is designed to run as root" 1>&2 exit 1 fi #------------------------------------------------------------------- # software version #Linux = RHEL6 #Nginx = 1.0.12 #Mysql = 5.5.20 #PHP = 5.3.10
# set nginx worker processes sed -i '/worker_processes/{s/10/2/g}' /etc/nginx/nginx.conf
# modify this to meet nginx verion 1.x sed -i '/limit_conn/{s/^/#/g}' /etc/nginx/nginx.conf
# correct php-fpm setting sed -i 's/apache/nginx/g' /etc/php-fpm.d/www.conf
#php timezone setting sed -i '/;date.timezone/{s/;//g;s/=/= Asia\/Shanghai/g}' /etc/php.ini
# pathinfo sed -i '/cgi.fix_pathinfo\=/{s/;//g;s/1/0/g}' /etc/php.ini
# set memory limit for php app sed -i '/memory_limit/{s/128/64/g}' /etc/php.ini
# enable and set shared memory for eaccelerator sed -i '/shm_size/{s/0/16/g}' /etc/php.d/eaccelerator.ini sed -i '/shm_only/{s/0/1/g}' /etc/php.d/eaccelerator.ini