Nginx 图片服务器安装配置

整理自:

 

http://coralzd.blog.51cto.com/90341/709068

 

 

1:安装pcre

2: 安装gzip 

        yum install -y zlib-devel

3: 利用google-perftools来优化高并发条件下的nginx

    3.1:首先需要先安装libunwind库

        wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99.tar.gz

tar zxvf libunwind-0.99.tar.gz

cd libunwind-0.99/

        CFLAGS=-fPIC ./configure --prefix=/usr

make CFLAGS=-fPIC

make CFLAGS=-fPIC install

     3.2:安装google-perftools

        wget http://google-perftools.googlecode.com/files/google-perftools-1.7.tar.gz

tar xzvf google-perftools-1.7.tar.gz

cd google-perftools-1.7

然后开始配置:

(32位可以不添加--enable-frame-pointers)

./configure --prefix=/usr --enable-frame-pointers 

make -j4 && make install

 4:安装nginx

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --without-http_fastcgi_module --without-http_proxy_module --without-http_upstream_ip_hash_module --without-http_autoindex_module --without-http_ssi_module   --without-http_proxy_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_uwsgi_module --without-http_scgi_module  --without-http_memcached_module --with-google_perftools_module 

make && make install

5:关联lib

在 /etc/ld.so.conf中加入/usr/local/lib这一行

否则启动nginx时报错:

error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory

 

6: /sbin/ldconfig  重新加载lib使之生效。

 

 

7:启动:

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

 

8:如果修改了conf文件执行

/usr/local/nginx/sbin/nginx -s  reload  重新加载conf文件即可生效

 

 

9:启动成功后查看进程:

ps -ef | grep nginx 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值