Nginx編譯安裝&Php+xcache編譯安裝腳本

自己搭建測試環境的腳本,不可能完全適用於大家的,可做參考。
useradd -r nginx #add user for runing nginx #添加Nginx用戶
wget http://nginx.org/download/nginx-1.4.7.tar.gz  #download nginx 
tar xf nginx-1.4.7.tar.gz
cd /root/nginx-1.4.7
./configure \
  --prefix=/usr/local/nginx \
  --sbin-path=/usr/local/nginx/sbin/nginx \
  --conf-path=/etc/nginx/nginx.conf \
  --error-log-path=/var/log/nginx/error.log \
  --http-log-path=/var/log/nginx/access.log \
  --pid-path=/var/run/nginx/nginx.pid  \
  --lock-path=/var/lock/nginx.lock \
  --user=nginx \
  --group=nginx \
  --with-http_ssl_module \
  --with-http_flv_module \
  --with-http_stub_status_module \
  --with-http_gzip_static_module \
  --http-client-body-temp-path=/var/tmp/nginx/client/ \
  --http-proxy-temp-path=/var/tmp/nginx/proxy/ \
  --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
  --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
  --http-scgi-temp-path=/var/tmp/nginx/scgi \
  --with-pcre
make && make install
wget ftp://10.0.0.122/pub/sources/nginx/nginx -P /etc/rc.d/init.d/
chmod +x /etc/rc.d/init.d/nginx
chkconfig --add nginx
chkconfig nginx on
service nginx start
#install php
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
yum -y install httpd-devel.x86_64 libxml2-devel openssl-devel bzip2-devel libmcrypt-devel 
wget ftp://10.0.0.122/pub/sources/php/php-5.4.19.tar.bz2
tar xf php-5.4.19.tar.bz2
cd php-5.4.19
./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml  --enable-sockets --enable-fpm --with-mcrypt  --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2
make && make install
cp php.ini-production /etc/php.ini
cp sapi/fpm/init.d.php-fpm  /etc/rc.d/init.d/php-fpm
chmod +x /etc/rc.d/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
service php-fpm start

#install xcache
cd
wget http://xcache.lighttpd.net/pub/Releases/3.0.4/xcache-3.0.4.tar.gz
tar xf xcache-3.0.4.tar.gz
cd xcache-3.0.4
/usr/local/php/bin/phpize
./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
make && make install
mkdir /etc/php.d
cp xcache.ini /etc/php.d


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章