#!/bin/bash
cur_dir=$(pwd)
useradd -s /sbin/nologin -r -M www
yum install -y make gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel wget
wget http://blog.offensive.cn/nginx/pcre-8.30.tar.bz2
wget http://blog.offensive.cn/nginx/nginx-1.0.14.tar.gz
wget http://blog.offensive.cn/nginx/libunwind-1.0.1.tar.gz
wget http://blog.offensive.cn/nginx/gperftools-2.0.tar.gz
cd $cur_dir
tar xvf pcre-8.30.tar.bz2
cd pcre-8.30
./configure
make
make install
cd $cur_dir
tar xvf libunwind-1.0.1.tar.gz
cd libunwind-1.0.1
CFLAGS=-fPIC ./configure
make CFLAGS=-fPIC
make CFLAGS=-fPIC install
cd $cur_dir
tar xvf gperftools-2.0.tar.gz
cd gperftools-2.0
./configure
make
make install
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig
cd $cur_dir
tar xvf nginx-1.0.14.tar.gz
cd nginx-1.0.14
sed -i "/CFLAGS=\"\$CFLAGS -g\"/s/^/#&/" auto/cc/gcc
./configure \
--user=www \
--group=www \
--prefix=/usr/local/nginx \
--with-http_stub_status_module \
--with-google_perftools_module \
--with-http_ssl_module \
--with-md5=/usr/lib \
--with-sha1=/usr/lib
make
make install
mkdir /tmp/tcmalloc
chmod 777 /tmp/tcmalloc
sed -i '/nginx.pid/a google_perftools_profiles /tmp/tcmalloc;' /usr/local/nginx/conf/nginx.conf
wget -c http://blog.offensive.cn/shell/nginx
chmod +x nginx
mv nginx /etc/init.d/
chkconfig --level 35 nginx on
nginx自動安裝腳本
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Nginx 安裝與配置規則入門
Lmagic16
2019-02-24 22:13:58
nginx+php執行請求的工作原理
xavier
2019-02-24 15:52:41
配置Nginx支持php,出現No input file specified錯誤的解決方法
lvqingpu
2019-02-24 13:15:35
深入 Nginx 之架構篇
jeffrey_up
2019-02-23 19:23:46
tcpdump查看Nginx長連接還是短連接
ouyangbro
2019-02-23 15:52:48
Nginx使用安裝(一)
flashhand
2019-02-23 13:58:28
nginx中gzip模塊
小紅帽子
2019-02-23 13:37:48
nginx+keepalived配置高可用HTTP羣集
小紅帽子
2019-02-23 13:37:48
Nginx服務之防盜鏈功能
兩袖春風
2019-02-23 13:28:22
寶塔面板 + Rancher + 阿里雲鏡像倉庫 + Docker + Kubernetes,添加集羣、部署 web 應用
燕小范
2019-02-23 13:20:14
nginx添加系統服務
braoshan
2019-02-23 13:15:21
Nginx簡易實用的php域名配置
wx5c6f5798d627c
2019-02-23 13:07:16
nginx日誌通過rsyslog傳入到日誌服務器指定目錄
郭雨明暄
2019-02-23 13:05:42
LNMP架設 (備忘錄)
chengcai
2019-02-23 13:08:35