标签:源码安装 nginx
下载安装包
wget http://nginx.org/download/nginx-1.7.2.tar.gz
2.解压
切换到安装包的目录下
tar zxvf nginx-1.7.2.tar.gz
打开该文件
cd nginx-1.7.2/
3.运行
./configure
我这里出现了个错误,没有安装gcc
checking for OS + Linux 2.6.32-431.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler cc is not found
更新源,在网上找到更新源(http://chenrongya.blog.163.com/blog/static/8747419620143185103297/),复制到/etc/apt/source.list
apt-get install update deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse apt-get install update
安装gcc相关的程序
apt-get install gcc-4.8-aarch64-linux-gnu gcc-4.8-arm-linux-gnueabihf gcc-4.8-powerpc-linux-gnu gcc-4.8-powerpc64le-linux-gnu libdb5.1-java-gcj libgcrypt20-doc
安装PCRE库
apt-get update apt-get install libpcre3 libpcre3-dev 还需要安装 apt-get install openssl libssl-dev
安装Zlib库
sudo apt-get install zlib1g-dev
执行./configure
4.编译安装
make && make install
标签:源码安装 nginx
原文地址:http://dahui09.blog.51cto.com/10693267/1695050