nginx源碼安裝

來源:互聯網
上載者:User

nginx源碼安裝        安裝環境:                      作業系統:Ubuntu 12.04                      Nginx:     V1.4.2                      PCRE:    V8.33                      zlib:         V1.2.8        下載上述源包到目前使用者主目錄(本機:/home/tdtc100)。        1. 安裝zlib            (1)解壓縮 [plain] tdtc100@ubuntu:~$ tar zxvf zlib-1.2.8.tar.gz             (2)安裝 [plain] tdtc100@ubuntu:~$ cd zlib-1.2.8  tdtc100@ubuntu:~/zlib-1.2.8$ ./configure  tdtc100@ubuntu:~/zlib-1.2.8$ make  tdtc100@ubuntu:~/zlib-1.2.8$ sudo make install         2. 安裝PCRE            (1) 安裝依賴包              c++ [plain] sudo apt-get install build-essential              註:如果不安裝,在進行(3)時,會出現: [plain] configure: error: You need a C++ compiler for C++ support.            (2)解壓縮 [plain] tdtc100@ubuntu:~$ tar zxvf pcre-8.33.tar.gz             (3)安裝 [plain] tdtc100@ubuntu:~$ cd pcre-8.33  tdtc100@ubuntu:~/pcre-8.33$ ./configure  tdtc100@ubuntu:~/pcre-8.33$ make  tdtc100@ubuntu:~/pcre-8.33$ sudo make install          3. 安裝nginx           (1)安裝依賴包             open-ssl library [plain] sudo apt-get install libcurl4-openssl-dev              註:如果不安裝,在進行(3)時,會出現: [plain] ./configure: error: SSL modules require the OpenSSL library.  You can either do not enable the modules, or install the OpenSSL library  into the system, or build the OpenSSL library statically from the source  with nginx by using --with-openssl=<path> option.            (2)解壓縮 [plain] tdtc100@ubuntu:~$ tar zxvf nginx-1.4.2.tar.gz            (3)安裝                   參考官方文檔[plain] tdtc100@ubuntu:~$ cd nginx-1.4.2  tdtc100@ubuntu:~/nginx-1.4.2$ ./configure \  > --sbin-path=/usr/local/nginx/nginx \  > --conf-path=/usr/local/nginx/nginx.conf \  > --pid-path=/usr/local/nginx/nginx.pid \  > --with-http_ssl_module \  > --with-pcre=../pcre-8.33 \  > --with-zlib=../zlib-1.1.3  tdtc100@ubuntu:~/nginx-1.4.2$ make  tdtc100@ubuntu:~/nginx-1.4.2$ sudo make install    -------------------------安裝完畢-----------------------xiaobin_hlj80-------------------------------------------   運行: [plain] tdtc100@ubuntu:/usr/local/nginx$ sudo ./nginx   運行效果: 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.