CentOS 5.6 安裝Nginx

來源:互聯網
上載者:User

在/usr目錄下執行命令下載最新Nginx原始碼:

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

解壓後可以看到nginx-1.2.0目錄:

tar zxvf nginx-1.2.0.tar.gz

安裝PCRE庫

yum -y install pcre-devel

安裝openssl庫

yum -y install openssl openssl-devel

產生make file檔案:

./configure --prefix=/usr/nginx

結果要仔細看一下,有些很重要的資訊:

creating objs/MakefileConfiguration summary  + using system PCRE library  + OpenSSL library is not used  + md5: using system crypto library  + sha1: using system crypto library  + using system zlib library  nginx path prefix: "/usr/nginx"  nginx binary file: "/usr/nginx/sbin/nginx"  nginx configuration prefix: "/usr/nginx/conf"  nginx configuration file: "/usr/nginx/conf/nginx.conf"  nginx pid file: "/usr/nginx/logs/nginx.pid"  nginx error log file: "/usr/nginx/logs/error.log"  nginx http access log file: "/usr/nginx/logs/access.log"  nginx http client request body temporary files: "client_body_temp"  nginx http proxy temporary files: "proxy_temp"  nginx http fastcgi temporary files: "fastcgi_temp"  nginx http uwsgi temporary files: "uwsgi_temp"  nginx http scgi temporary files: "scgi_temp"

比如pid 檔案,error log檔案,access log檔案等等。

現在編譯和安裝:

make make install

進入/usr/nginx/sbin目錄下,可以執行nginx程式啟動。

如果要修改連接埠,修改/usr/nginx/conf/nginx.conf檔案,比如:

 server {        listen       8081;

聯繫我們

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