CentOS安裝Nginx

來源:互聯網
上載者:User

標籤:http   os   ar   c++   amp   type   安裝   ad   

一、安裝基礎環境包

yum -y install gcc gcc-c++ openssl*
yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
yum -y install libxml2 libxml2-devel zlib zlib-devel ncurses ncurses-devvel curl curl-devel
yum -y install gd gd2 gd-devel gd2-devel

二、安裝PCRE

1、下載

    wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz

2、解壓

  tar zxvf pcre-8.35.tar.gz

3、安裝

  cd pcre-8.35

  ./configure

  make && make install

三、安裝Nginx

1、下載Nginx

  wget http://nginx.org/download/nginx-1.7.3.tar.gz

2、解壓

  tar zxvf nginx-1.7.3.tar.gz

3、安裝

  cd nginx-1.7.3

  ./configure --prefix=/opt/nginx --with-http_ssl_module  --with-http_stub_status_module 

  make && make install

  註:--prefix=/opt/nginx,nging安裝目錄;--with-http_ssl_module,開啟HTTP SSL模組,使NGINX可以支援HTTPS請求。這個模組需要已經安裝了OpenSSL;--with-http_stub_status_module,開啟 nginx 的 NginxStatus功能,用來監控 Nginx 的目前狀態。

四、啟動Nginx

  echo "/usr/local/lib" >>/etc/ld.so.conf

  tail -1 /etc/ld.so.conf

  ldconfig

  /opt/nginx/sbin/nginx

  lsof -i:80

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.