出現此種狀況,是linux系統沒有安裝先決條件linux
一、GCC——GNU編譯器集合(GCC能夠使用默認包管理器的倉庫(repositories)來安裝,包管理器的選擇依賴於你使用的Linux發佈版本,包管理器有不一樣的實現:yum是基於Red Hat的發佈版本;apt用於Debian和Ubuntu;yast用於SuSE Linux等等。)nginx
RedHat中安裝GCC:c++
yum install gcc正則表達式
Ubuntu中安裝GCC:算法
apt-get install gcc安全
二、PCRE庫(Nginx編譯須要PCRE(Perl Compatible Regular Expression),由於Nginx的Rewrite模塊和HTTP核心模塊會使用到PCRE正則表達式語法。這裏須要安裝兩個安裝包pcre和pcre-devel。第一個安裝包提供編譯版本的庫,而第二個提供開發階段的頭文件和編譯項目的源代碼,這正是咱們須要的理由。)服務器
RedHat中安裝PCRE:app
yum install pcre pcre-develui
Ubuntu中安裝PCRE:google
apt-get install libpcre3 libpcre3-dev
三、zlib庫(zlib庫提供了開發人員的壓縮算法,在Nginx的各類模塊中須要使用gzip壓縮。如同安裝PCRE同樣,一樣須要安裝庫和它的源代碼:zlib和zlib-devel。)
RedHat中安裝zlib:
yum install zlib zlib-devel
Ubuntu中安裝zlib:
apt-get install zlib1g zlib1g-dev
四、OpenSSL庫(在Nginx中,若是服務器提供安全網頁時則會用到OpenSSL庫,咱們須要安裝庫文件和它的開發安裝包(openssl和openssl-devel)。)
RedHat中安裝OpenSSL:
yum install openssl openssl-devel
Ubuntu中安裝OpenSSL:(注:Ubuntu14.04的倉庫中沒有發現openssl-dev):
apt-get install openssl openssl-dev
注意:要不關閉防火牆,要否則放不了nginx頁面
Install Prerequisites First, install necessary packages to build Nginx as well as extra Nginx modules. On Debian, Ubuntu or Linux Mint: $ sudo apt-get install build-essential zlib1g-dev libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgd2-xpm-dev libgeoip-dev libgoogle-perftools-dev libperl-dev On Fedora, CentOS or RHEL: $ sudo yum install gcc-c++ pcre-devel zlib-devel make wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools-devel Nginx Compilation Download the latest stable version of Nginx from the official site. $ wget http://nginx.org/download/nginx-1.4.4.tar.gz Extract the content. Then run configure with appropriate options,